From 8b9f04b378d6ae40063e999712d863c335a745a8 Mon Sep 17 00:00:00 2001 From: Dmitry Pogrebnoy Date: Fri, 10 Jan 2025 12:34:51 +0100 Subject: [PATCH] RUBY-32905 Remove headers for Ruby-3.4.0 previews --- .../ruby-3.4.0-preview1/addr2line.h | 22 - .../ruby-3.4.0-preview1/builtin.h | 119 - .../ccan/build_assert/build_assert.h | 40 - .../ccan/check_type/check_type.h | 63 - .../ccan/container_of/container_of.h | 142 - .../ruby-3.4.0-preview1/ccan/list/list.h | 791 -- .../ruby-3.4.0-preview1/ccan/str/str.h | 17 - .../ruby-3.4.0-preview1/constant.h | 53 - .../ruby-3.4.0-preview1/darray.h | 191 - .../ruby-3.4.0-preview1/debug_counter.h | 423 - .../ruby-3.4.0-preview1/dln.h | 34 - .../ruby-3.4.0-preview1/encindex.h | 70 - .../ruby-3.4.0-preview1/eval_intern.h | 324 - .../ruby-3.4.0-preview1/hrtime.h | 237 - .../ruby_core_source/ruby-3.4.0-preview1/id.h | 343 - .../ruby-3.4.0-preview1/id_table.h | 39 - .../ruby-3.4.0-preview1/insns.inc | 259 - .../ruby-3.4.0-preview1/insns_info.inc | 9530 ---------------- .../ruby-3.4.0-preview1/internal.h | 108 - .../ruby-3.4.0-preview1/internal/array.h | 151 - .../internal/basic_operators.h | 63 - .../ruby-3.4.0-preview1/internal/bignum.h | 244 - .../ruby-3.4.0-preview1/internal/bits.h | 568 - .../ruby-3.4.0-preview1/internal/class.h | 283 - .../ruby-3.4.0-preview1/internal/cmdlineopt.h | 65 - .../ruby-3.4.0-preview1/internal/compar.h | 29 - .../ruby-3.4.0-preview1/internal/compile.h | 34 - .../ruby-3.4.0-preview1/internal/compilers.h | 107 - .../ruby-3.4.0-preview1/internal/complex.h | 29 - .../ruby-3.4.0-preview1/internal/cont.h | 35 - .../ruby-3.4.0-preview1/internal/dir.h | 16 - .../ruby-3.4.0-preview1/internal/enc.h | 19 - .../ruby-3.4.0-preview1/internal/encoding.h | 36 - .../ruby-3.4.0-preview1/internal/enum.h | 18 - .../ruby-3.4.0-preview1/internal/enumerator.h | 21 - .../ruby-3.4.0-preview1/internal/error.h | 216 - .../ruby-3.4.0-preview1/internal/eval.h | 33 - .../ruby-3.4.0-preview1/internal/file.h | 38 - .../ruby-3.4.0-preview1/internal/fixnum.h | 184 - .../ruby-3.4.0-preview1/internal/gc.h | 334 - .../ruby-3.4.0-preview1/internal/hash.h | 191 - .../ruby-3.4.0-preview1/internal/imemo.h | 260 - .../ruby-3.4.0-preview1/internal/inits.h | 47 - .../ruby-3.4.0-preview1/internal/io.h | 140 - .../ruby-3.4.0-preview1/internal/load.h | 18 - .../ruby-3.4.0-preview1/internal/loadpath.h | 16 - .../ruby-3.4.0-preview1/internal/math.h | 23 - .../ruby-3.4.0-preview1/internal/missing.h | 19 - .../ruby-3.4.0-preview1/internal/numeric.h | 274 - .../ruby-3.4.0-preview1/internal/object.h | 63 - .../ruby-3.4.0-preview1/internal/parse.h | 117 - .../ruby-3.4.0-preview1/internal/proc.h | 30 - .../ruby-3.4.0-preview1/internal/process.h | 124 - .../ruby-3.4.0-preview1/internal/ractor.h | 6 - .../ruby-3.4.0-preview1/internal/random.h | 17 - .../ruby-3.4.0-preview1/internal/range.h | 40 - .../ruby-3.4.0-preview1/internal/rational.h | 71 - .../ruby-3.4.0-preview1/internal/re.h | 28 - .../internal/ruby_parser.h | 102 - .../ruby-3.4.0-preview1/internal/sanitizers.h | 297 - .../ruby-3.4.0-preview1/internal/serial.h | 23 - .../ruby-3.4.0-preview1/internal/signal.h | 24 - .../ruby-3.4.0-preview1/internal/st.h | 11 - .../internal/static_assert.h | 16 - .../ruby-3.4.0-preview1/internal/string.h | 182 - .../ruby-3.4.0-preview1/internal/struct.h | 127 - .../ruby-3.4.0-preview1/internal/symbol.h | 45 - .../ruby-3.4.0-preview1/internal/thread.h | 79 - .../ruby-3.4.0-preview1/internal/time.h | 34 - .../ruby-3.4.0-preview1/internal/transcode.h | 23 - .../ruby-3.4.0-preview1/internal/util.h | 27 - .../ruby-3.4.0-preview1/internal/variable.h | 72 - .../ruby-3.4.0-preview1/internal/vm.h | 137 - .../ruby-3.4.0-preview1/internal/warnings.h | 16 - .../ruby-3.4.0-preview1/iseq.h | 340 - .../ruby-3.4.0-preview1/known_errors.inc | 1419 --- .../ruby-3.4.0-preview1/method.h | 255 - .../ruby-3.4.0-preview1/node.h | 111 - .../ruby-3.4.0-preview1/node_name.inc | 224 - .../ruby-3.4.0-preview1/optinsn.inc | 128 - .../ruby-3.4.0-preview1/optunifs.inc | 43 - .../ruby-3.4.0-preview1/parse.h | 243 - .../ruby-3.4.0-preview1/parser_bits.h | 564 - .../ruby-3.4.0-preview1/parser_node.h | 32 - .../ruby-3.4.0-preview1/parser_st.h | 162 - .../ruby-3.4.0-preview1/parser_value.h | 106 - .../ruby-3.4.0-preview1/prism/ast.h | 6245 ----------- .../ruby-3.4.0-preview1/prism/defines.h | 206 - .../ruby-3.4.0-preview1/prism/diagnostic.h | 433 - .../ruby-3.4.0-preview1/prism/encoding.h | 283 - .../ruby-3.4.0-preview1/prism/extension.h | 19 - .../ruby-3.4.0-preview1/prism/node.h | 150 - .../ruby-3.4.0-preview1/prism/options.h | 305 - .../ruby-3.4.0-preview1/prism/pack.h | 163 - .../ruby-3.4.0-preview1/prism/parser.h | 891 -- .../ruby-3.4.0-preview1/prism/prettyprint.h | 34 - .../ruby-3.4.0-preview1/prism/prism.h | 347 - .../ruby-3.4.0-preview1/prism/regexp.h | 33 - .../prism/static_literals.h | 120 - .../prism/util/pm_buffer.h | 218 - .../ruby-3.4.0-preview1/prism/util/pm_char.h | 205 - .../prism/util/pm_constant_pool.h | 226 - .../prism/util/pm_integer.h | 119 - .../ruby-3.4.0-preview1/prism/util/pm_list.h | 97 - .../prism/util/pm_memchr.h | 29 - .../prism/util/pm_newline_list.h | 102 - .../prism/util/pm_string.h | 174 - .../prism/util/pm_string_list.h | 44 - .../prism/util/pm_strncasecmp.h | 32 - .../prism/util/pm_strpbrk.h | 46 - .../ruby-3.4.0-preview1/prism/version.h | 29 - .../ruby-3.4.0-preview1/prism_compile.h | 88 - .../ruby-3.4.0-preview1/probes_helper.h | 42 - .../ruby-3.4.0-preview1/ractor_core.h | 393 - .../ruby-3.4.0-preview1/regenc.h | 254 - .../ruby-3.4.0-preview1/regint.h | 1010 -- .../ruby-3.4.0-preview1/regparse.h | 371 - .../ruby-3.4.0-preview1/revision.h | 5 - .../ruby-3.4.0-preview1/rjit.h | 101 - .../ruby-3.4.0-preview1/rjit_c.h | 165 - .../ruby-3.4.0-preview1/ruby_assert.h | 14 - .../ruby-3.4.0-preview1/ruby_atomic.h | 23 - .../ruby-3.4.0-preview1/rubyparser.h | 1430 --- .../ruby-3.4.0-preview1/shape.h | 233 - .../ruby-3.4.0-preview1/siphash.h | 48 - .../ruby-3.4.0-preview1/symbol.h | 118 - .../ruby-3.4.0-preview1/thread_none.h | 21 - .../ruby-3.4.0-preview1/thread_pthread.h | 166 - .../ruby-3.4.0-preview1/thread_win32.h | 58 - .../ruby-3.4.0-preview1/timev.h | 58 - .../ruby-3.4.0-preview1/transcode_data.h | 138 - .../ruby-3.4.0-preview1/variable.h | 39 - .../ruby-3.4.0-preview1/version.h | 69 - .../ruby-3.4.0-preview1/vm.inc | 5643 ---------- .../vm_call_iseq_optimized.inc | 244 - .../ruby-3.4.0-preview1/vm_callinfo.h | 605 - .../ruby-3.4.0-preview1/vm_core.h | 2236 ---- .../ruby-3.4.0-preview1/vm_debug.h | 124 - .../ruby-3.4.0-preview1/vm_exec.h | 199 - .../ruby-3.4.0-preview1/vm_insnhelper.h | 272 - .../ruby-3.4.0-preview1/vm_opts.h | 67 - .../ruby-3.4.0-preview1/vm_sync.h | 137 - .../ruby-3.4.0-preview1/vmtc.inc | 253 - .../ruby-3.4.0-preview1/yjit.h | 79 - .../ruby-3.4.0-preview2/addr2line.h | 22 - .../ruby-3.4.0-preview2/builtin.h | 119 - .../ccan/build_assert/build_assert.h | 40 - .../ccan/check_type/check_type.h | 63 - .../ccan/container_of/container_of.h | 142 - .../ruby-3.4.0-preview2/ccan/list/list.h | 791 -- .../ruby-3.4.0-preview2/ccan/str/str.h | 17 - .../ruby-3.4.0-preview2/constant.h | 53 - .../ruby-3.4.0-preview2/darray.h | 209 - .../ruby-3.4.0-preview2/debug_counter.h | 423 - .../ruby-3.4.0-preview2/dln.h | 32 - .../ruby-3.4.0-preview2/encindex.h | 70 - .../ruby-3.4.0-preview2/eval_intern.h | 324 - .../ruby-3.4.0-preview2/hrtime.h | 237 - .../ruby_core_source/ruby-3.4.0-preview2/id.h | 347 - .../ruby-3.4.0-preview2/id_table.h | 39 - .../ruby-3.4.0-preview2/insns.inc | 265 - .../ruby-3.4.0-preview2/insns_info.inc | 9902 ----------------- .../ruby-3.4.0-preview2/internal.h | 108 - .../ruby-3.4.0-preview2/internal/array.h | 152 - .../internal/basic_operators.h | 64 - .../ruby-3.4.0-preview2/internal/bignum.h | 244 - .../ruby-3.4.0-preview2/internal/bits.h | 568 - .../ruby-3.4.0-preview2/internal/class.h | 283 - .../ruby-3.4.0-preview2/internal/cmdlineopt.h | 65 - .../ruby-3.4.0-preview2/internal/compar.h | 29 - .../ruby-3.4.0-preview2/internal/compile.h | 34 - .../ruby-3.4.0-preview2/internal/compilers.h | 107 - .../ruby-3.4.0-preview2/internal/complex.h | 29 - .../ruby-3.4.0-preview2/internal/cont.h | 35 - .../ruby-3.4.0-preview2/internal/dir.h | 16 - .../ruby-3.4.0-preview2/internal/enc.h | 19 - .../ruby-3.4.0-preview2/internal/encoding.h | 36 - .../ruby-3.4.0-preview2/internal/enum.h | 18 - .../ruby-3.4.0-preview2/internal/enumerator.h | 21 - .../ruby-3.4.0-preview2/internal/error.h | 218 - .../ruby-3.4.0-preview2/internal/eval.h | 33 - .../ruby-3.4.0-preview2/internal/file.h | 38 - .../ruby-3.4.0-preview2/internal/fixnum.h | 184 - .../ruby-3.4.0-preview2/internal/gc.h | 322 - .../ruby-3.4.0-preview2/internal/hash.h | 192 - .../ruby-3.4.0-preview2/internal/imemo.h | 261 - .../ruby-3.4.0-preview2/internal/inits.h | 47 - .../ruby-3.4.0-preview2/internal/io.h | 143 - .../ruby-3.4.0-preview2/internal/load.h | 18 - .../ruby-3.4.0-preview2/internal/loadpath.h | 16 - .../ruby-3.4.0-preview2/internal/math.h | 23 - .../ruby-3.4.0-preview2/internal/missing.h | 19 - .../ruby-3.4.0-preview2/internal/numeric.h | 274 - .../ruby-3.4.0-preview2/internal/object.h | 63 - .../ruby-3.4.0-preview2/internal/parse.h | 129 - .../ruby-3.4.0-preview2/internal/proc.h | 30 - .../ruby-3.4.0-preview2/internal/process.h | 124 - .../ruby-3.4.0-preview2/internal/ractor.h | 6 - .../ruby-3.4.0-preview2/internal/random.h | 17 - .../ruby-3.4.0-preview2/internal/range.h | 40 - .../ruby-3.4.0-preview2/internal/rational.h | 71 - .../ruby-3.4.0-preview2/internal/re.h | 28 - .../internal/ruby_parser.h | 102 - .../ruby-3.4.0-preview2/internal/sanitizers.h | 326 - .../ruby-3.4.0-preview2/internal/serial.h | 23 - .../ruby-3.4.0-preview2/internal/signal.h | 24 - .../ruby-3.4.0-preview2/internal/st.h | 11 - .../internal/static_assert.h | 16 - .../ruby-3.4.0-preview2/internal/string.h | 186 - .../ruby-3.4.0-preview2/internal/struct.h | 127 - .../ruby-3.4.0-preview2/internal/symbol.h | 45 - .../ruby-3.4.0-preview2/internal/thread.h | 85 - .../ruby-3.4.0-preview2/internal/time.h | 34 - .../ruby-3.4.0-preview2/internal/transcode.h | 23 - .../ruby-3.4.0-preview2/internal/util.h | 27 - .../ruby-3.4.0-preview2/internal/variable.h | 72 - .../ruby-3.4.0-preview2/internal/vm.h | 137 - .../ruby-3.4.0-preview2/internal/warnings.h | 16 - .../ruby-3.4.0-preview2/iseq.h | 340 - .../ruby-3.4.0-preview2/known_errors.inc | 1419 --- .../ruby-3.4.0-preview2/method.h | 255 - .../ruby-3.4.0-preview2/node.h | 111 - .../ruby-3.4.0-preview2/node_name.inc | 224 - .../ruby-3.4.0-preview2/optinsn.inc | 128 - .../ruby-3.4.0-preview2/optunifs.inc | 43 - .../ruby-3.4.0-preview2/parse.h | 244 - .../ruby-3.4.0-preview2/parser_bits.h | 564 - .../ruby-3.4.0-preview2/parser_node.h | 32 - .../ruby-3.4.0-preview2/parser_st.h | 162 - .../ruby-3.4.0-preview2/parser_value.h | 106 - .../ruby-3.4.0-preview2/prism/ast.h | 7524 ------------- .../ruby-3.4.0-preview2/prism/defines.h | 242 - .../ruby-3.4.0-preview2/prism/diagnostic.h | 450 - .../ruby-3.4.0-preview2/prism/encoding.h | 283 - .../ruby-3.4.0-preview2/prism/extension.h | 19 - .../ruby-3.4.0-preview2/prism/node.h | 129 - .../ruby-3.4.0-preview2/prism/options.h | 396 - .../ruby-3.4.0-preview2/prism/pack.h | 163 - .../ruby-3.4.0-preview2/prism/parser.h | 933 -- .../ruby-3.4.0-preview2/prism/prettyprint.h | 34 - .../ruby-3.4.0-preview2/prism/prism.h | 336 - .../ruby-3.4.0-preview2/prism/regexp.h | 43 - .../prism/static_literals.h | 121 - .../prism/util/pm_buffer.h | 218 - .../ruby-3.4.0-preview2/prism/util/pm_char.h | 204 - .../prism/util/pm_constant_pool.h | 218 - .../prism/util/pm_integer.h | 126 - .../ruby-3.4.0-preview2/prism/util/pm_list.h | 97 - .../prism/util/pm_memchr.h | 29 - .../prism/util/pm_newline_list.h | 113 - .../prism/util/pm_string.h | 190 - .../prism/util/pm_strncasecmp.h | 32 - .../prism/util/pm_strpbrk.h | 46 - .../ruby-3.4.0-preview2/prism/version.h | 29 - .../ruby-3.4.0-preview2/prism_compile.h | 99 - .../ruby-3.4.0-preview2/probes_helper.h | 42 - .../ruby-3.4.0-preview2/ractor_core.h | 382 - .../ruby-3.4.0-preview2/regenc.h | 254 - .../ruby-3.4.0-preview2/regint.h | 1006 -- .../ruby-3.4.0-preview2/regparse.h | 371 - .../ruby-3.4.0-preview2/revision.h | 5 - .../ruby-3.4.0-preview2/rjit.h | 101 - .../ruby-3.4.0-preview2/rjit_c.h | 165 - .../ruby-3.4.0-preview2/ruby_assert.h | 14 - .../ruby-3.4.0-preview2/ruby_atomic.h | 23 - .../ruby-3.4.0-preview2/rubyparser.h | 1350 --- .../ruby-3.4.0-preview2/shape.h | 234 - .../ruby-3.4.0-preview2/siphash.h | 48 - .../ruby-3.4.0-preview2/symbol.h | 123 - .../ruby-3.4.0-preview2/thread_none.h | 21 - .../ruby-3.4.0-preview2/thread_pthread.h | 168 - .../ruby-3.4.0-preview2/thread_win32.h | 58 - .../ruby-3.4.0-preview2/timev.h | 58 - .../ruby-3.4.0-preview2/transcode_data.h | 138 - .../ruby-3.4.0-preview2/variable.h | 39 - .../ruby-3.4.0-preview2/version.h | 69 - .../ruby-3.4.0-preview2/vm.inc | 5840 ---------- .../vm_call_iseq_optimized.inc | 244 - .../ruby-3.4.0-preview2/vm_callinfo.h | 627 -- .../ruby-3.4.0-preview2/vm_core.h | 2222 ---- .../ruby-3.4.0-preview2/vm_debug.h | 124 - .../ruby-3.4.0-preview2/vm_exec.h | 199 - .../ruby-3.4.0-preview2/vm_insnhelper.h | 277 - .../ruby-3.4.0-preview2/vm_opts.h | 67 - .../ruby-3.4.0-preview2/vm_sync.h | 137 - .../ruby-3.4.0-preview2/vmtc.inc | 259 - .../ruby-3.4.0-preview2/yjit.h | 79 - 287 files changed, 95826 deletions(-) delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ractor.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/random.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/addr2line.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/builtin.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/constant.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/darray.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/debug_counter.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/dln.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/encindex.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/hrtime.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/id.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/id_table.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns_info.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/array.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/class.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/error.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/file.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/hash.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/io.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/load.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/math.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/object.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/parse.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/process.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ractor.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/random.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/range.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/re.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/st.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/string.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/time.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/util.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/iseq.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/known_errors.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/method.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/node.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/node_name.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/optunifs.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/parse.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_node.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_st.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_value.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/extension.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/node.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/options.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/parser.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/regexp.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/static_literals.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_char.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_constant_pool.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_integer.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_newline_list.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_string.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/version.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/regenc.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/regint.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/regparse.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/shape.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/siphash.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/symbol.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_none.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/timev.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/variable.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/version.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_callinfo.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_core.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_insnhelper.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_sync.h delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/vmtc.inc delete mode 100644 lib/debase/ruby_core_source/ruby-3.4.0-preview2/yjit.h diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h deleted file mode 100644 index ff8e476..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RUBY_ADDR2LINE_H -#define RUBY_ADDR2LINE_H -/********************************************************************** - - addr2line.h - - - $Author$ - - Copyright (C) 2010 Shinichiro Hamaji - -**********************************************************************/ - -#if (defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H)) - -#include - -void -rb_dump_backtrace_with_lines(int num_traces, void **traces, FILE *errout); - -#endif /* USE_ELF */ - -#endif /* RUBY_ADDR2LINE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h deleted file mode 100644 index 24aa7c2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef BUILTIN_H_INCLUDED -#define BUILTIN_H_INCLUDED - -// invoke - -struct rb_builtin_function { - // for invocation - const void * const func_ptr; - const int argc; - - // for load - const int index; - const char * const name; -}; - -#define RB_BUILTIN_FUNCTION(_i, _name, _fname, _arity) {\ - .name = _i < 0 ? NULL : #_name, \ - .func_ptr = (void *)_fname, \ - .argc = _arity, \ - .index = _i, \ -} - -void rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table); - -#ifndef rb_execution_context_t -typedef struct rb_execution_context_struct rb_execution_context_t; -#define rb_execution_context_t rb_execution_context_t -#endif - -/* The following code is generated by the following Ruby script: - -typedef = proc {|i, args| - "typedef VALUE (*rb_builtin_arity#{i}_function_type)(rb_execution_context_t *ec, VALUE self#{args});" -} -puts typedef[0, ""] -(1..15).each {|i| - puts typedef[i, ",\n " + (0...i).map{"VALUE"}.join(", ")] -} -16.times{|i| - puts "static inline void rb_builtin_function_check_arity#{i}(rb_builtin_arity#{i}_function_type f){}" -} -*/ - -typedef VALUE (*rb_builtin_arity0_function_type)(rb_execution_context_t *ec, VALUE self); -typedef VALUE (*rb_builtin_arity1_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE); -typedef VALUE (*rb_builtin_arity2_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE); -typedef VALUE (*rb_builtin_arity3_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity4_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity5_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity6_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity7_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity8_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity9_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity10_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity11_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity12_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity13_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity14_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity15_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -static inline void rb_builtin_function_check_arity0(rb_builtin_arity0_function_type f){} -static inline void rb_builtin_function_check_arity1(rb_builtin_arity1_function_type f){} -static inline void rb_builtin_function_check_arity2(rb_builtin_arity2_function_type f){} -static inline void rb_builtin_function_check_arity3(rb_builtin_arity3_function_type f){} -static inline void rb_builtin_function_check_arity4(rb_builtin_arity4_function_type f){} -static inline void rb_builtin_function_check_arity5(rb_builtin_arity5_function_type f){} -static inline void rb_builtin_function_check_arity6(rb_builtin_arity6_function_type f){} -static inline void rb_builtin_function_check_arity7(rb_builtin_arity7_function_type f){} -static inline void rb_builtin_function_check_arity8(rb_builtin_arity8_function_type f){} -static inline void rb_builtin_function_check_arity9(rb_builtin_arity9_function_type f){} -static inline void rb_builtin_function_check_arity10(rb_builtin_arity10_function_type f){} -static inline void rb_builtin_function_check_arity11(rb_builtin_arity11_function_type f){} -static inline void rb_builtin_function_check_arity12(rb_builtin_arity12_function_type f){} -static inline void rb_builtin_function_check_arity13(rb_builtin_arity13_function_type f){} -static inline void rb_builtin_function_check_arity14(rb_builtin_arity14_function_type f){} -static inline void rb_builtin_function_check_arity15(rb_builtin_arity15_function_type f){} - -PUREFUNC(VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index)); -VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index); - -// __builtin_inline! - -PUREFUNC(static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index)); - -static inline VALUE -rb_vm_lvar(rb_execution_context_t *ec, int index) -{ -#if defined(VM_CORE_H_EC_DEFINED) && VM_CORE_H_EC_DEFINED - return ec->cfp->ep[index]; -#else - return rb_vm_lvar_exposed(ec, index); -#endif -} - -#define LOCAL_PTR(local) local ## __ptr - -// dump/load - -struct builtin_binary { - const char *feature; // feature name - const unsigned char *bin; // binary by ISeq#to_binary - size_t bin_size; -}; - -#endif // BUILTIN_H_INCLUDED diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h deleted file mode 100644 index b846849..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h +++ /dev/null @@ -1,40 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_BUILD_ASSERT_H -#define CCAN_BUILD_ASSERT_H - -/** - * CCAN_BUILD_ASSERT - assert a build-time dependency. - * @cond: the compile-time condition which must be true. - * - * Your compile will fail if the condition isn't true, or can't be evaluated - * by the compiler. This can only be used within a function. - * - * Example: - * #include - * ... - * static char *foo_to_char(struct foo *foo) - * { - * // This code needs string to be at start of foo. - * CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0); - * return (char *)foo; - * } - */ -#define CCAN_BUILD_ASSERT(cond) \ - do { (void) sizeof(char [1 - 2*!(cond)]); } while(0) - -/** - * CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression. - * @cond: the compile-time condition which must be true. - * - * Your compile will fail if the condition isn't true, or can't be evaluated - * by the compiler. This can be used in an expression: its value is "0". - * - * Example: - * #define foo_to_char(foo) \ - * ((char *)(foo) \ - * + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0)) - */ -#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \ - (sizeof(char [1 - 2*!(cond)]) - 1) - -#endif /* CCAN_BUILD_ASSERT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h deleted file mode 100644 index 659e1a5..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h +++ /dev/null @@ -1,63 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_CHECK_TYPE_H -#define CCAN_CHECK_TYPE_H - -/** - * ccan_check_type - issue a warning or build failure if type is not correct. - * @expr: the expression whose type we should check (not evaluated). - * @type: the exact type we expect the expression to be. - * - * This macro is usually used within other macros to try to ensure that a macro - * argument is of the expected type. No type promotion of the expression is - * done: an unsigned int is not the same as an int! - * - * ccan_check_type() always evaluates to 0. - * - * If your compiler does not support typeof, then the best we can do is fail - * to compile if the sizes of the types are unequal (a less complete check). - * - * Example: - * // They should always pass a 64-bit value to _set_some_value! - * #define set_some_value(expr) \ - * _set_some_value((ccan_check_type((expr), uint64_t), (expr))) - */ - -/** - * ccan_check_types_match - issue a warning or build failure if types are not same. - * @expr1: the first expression (not evaluated). - * @expr2: the second expression (not evaluated). - * - * This macro is usually used within other macros to try to ensure that - * arguments are of identical types. No type promotion of the expressions is - * done: an unsigned int is not the same as an int! - * - * ccan_check_types_match() always evaluates to 0. - * - * If your compiler does not support typeof, then the best we can do is fail - * to compile if the sizes of the types are unequal (a less complete check). - * - * Example: - * // Do subtraction to get to enclosing type, but make sure that - * // pointer is of correct type for that member. - * #define ccan_container_of(mbr_ptr, encl_type, mbr) \ - * (ccan_check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \ - * ((encl_type *) \ - * ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr)))) - */ -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_check_type(expr, type) \ - ((typeof(expr) *)0 != (type *)0) - -#define ccan_check_types_match(expr1, expr2) \ - ((typeof(expr1) *)0 != (typeof(expr2) *)0) -#else -#include "ccan/build_assert/build_assert.h" -/* Without typeof, we can only test the sizes. */ -#define ccan_check_type(expr, type) \ - CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type)) - -#define ccan_check_types_match(expr1, expr2) \ - CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2)) -#endif /* HAVE_TYPEOF */ - -#endif /* CCAN_CHECK_TYPE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h deleted file mode 100644 index 872bb6e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h +++ /dev/null @@ -1,142 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_CONTAINER_OF_H -#define CCAN_CONTAINER_OF_H -#include "ccan/check_type/check_type.h" - -/** - * ccan_container_of - get pointer to enclosing structure - * @member_ptr: pointer to the structure member - * @containing_type: the type this member is within - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does pointer - * subtraction to return the pointer to the enclosing type. - * - * Example: - * struct foo { - * int fielda, fieldb; - * // ... - * }; - * struct info { - * int some_other_field; - * struct foo my_foo; - * }; - * - * static struct info *foo_to_info(struct foo *foo) - * { - * return ccan_container_of(foo, struct info, my_foo); - * } - */ -#define ccan_container_of(member_ptr, containing_type, member) \ - ((containing_type *) \ - ((char *)(member_ptr) \ - - ccan_container_off(containing_type, member)) \ - + ccan_check_types_match(*(member_ptr), ((containing_type *)0)->member)) - - -/** - * ccan_container_of_or_null - get pointer to enclosing structure, or NULL - * @member_ptr: pointer to the structure member - * @containing_type: the type this member is within - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does pointer - * subtraction to return the pointer to the enclosing type, unless it - * is given NULL, in which case it also returns NULL. - * - * Example: - * struct foo { - * int fielda, fieldb; - * // ... - * }; - * struct info { - * int some_other_field; - * struct foo my_foo; - * }; - * - * static struct info *foo_to_info_allowing_null(struct foo *foo) - * { - * return ccan_container_of_or_null(foo, struct info, my_foo); - * } - */ -static inline char *container_of_or_null_(void *member_ptr, size_t offset) -{ - return member_ptr ? (char *)member_ptr - offset : NULL; -} -#define ccan_container_of_or_null(member_ptr, containing_type, member) \ - ((containing_type *) \ - ccan_container_of_or_null_(member_ptr, \ - ccan_container_off(containing_type, member)) \ - + ccan_check_types_match(*(member_ptr), ((containing_type *)0)->member)) - -/** - * ccan_container_off - get offset to enclosing structure - * @containing_type: the type this member is within - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does - * typechecking and figures out the offset to the enclosing type. - * - * Example: - * struct foo { - * int fielda, fieldb; - * // ... - * }; - * struct info { - * int some_other_field; - * struct foo my_foo; - * }; - * - * static struct info *foo_to_info(struct foo *foo) - * { - * size_t off = ccan_container_off(struct info, my_foo); - * return (void *)((char *)foo - off); - * } - */ -#define ccan_container_off(containing_type, member) \ - offsetof(containing_type, member) - -/** - * ccan_container_of_var - get pointer to enclosing structure using a variable - * @member_ptr: pointer to the structure member - * @container_var: a pointer of same type as this member's container - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does pointer - * subtraction to return the pointer to the enclosing type. - * - * Example: - * static struct info *foo_to_i(struct foo *foo) - * { - * struct info *i = ccan_container_of_var(foo, i, my_foo); - * return i; - * } - */ -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_container_of_var(member_ptr, container_var, member) \ - ccan_container_of(member_ptr, typeof(*container_var), member) -#else -#define ccan_container_of_var(member_ptr, container_var, member) \ - ((void *)((char *)(member_ptr) - \ - ccan_container_off_var(container_var, member))) -#endif - -/** - * ccan_container_off_var - get offset of a field in enclosing structure - * @container_var: a pointer to a container structure - * @member: the name of a member within the structure. - * - * Given (any) pointer to a structure and a its member name, this - * macro does pointer subtraction to return offset of member in a - * structure memory layout. - * - */ -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_container_off_var(var, member) \ - ccan_container_off(typeof(*var), member) -#else -#define ccan_container_off_var(var, member) \ - ((const char *)&(var)->member - (const char *)(var)) -#endif - -#endif /* CCAN_CONTAINER_OF_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h deleted file mode 100644 index bf692a6..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h +++ /dev/null @@ -1,791 +0,0 @@ -/* Licensed under BSD-MIT - see ccan/licenses/BSD-MIT file for details */ -#ifndef CCAN_LIST_H -#define CCAN_LIST_H -#include -#include "ccan/str/str.h" -#include "ccan/container_of/container_of.h" -#include "ccan/check_type/check_type.h" - -/** - * struct ccan_list_node - an entry in a doubly-linked list - * @next: next entry (self if empty) - * @prev: previous entry (self if empty) - * - * This is used as an entry in a linked list. - * Example: - * struct child { - * const char *name; - * // Linked list of all us children. - * struct ccan_list_node list; - * }; - */ -struct ccan_list_node -{ - struct ccan_list_node *next, *prev; -}; - -/** - * struct ccan_list_head - the head of a doubly-linked list - * @h: the ccan_list_head (containing next and prev pointers) - * - * This is used as the head of a linked list. - * Example: - * struct parent { - * const char *name; - * struct ccan_list_head children; - * unsigned int num_children; - * }; - */ -struct ccan_list_head -{ - struct ccan_list_node n; -}; - -#define CCAN_LIST_LOC __FILE__ ":" ccan_stringify(__LINE__) -#define ccan_list_debug(h, loc) ((void)loc, h) -#define ccan_list_debug_node(n, loc) ((void)loc, n) - -/** - * CCAN_LIST_HEAD_INIT - initializer for an empty ccan_list_head - * @name: the name of the list. - * - * Explicit initializer for an empty list. - * - * See also: - * CCAN_LIST_HEAD, ccan_list_head_init() - * - * Example: - * static struct ccan_list_head my_list = CCAN_LIST_HEAD_INIT(my_list); - */ -#define CCAN_LIST_HEAD_INIT(name) { { &(name).n, &(name).n } } - -/** - * CCAN_LIST_HEAD - define and initialize an empty ccan_list_head - * @name: the name of the list. - * - * The CCAN_LIST_HEAD macro defines a ccan_list_head and initializes it to an empty - * list. It can be prepended by "static" to define a static ccan_list_head. - * - * See also: - * CCAN_LIST_HEAD_INIT, ccan_list_head_init() - * - * Example: - * static CCAN_LIST_HEAD(my_global_list); - */ -#define CCAN_LIST_HEAD(name) \ - struct ccan_list_head name = CCAN_LIST_HEAD_INIT(name) - -/** - * ccan_list_head_init - initialize a ccan_list_head - * @h: the ccan_list_head to set to the empty list - * - * Example: - * ... - * struct parent *parent = malloc(sizeof(*parent)); - * - * ccan_list_head_init(&parent->children); - * parent->num_children = 0; - */ -static inline void ccan_list_head_init(struct ccan_list_head *h) -{ - h->n.next = h->n.prev = &h->n; -} - -/** - * ccan_list_node_init - initialize a ccan_list_node - * @n: the ccan_list_node to link to itself. - * - * You don't need to use this normally! But it lets you ccan_list_del(@n) - * safely. - */ -static inline void ccan_list_node_init(struct ccan_list_node *n) -{ - n->next = n->prev = n; -} - -/** - * ccan_list_add_after - add an entry after an existing node in a linked list - * @h: the ccan_list_head to add the node to (for debugging) - * @p: the existing ccan_list_node to add the node after - * @n: the new ccan_list_node to add to the list. - * - * The existing ccan_list_node must already be a member of the list. - * The new ccan_list_node does not need to be initialized; it will be overwritten. - * - * Example: - * struct child c1, c2, c3; - * CCAN_LIST_HEAD(h); - * - * ccan_list_add_tail(&h, &c1.list); - * ccan_list_add_tail(&h, &c3.list); - * ccan_list_add_after(&h, &c1.list, &c2.list); - */ -#define ccan_list_add_after(h, p, n) ccan_list_add_after_(h, p, n, CCAN_LIST_LOC) -static inline void ccan_list_add_after_(struct ccan_list_head *h, - struct ccan_list_node *p, - struct ccan_list_node *n, - const char *abortstr) -{ - n->next = p->next; - n->prev = p; - p->next->prev = n; - p->next = n; - (void)ccan_list_debug(h, abortstr); -} - -/** - * ccan_list_add - add an entry at the start of a linked list. - * @h: the ccan_list_head to add the node to - * @n: the ccan_list_node to add to the list. - * - * The ccan_list_node does not need to be initialized; it will be overwritten. - * Example: - * struct child *child = malloc(sizeof(*child)); - * - * child->name = "marvin"; - * ccan_list_add(&parent->children, &child->list); - * parent->num_children++; - */ -#define ccan_list_add(h, n) ccan_list_add_(h, n, CCAN_LIST_LOC) -static inline void ccan_list_add_(struct ccan_list_head *h, - struct ccan_list_node *n, - const char *abortstr) -{ - ccan_list_add_after_(h, &h->n, n, abortstr); -} - -/** - * ccan_list_add_before - add an entry before an existing node in a linked list - * @h: the ccan_list_head to add the node to (for debugging) - * @p: the existing ccan_list_node to add the node before - * @n: the new ccan_list_node to add to the list. - * - * The existing ccan_list_node must already be a member of the list. - * The new ccan_list_node does not need to be initialized; it will be overwritten. - * - * Example: - * ccan_list_head_init(&h); - * ccan_list_add_tail(&h, &c1.list); - * ccan_list_add_tail(&h, &c3.list); - * ccan_list_add_before(&h, &c3.list, &c2.list); - */ -#define ccan_list_add_before(h, p, n) ccan_list_add_before_(h, p, n, CCAN_LIST_LOC) -static inline void ccan_list_add_before_(struct ccan_list_head *h, - struct ccan_list_node *p, - struct ccan_list_node *n, - const char *abortstr) -{ - n->next = p; - n->prev = p->prev; - p->prev->next = n; - p->prev = n; - (void)ccan_list_debug(h, abortstr); -} - -/** - * ccan_list_add_tail - add an entry at the end of a linked list. - * @h: the ccan_list_head to add the node to - * @n: the ccan_list_node to add to the list. - * - * The ccan_list_node does not need to be initialized; it will be overwritten. - * Example: - * ccan_list_add_tail(&parent->children, &child->list); - * parent->num_children++; - */ -#define ccan_list_add_tail(h, n) ccan_list_add_tail_(h, n, CCAN_LIST_LOC) -static inline void ccan_list_add_tail_(struct ccan_list_head *h, - struct ccan_list_node *n, - const char *abortstr) -{ - ccan_list_add_before_(h, &h->n, n, abortstr); -} - -/** - * ccan_list_empty - is a list empty? - * @h: the ccan_list_head - * - * If the list is empty, returns true. - * - * Example: - * assert(ccan_list_empty(&parent->children) == (parent->num_children == 0)); - */ -#define ccan_list_empty(h) ccan_list_empty_(h, CCAN_LIST_LOC) -static inline int ccan_list_empty_(const struct ccan_list_head *h, const char* abortstr) -{ - (void)ccan_list_debug(h, abortstr); - return h->n.next == &h->n; -} - -/** - * ccan_list_empty_nodebug - is a list empty (and don't perform debug checks)? - * @h: the ccan_list_head - * - * If the list is empty, returns true. - * This differs from list_empty() in that if CCAN_LIST_DEBUG is set it - * will NOT perform debug checks. Only use this function if you REALLY - * know what you're doing. - * - * Example: - * assert(ccan_list_empty_nodebug(&parent->children) == (parent->num_children == 0)); - */ -#ifndef CCAN_LIST_DEBUG -#define ccan_list_empty_nodebug(h) ccan_list_empty(h) -#else -static inline int ccan_list_empty_nodebug(const struct ccan_list_head *h) -{ - return h->n.next == &h->n; -} -#endif - -/** - * ccan_list_empty_nocheck - is a list empty? - * @h: the ccan_list_head - * - * If the list is empty, returns true. This doesn't perform any - * debug check for list consistency, so it can be called without - * locks, racing with the list being modified. This is ok for - * checks where an incorrect result is not an issue (optimized - * bail out path for example). - */ -static inline bool ccan_list_empty_nocheck(const struct ccan_list_head *h) -{ - return h->n.next == &h->n; -} - -/** - * ccan_list_del - delete an entry from an (unknown) linked list. - * @n: the ccan_list_node to delete from the list. - * - * Note that this leaves @n in an undefined state; it can be added to - * another list, but not deleted again. - * - * See also: - * ccan_list_del_from(), ccan_list_del_init() - * - * Example: - * ccan_list_del(&child->list); - * parent->num_children--; - */ -#define ccan_list_del(n) ccan_list_del_(n, CCAN_LIST_LOC) -static inline void ccan_list_del_(struct ccan_list_node *n, const char* abortstr) -{ - (void)ccan_list_debug_node(n, abortstr); - n->next->prev = n->prev; - n->prev->next = n->next; -#ifdef CCAN_LIST_DEBUG - /* Catch use-after-del. */ - n->next = n->prev = NULL; -#endif -} - -/** - * ccan_list_del_init - delete a node, and reset it so it can be deleted again. - * @n: the ccan_list_node to be deleted. - * - * ccan_list_del(@n) or ccan_list_del_init() again after this will be safe, - * which can be useful in some cases. - * - * See also: - * ccan_list_del_from(), ccan_list_del() - * - * Example: - * ccan_list_del_init(&child->list); - * parent->num_children--; - */ -#define ccan_list_del_init(n) ccan_list_del_init_(n, CCAN_LIST_LOC) -static inline void ccan_list_del_init_(struct ccan_list_node *n, const char *abortstr) -{ - ccan_list_del_(n, abortstr); - ccan_list_node_init(n); -} - -/** - * ccan_list_del_from - delete an entry from a known linked list. - * @h: the ccan_list_head the node is in. - * @n: the ccan_list_node to delete from the list. - * - * This explicitly indicates which list a node is expected to be in, - * which is better documentation and can catch more bugs. - * - * See also: ccan_list_del() - * - * Example: - * ccan_list_del_from(&parent->children, &child->list); - * parent->num_children--; - */ -static inline void ccan_list_del_from(struct ccan_list_head *h, struct ccan_list_node *n) -{ -#ifdef CCAN_LIST_DEBUG - { - /* Thorough check: make sure it was in list! */ - struct ccan_list_node *i; - for (i = h->n.next; i != n; i = i->next) - assert(i != &h->n); - } -#endif /* CCAN_LIST_DEBUG */ - - /* Quick test that catches a surprising number of bugs. */ - assert(!ccan_list_empty(h)); - ccan_list_del(n); -} - -/** - * ccan_list_swap - swap out an entry from an (unknown) linked list for a new one. - * @o: the ccan_list_node to replace from the list. - * @n: the ccan_list_node to insert in place of the old one. - * - * Note that this leaves @o in an undefined state; it can be added to - * another list, but not deleted/swapped again. - * - * See also: - * ccan_list_del() - * - * Example: - * struct child x1, x2; - * CCAN_LIST_HEAD(xh); - * - * ccan_list_add(&xh, &x1.list); - * ccan_list_swap(&x1.list, &x2.list); - */ -#define ccan_list_swap(o, n) ccan_list_swap_(o, n, CCAN_LIST_LOC) -static inline void ccan_list_swap_(struct ccan_list_node *o, - struct ccan_list_node *n, - const char* abortstr) -{ - (void)ccan_list_debug_node(o, abortstr); - *n = *o; - n->next->prev = n; - n->prev->next = n; -#ifdef CCAN_LIST_DEBUG - /* Catch use-after-del. */ - o->next = o->prev = NULL; -#endif -} - -/** - * ccan_list_entry - convert a ccan_list_node back into the structure containing it. - * @n: the ccan_list_node - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * Example: - * // First list entry is children.next; convert back to child. - * child = ccan_list_entry(parent->children.n.next, struct child, list); - * - * See Also: - * ccan_list_top(), ccan_list_for_each() - */ -#define ccan_list_entry(n, type, member) ccan_container_of(n, type, member) - -/** - * ccan_list_top - get the first entry in a list - * @h: the ccan_list_head - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * If the list is empty, returns NULL. - * - * Example: - * struct child *first; - * first = ccan_list_top(&parent->children, struct child, list); - * if (!first) - * printf("Empty list!\n"); - */ -#define ccan_list_top(h, type, member) \ - ((type *)ccan_list_top_((h), ccan_list_off_(type, member))) - -static inline const void *ccan_list_top_(const struct ccan_list_head *h, size_t off) -{ - if (ccan_list_empty(h)) - return NULL; - return (const char *)h->n.next - off; -} - -/** - * ccan_list_pop - remove the first entry in a list - * @h: the ccan_list_head - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * If the list is empty, returns NULL. - * - * Example: - * struct child *one; - * one = ccan_list_pop(&parent->children, struct child, list); - * if (!one) - * printf("Empty list!\n"); - */ -#define ccan_list_pop(h, type, member) \ - ((type *)ccan_list_pop_((h), ccan_list_off_(type, member))) - -static inline const void *ccan_list_pop_(const struct ccan_list_head *h, size_t off) -{ - struct ccan_list_node *n; - - if (ccan_list_empty(h)) - return NULL; - n = h->n.next; - ccan_list_del(n); - return (const char *)n - off; -} - -/** - * ccan_list_tail - get the last entry in a list - * @h: the ccan_list_head - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * If the list is empty, returns NULL. - * - * Example: - * struct child *last; - * last = ccan_list_tail(&parent->children, struct child, list); - * if (!last) - * printf("Empty list!\n"); - */ -#define ccan_list_tail(h, type, member) \ - ((type *)ccan_list_tail_((h), ccan_list_off_(type, member))) - -static inline const void *ccan_list_tail_(const struct ccan_list_head *h, size_t off) -{ - if (ccan_list_empty(h)) - return NULL; - return (const char *)h->n.prev - off; -} - -/** - * ccan_list_for_each - iterate through a list. - * @h: the ccan_list_head (warning: evaluated multiple times!) - * @i: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list. It's - * a for loop, so you can break and continue as normal. - * - * Example: - * ccan_list_for_each(&parent->children, child, list) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each(h, i, member) \ - ccan_list_for_each_off(h, i, ccan_list_off_var_(i, member)) - -/** - * ccan_list_for_each_rev - iterate through a list backwards. - * @h: the ccan_list_head - * @i: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list. It's - * a for loop, so you can break and continue as normal. - * - * Example: - * ccan_list_for_each_rev(&parent->children, child, list) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_rev(h, i, member) \ - ccan_list_for_each_rev_off(h, i, ccan_list_off_var_(i, member)) - -/** - * ccan_list_for_each_rev_safe - iterate through a list backwards, - * maybe during deletion - * @h: the ccan_list_head - * @i: the structure containing the ccan_list_node - * @nxt: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list backwards. - * It's a for loop, so you can break and continue as normal. The extra - * variable * @nxt is used to hold the next element, so you can delete @i - * from the list. - * - * Example: - * struct child *next; - * ccan_list_for_each_rev_safe(&parent->children, child, next, list) { - * printf("Name: %s\n", child->name); - * } - */ -#define ccan_list_for_each_rev_safe(h, i, nxt, member) \ - ccan_list_for_each_rev_safe_off(h, i, nxt, ccan_list_off_var_(i, member)) - -/** - * ccan_list_for_each_safe - iterate through a list, maybe during deletion - * @h: the ccan_list_head - * @i: the structure containing the ccan_list_node - * @nxt: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list. It's - * a for loop, so you can break and continue as normal. The extra variable - * @nxt is used to hold the next element, so you can delete @i from the list. - * - * Example: - * ccan_list_for_each_safe(&parent->children, child, next, list) { - * ccan_list_del(&child->list); - * parent->num_children--; - * } - */ -#define ccan_list_for_each_safe(h, i, nxt, member) \ - ccan_list_for_each_safe_off(h, i, nxt, ccan_list_off_var_(i, member)) - -/** - * ccan_list_next - get the next entry in a list - * @h: the ccan_list_head - * @i: a pointer to an entry in the list. - * @member: the ccan_list_node member of the structure - * - * If @i was the last entry in the list, returns NULL. - * - * Example: - * struct child *second; - * second = ccan_list_next(&parent->children, first, list); - * if (!second) - * printf("No second child!\n"); - */ -#define ccan_list_next(h, i, member) \ - ((ccan_list_typeof(i))ccan_list_entry_or_null(ccan_list_debug(h, \ - __FILE__ ":" ccan_stringify(__LINE__)), \ - (i)->member.next, \ - ccan_list_off_var_((i), member))) - -/** - * ccan_list_prev - get the previous entry in a list - * @h: the ccan_list_head - * @i: a pointer to an entry in the list. - * @member: the ccan_list_node member of the structure - * - * If @i was the first entry in the list, returns NULL. - * - * Example: - * first = ccan_list_prev(&parent->children, second, list); - * if (!first) - * printf("Can't go back to first child?!\n"); - */ -#define ccan_list_prev(h, i, member) \ - ((ccan_list_typeof(i))ccan_list_entry_or_null(ccan_list_debug(h, \ - __FILE__ ":" ccan_stringify(__LINE__)), \ - (i)->member.prev, \ - ccan_list_off_var_((i), member))) - -/** - * ccan_list_append_list - empty one list onto the end of another. - * @to: the list to append into - * @from: the list to empty. - * - * This takes the entire contents of @from and moves it to the end of - * @to. After this @from will be empty. - * - * Example: - * struct ccan_list_head adopter; - * - * ccan_list_append_list(&adopter, &parent->children); - * assert(ccan_list_empty(&parent->children)); - * parent->num_children = 0; - */ -#define ccan_list_append_list(t, f) ccan_list_append_list_(t, f, \ - __FILE__ ":" ccan_stringify(__LINE__)) -static inline void ccan_list_append_list_(struct ccan_list_head *to, - struct ccan_list_head *from, - const char *abortstr) -{ - struct ccan_list_node *from_tail = ccan_list_debug(from, abortstr)->n.prev; - struct ccan_list_node *to_tail = ccan_list_debug(to, abortstr)->n.prev; - - /* Sew in head and entire list. */ - to->n.prev = from_tail; - from_tail->next = &to->n; - to_tail->next = &from->n; - from->n.prev = to_tail; - - /* Now remove head. */ - ccan_list_del(&from->n); - ccan_list_head_init(from); -} - -/** - * ccan_list_prepend_list - empty one list into the start of another. - * @to: the list to prepend into - * @from: the list to empty. - * - * This takes the entire contents of @from and moves it to the start - * of @to. After this @from will be empty. - * - * Example: - * ccan_list_prepend_list(&adopter, &parent->children); - * assert(ccan_list_empty(&parent->children)); - * parent->num_children = 0; - */ -#define ccan_list_prepend_list(t, f) ccan_list_prepend_list_(t, f, CCAN_LIST_LOC) -static inline void ccan_list_prepend_list_(struct ccan_list_head *to, - struct ccan_list_head *from, - const char *abortstr) -{ - struct ccan_list_node *from_tail = ccan_list_debug(from, abortstr)->n.prev; - struct ccan_list_node *to_head = ccan_list_debug(to, abortstr)->n.next; - - /* Sew in head and entire list. */ - to->n.next = &from->n; - from->n.prev = &to->n; - to_head->prev = from_tail; - from_tail->next = to_head; - - /* Now remove head. */ - ccan_list_del(&from->n); - ccan_list_head_init(from); -} - -/* internal macros, do not use directly */ -#define ccan_list_for_each_off_dir_(h, i, off, dir) \ - for (i = 0, \ - i = ccan_list_node_to_off_(ccan_list_debug(h, CCAN_LIST_LOC)->n.dir, \ - (off)); \ - ccan_list_node_from_off_((void *)i, (off)) != &(h)->n; \ - i = ccan_list_node_to_off_(ccan_list_node_from_off_((void *)i, (off))->dir, \ - (off))) - -#define ccan_list_for_each_safe_off_dir_(h, i, nxt, off, dir) \ - for (i = 0, \ - i = ccan_list_node_to_off_(ccan_list_debug(h, CCAN_LIST_LOC)->n.dir, \ - (off)), \ - nxt = ccan_list_node_to_off_(ccan_list_node_from_off_(i, (off))->dir, \ - (off)); \ - ccan_list_node_from_off_(i, (off)) != &(h)->n; \ - i = nxt, \ - nxt = ccan_list_node_to_off_(ccan_list_node_from_off_(i, (off))->dir, \ - (off))) - -/** - * ccan_list_for_each_off - iterate through a list of memory regions. - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @off: offset(relative to @i) at which list node data resides. - * - * This is a low-level wrapper to iterate @i over the entire list, used to - * implement all other, more high-level, for-each constructs. It's a for loop, - * so you can break and continue as normal. - * - * WARNING! Being the low-level macro that it is, this wrapper doesn't know - * nor care about the type of @i. The only assumption made is that @i points - * to a chunk of memory that at some @offset, relative to @i, contains a - * properly filled `struct ccan_list_node' which in turn contains pointers to - * memory chunks and it's turtles all the way down. With all that in mind - * remember that given the wrong pointer/offset couple this macro will - * happily churn all you memory until SEGFAULT stops it, in other words - * caveat emptor. - * - * It is worth mentioning that one of legitimate use-cases for that wrapper - * is operation on opaque types with known offset for `struct ccan_list_node' - * member(preferably 0), because it allows you not to disclose the type of - * @i. - * - * Example: - * ccan_list_for_each_off(&parent->children, child, - * offsetof(struct child, list)) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_off(h, i, off) \ - ccan_list_for_each_off_dir_((h),(i),(off),next) - -/** - * ccan_list_for_each_rev_off - iterate through a list of memory regions backwards - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @off: offset(relative to @i) at which list node data resides. - * - * See ccan_list_for_each_off for details - */ -#define ccan_list_for_each_rev_off(h, i, off) \ - ccan_list_for_each_off_dir_((h),(i),(off),prev) - -/** - * ccan_list_for_each_safe_off - iterate through a list of memory regions, maybe - * during deletion - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @nxt: the structure containing the ccan_list_node - * @off: offset(relative to @i) at which list node data resides. - * - * For details see `ccan_list_for_each_off' and `ccan_list_for_each_safe' - * descriptions. - * - * Example: - * ccan_list_for_each_safe_off(&parent->children, child, - * next, offsetof(struct child, list)) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_safe_off(h, i, nxt, off) \ - ccan_list_for_each_safe_off_dir_((h),(i),(nxt),(off),next) - -/** - * ccan_list_for_each_rev_safe_off - iterate backwards through a list of - * memory regions, maybe during deletion - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @nxt: the structure containing the ccan_list_node - * @off: offset(relative to @i) at which list node data resides. - * - * For details see `ccan_list_for_each_rev_off' and `ccan_list_for_each_rev_safe' - * descriptions. - * - * Example: - * ccan_list_for_each_rev_safe_off(&parent->children, child, - * next, offsetof(struct child, list)) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_rev_safe_off(h, i, nxt, off) \ - ccan_list_for_each_safe_off_dir_((h),(i),(nxt),(off),prev) - -/* Other -off variants. */ -#define ccan_list_entry_off(n, type, off) \ - ((type *)ccan_list_node_from_off_((n), (off))) - -#define ccan_list_head_off(h, type, off) \ - ((type *)ccan_list_head_off((h), (off))) - -#define ccan_list_tail_off(h, type, off) \ - ((type *)ccan_list_tail_((h), (off))) - -#define ccan_list_add_off(h, n, off) \ - ccan_list_add((h), ccan_list_node_from_off_((n), (off))) - -#define ccan_list_del_off(n, off) \ - ccan_list_del(ccan_list_node_from_off_((n), (off))) - -#define ccan_list_del_from_off(h, n, off) \ - ccan_list_del_from(h, ccan_list_node_from_off_((n), (off))) - -/* Offset helper functions so we only single-evaluate. */ -static inline void *ccan_list_node_to_off_(struct ccan_list_node *node, size_t off) -{ - return (void *)((char *)node - off); -} -static inline struct ccan_list_node *ccan_list_node_from_off_(void *ptr, size_t off) -{ - return (struct ccan_list_node *)((char *)ptr + off); -} - -/* Get the offset of the member, but make sure it's a ccan_list_node. */ -#define ccan_list_off_(type, member) \ - (ccan_container_off(type, member) + \ - ccan_check_type(((type *)0)->member, struct ccan_list_node)) - -#define ccan_list_off_var_(var, member) \ - (ccan_container_off_var(var, member) + \ - ccan_check_type(var->member, struct ccan_list_node)) - -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_list_typeof(var) typeof(var) -#else -#define ccan_list_typeof(var) void * -#endif - -/* Returns member, or NULL if at end of list. */ -static inline void *ccan_list_entry_or_null(const struct ccan_list_head *h, - const struct ccan_list_node *n, - size_t off) -{ - if (n == &h->n) - return NULL; - return (char *)n - off; -} - -#endif /* CCAN_LIST_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h deleted file mode 100644 index 6d4cf62..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h +++ /dev/null @@ -1,17 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_STR_H -#define CCAN_STR_H -/** - * ccan_stringify - Turn expression into a string literal - * @expr: any C expression - * - * Example: - * #define PRINT_COND_IF_FALSE(cond) \ - * ((cond) || printf("%s is false!", ccan_stringify(cond))) - */ -#define stringify(expr) ccan_stringify_1(expr) -#define ccan_stringify(expr) ccan_stringify_1(expr) -/* Double-indirection required to stringify expansions */ -#define ccan_stringify_1(expr) #expr - -#endif /* CCAN_STR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h deleted file mode 100644 index 90a68d4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CONSTANT_H -#define CONSTANT_H -/********************************************************************** - - constant.h - - - $Author$ - created at: Sun Nov 15 00:09:33 2009 - - Copyright (C) 2009 Yusuke Endoh - -**********************************************************************/ -#include "ruby/ruby.h" -#include "id_table.h" - -typedef enum { - CONST_DEPRECATED = 0x100, - - CONST_VISIBILITY_MASK = 0xff, - CONST_PUBLIC = 0x00, - CONST_PRIVATE, - CONST_VISIBILITY_MAX -} rb_const_flag_t; - -#define RB_CONST_PRIVATE_P(ce) \ - (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE) -#define RB_CONST_PUBLIC_P(ce) \ - (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC) - -#define RB_CONST_DEPRECATED_P(ce) \ - ((ce)->flag & CONST_DEPRECATED) - -typedef struct rb_const_entry_struct { - rb_const_flag_t flag; - int line; - VALUE value; /* should be mark */ - VALUE file; /* should be mark */ -} rb_const_entry_t; - -VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj); -VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj); -VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj); -void rb_free_const_table(struct rb_id_table *tbl); -VALUE rb_const_source_location(VALUE, ID); - -int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag); -rb_const_entry_t *rb_const_lookup(VALUE klass, ID id); -VALUE rb_public_const_get_at(VALUE klass, ID id); -VALUE rb_public_const_get_from(VALUE klass, ID id); -int rb_public_const_defined_from(VALUE klass, ID id); -VALUE rb_const_source_location_at(VALUE, ID); - -#endif /* CONSTANT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h deleted file mode 100644 index d24e3c3..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef RUBY_DARRAY_H -#define RUBY_DARRAY_H - -#include -#include -#include - -#include "internal/bits.h" - -// Type for a dynamic array. Use to declare a dynamic array. -// It is a pointer so it fits in st_table nicely. Designed -// to be fairly type-safe. -// -// NULL is a valid empty dynamic array. -// -// Example: -// rb_darray(char) char_array = NULL; -// rb_darray_append(&char_array, 'e'); -// printf("pushed %c\n", *rb_darray_ref(char_array, 0)); -// rb_darray_free(char_array); -// -#define rb_darray(T) struct { rb_darray_meta_t meta; T data[]; } * - -// Copy an element out of the array. Warning: not bounds checked. -// -// T rb_darray_get(rb_darray(T) ary, size_t idx); -// -#define rb_darray_get(ary, idx) ((ary)->data[(idx)]) - -// Assign to an element. Warning: not bounds checked. -// -// void rb_darray_set(rb_darray(T) ary, size_t idx, T element); -// -#define rb_darray_set(ary, idx, element) ((ary)->data[(idx)] = (element)) - -// Get a pointer to an element. Warning: not bounds checked. -// -// T *rb_darray_ref(rb_darray(T) ary, size_t idx); -// -#define rb_darray_ref(ary, idx) (&((ary)->data[(idx)])) - -/* Copy a new element into the array. ptr_to_ary is evaluated multiple times. - * - * void rb_darray_append(rb_darray(T) *ptr_to_ary, T element); - */ -#define rb_darray_append(ptr_to_ary, element) \ - rb_darray_append_impl(ptr_to_ary, element) - -#define rb_darray_append_impl(ptr_to_ary, element) do { \ - rb_darray_ensure_space((ptr_to_ary), \ - sizeof(**(ptr_to_ary)), \ - sizeof((*(ptr_to_ary))->data[0])); \ - rb_darray_set(*(ptr_to_ary), \ - (*(ptr_to_ary))->meta.size, \ - (element)); \ - (*(ptr_to_ary))->meta.size++; \ -} while (0) - -// Iterate over items of the array in a for loop -// -#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \ - for (size_t idx_name = 0; idx_name < rb_darray_size(ary) && ((elem_ptr_var) = rb_darray_ref(ary, idx_name)); ++idx_name) - -// Iterate over valid indices in the array in a for loop -// -#define rb_darray_for(ary, idx_name) \ - for (size_t idx_name = 0; idx_name < rb_darray_size(ary); ++idx_name) - -/* Make a dynamic array of a certain size. All bytes backing the elements are set to zero. - * Return 1 on success and 0 on failure. - * - * Note that NULL is a valid empty dynamic array. - * - * void rb_darray_make(rb_darray(T) *ptr_to_ary, size_t size); - */ -#define rb_darray_make(ptr_to_ary, size) \ - rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), sizeof((*(ptr_to_ary))->data[0])) - -/* Resize the darray to a new capacity. The new capacity must be greater than - * or equal to the size of the darray. - * - * void rb_darray_resize_capa(rb_darray(T) *ptr_to_ary, size_t capa); - */ -#define rb_darray_resize_capa(ptr_to_ary, capa) \ - rb_darray_resize_capa_impl((ptr_to_ary), capa, sizeof(**(ptr_to_ary)), sizeof((*(ptr_to_ary))->data[0])) - -#define rb_darray_data_ptr(ary) ((ary)->data) - -typedef struct rb_darray_meta { - size_t size; - size_t capa; -} rb_darray_meta_t; - -/* Set the size of the array to zero without freeing the backing memory. - * Allows reusing the same array. */ -static inline void -rb_darray_clear(void *ary) -{ - rb_darray_meta_t *meta = ary; - if (meta) { - meta->size = 0; - } -} - -// Get the size of the dynamic array. -// -static inline size_t -rb_darray_size(const void *ary) -{ - const rb_darray_meta_t *meta = ary; - return meta ? meta->size : 0; -} - -// Get the capacity of the dynamic array. -// -static inline size_t -rb_darray_capa(const void *ary) -{ - const rb_darray_meta_t *meta = ary; - return meta ? meta->capa : 0; -} - -/* Free the dynamic array. */ -static inline void -rb_darray_free(void *ary) -{ - xfree(ary); -} - -/* Internal function. Resizes the capacity of a darray. The new capacity must - * be greater than or equal to the size of the darray. */ -static inline void -rb_darray_resize_capa_impl(void *ptr_to_ary, size_t new_capa, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; - - rb_darray_meta_t *new_ary = xrealloc(meta, new_capa * element_size + header_size); - - if (meta == NULL) { - /* First allocation. Initialize size. On subsequence allocations - * realloc takes care of carrying over the size. */ - new_ary->size = 0; - } - - RUBY_ASSERT(new_ary->size <= new_capa); - - new_ary->capa = new_capa; - - // We don't have access to the type of the dynamic array in function context. - // Write out result with memcpy to avoid strict aliasing issue. - memcpy(ptr_to_ary, &new_ary, sizeof(new_ary)); -} - -// Internal function -// Ensure there is space for one more element. -// Note: header_size can be bigger than sizeof(rb_darray_meta_t) when T is __int128_t, for example. -static inline void -rb_darray_ensure_space(void *ptr_to_ary, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; - size_t current_capa = rb_darray_capa(meta); - if (rb_darray_size(meta) < current_capa) return; - - // Double the capacity - size_t new_capa = current_capa == 0 ? 1 : current_capa * 2; - - rb_darray_resize_capa_impl(ptr_to_ary, new_capa, header_size, element_size); -} - -static inline void -rb_darray_make_impl(void *ptr_to_ary, size_t array_size, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - if (array_size == 0) { - *ptr_to_ptr_to_meta = NULL; - return; - } - - rb_darray_meta_t *meta = xcalloc(array_size * element_size + header_size, 1); - - meta->size = array_size; - meta->capa = array_size; - - // We don't have access to the type of the dynamic array in function context. - // Write out result with memcpy to avoid strict aliasing issue. - memcpy(ptr_to_ary, &meta, sizeof(meta)); -} - -#endif /* RUBY_DARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h deleted file mode 100644 index a8b95ed..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h +++ /dev/null @@ -1,423 +0,0 @@ -/********************************************************************** - - debug_counter.h - - - created at: Tue Feb 21 16:51:18 2017 - - Copyright (C) 2017 Koichi Sasada - -**********************************************************************/ - -#ifndef USE_DEBUG_COUNTER -#define USE_DEBUG_COUNTER 0 -#endif - -#ifdef RB_DEBUG_COUNTER - -// method cache (IMC: inline method cache) -RB_DEBUG_COUNTER(mc_inline_hit) // IMC hit -RB_DEBUG_COUNTER(mc_inline_miss_klass) // IMC miss by different class -RB_DEBUG_COUNTER(mc_inline_miss_invalidated) // IMC miss by invalidated ME -RB_DEBUG_COUNTER(mc_inline_miss_empty) // IMC miss because prev is empty slot -RB_DEBUG_COUNTER(mc_inline_miss_same_cc) // IMC miss, but same CC -RB_DEBUG_COUNTER(mc_inline_miss_same_cme) // IMC miss, but same CME -RB_DEBUG_COUNTER(mc_inline_miss_same_def) // IMC miss, but same definition -RB_DEBUG_COUNTER(mc_inline_miss_diff) // IMC miss, different methods - -RB_DEBUG_COUNTER(cvar_write_inline_hit) // cvar cache hit on write -RB_DEBUG_COUNTER(cvar_read_inline_hit) // cvar cache hit on read -RB_DEBUG_COUNTER(cvar_inline_miss) // miss inline cache -RB_DEBUG_COUNTER(cvar_class_invalidate) // invalidate cvar cache when define a cvar that's defined on a subclass -RB_DEBUG_COUNTER(cvar_include_invalidate) // invalidate cvar cache on module include or prepend - -RB_DEBUG_COUNTER(mc_cme_complement) // number of acquiring complement CME -RB_DEBUG_COUNTER(mc_cme_complement_hit) // number of cache hit for complemented CME - -RB_DEBUG_COUNTER(mc_search) // count for method lookup in class tree -RB_DEBUG_COUNTER(mc_search_notfound) // method lookup, but not found -RB_DEBUG_COUNTER(mc_search_super) // total traversed classes - -// callinfo -RB_DEBUG_COUNTER(ci_packed) // number of packed CI -RB_DEBUG_COUNTER(ci_kw) // non-packed CI w/ keywords -RB_DEBUG_COUNTER(ci_nokw) // non-packed CI w/o keywords -RB_DEBUG_COUNTER(ci_runtime) // creating temporary CI - -// callcache -RB_DEBUG_COUNTER(cc_new) // number of CC -RB_DEBUG_COUNTER(cc_temp) // dummy CC (stack-allocated) -RB_DEBUG_COUNTER(cc_found_in_ccs) // count for CC lookup success in CCS -RB_DEBUG_COUNTER(cc_not_found_in_ccs) // count for CC lookup success in CCS - -RB_DEBUG_COUNTER(cc_ent_invalidate) // count for invalidating cc (cc->klass = 0) -RB_DEBUG_COUNTER(cc_cme_invalidate) // count for invalidating CME - -RB_DEBUG_COUNTER(cc_invalidate_leaf) // count for invalidating klass if klass has no-subclasses -RB_DEBUG_COUNTER(cc_invalidate_leaf_ccs) // corresponding CCS -RB_DEBUG_COUNTER(cc_invalidate_leaf_callable) // complimented cache (no-subclasses) -RB_DEBUG_COUNTER(cc_invalidate_tree) // count for invalidating klass if klass has subclasses -RB_DEBUG_COUNTER(cc_invalidate_tree_cme) // cme if cme is found in this class or superclasses -RB_DEBUG_COUNTER(cc_invalidate_tree_callable) // complimented cache (subclasses) -RB_DEBUG_COUNTER(cc_invalidate_negative) // count for invalidating negative cache - -RB_DEBUG_COUNTER(ccs_free) // count for free'ing ccs -RB_DEBUG_COUNTER(ccs_maxlen) // maximum length of ccs -RB_DEBUG_COUNTER(ccs_found) // count for finding corresponding ccs on method lookup -RB_DEBUG_COUNTER(ccs_not_found) // count for not found corresponding ccs on method lookup - -// vm_eval.c -RB_DEBUG_COUNTER(call0_public) -RB_DEBUG_COUNTER(call0_other) -RB_DEBUG_COUNTER(gccct_hit) -RB_DEBUG_COUNTER(gccct_miss) -RB_DEBUG_COUNTER(gccct_null) - -// iseq -RB_DEBUG_COUNTER(iseq_num) // number of total created iseq -RB_DEBUG_COUNTER(iseq_cd_num) // number of total created cd (call_data) - -/* - * call cache fastpath usage - */ -RB_DEBUG_COUNTER(ccf_general) -RB_DEBUG_COUNTER(ccf_iseq_setup) -RB_DEBUG_COUNTER(ccf_iseq_setup_0start) -RB_DEBUG_COUNTER(ccf_iseq_setup_tailcall_0start) -RB_DEBUG_COUNTER(ccf_iseq_fix) /* several functions created with tool/mk_call_iseq_optimized.rb */ -RB_DEBUG_COUNTER(ccf_iseq_opt) /* has_opt == TRUE (has optional parameters), but other flags are FALSE */ -RB_DEBUG_COUNTER(ccf_iseq_kw1) /* vm_call_iseq_setup_kwparm_kwarg() */ -RB_DEBUG_COUNTER(ccf_iseq_kw2) /* vm_call_iseq_setup_kwparm_nokwarg() */ -RB_DEBUG_COUNTER(ccf_cfunc) -RB_DEBUG_COUNTER(ccf_cfunc_with_frame) -RB_DEBUG_COUNTER(ccf_ivar) /* attr_reader */ -RB_DEBUG_COUNTER(ccf_attrset) /* attr_writer */ -RB_DEBUG_COUNTER(ccf_method_missing) -RB_DEBUG_COUNTER(ccf_zsuper) -RB_DEBUG_COUNTER(ccf_bmethod) -RB_DEBUG_COUNTER(ccf_opt_send) -RB_DEBUG_COUNTER(ccf_opt_call) -RB_DEBUG_COUNTER(ccf_opt_block_call) -RB_DEBUG_COUNTER(ccf_opt_struct_aref) -RB_DEBUG_COUNTER(ccf_opt_struct_aset) -RB_DEBUG_COUNTER(ccf_super_method) -RB_DEBUG_COUNTER(ccf_cfunc_other) -RB_DEBUG_COUNTER(ccf_cfunc_only_splat) -RB_DEBUG_COUNTER(ccf_cfunc_only_splat_kw) -RB_DEBUG_COUNTER(ccf_iseq_bmethod) -RB_DEBUG_COUNTER(ccf_noniseq_bmethod) -RB_DEBUG_COUNTER(ccf_opt_send_complex) -RB_DEBUG_COUNTER(ccf_opt_send_simple) - -/* - * control frame push counts. - * - * * frame_push: frame push counts. - * * frame_push_*: frame push counts per each type. - * * frame_R2R: Ruby frame to Ruby frame - * * frame_R2C: Ruby frame to C frame - * * frame_C2C: C frame to C frame - * * frame_C2R: C frame to Ruby frame - */ -RB_DEBUG_COUNTER(frame_push) -RB_DEBUG_COUNTER(frame_push_method) -RB_DEBUG_COUNTER(frame_push_block) -RB_DEBUG_COUNTER(frame_push_class) -RB_DEBUG_COUNTER(frame_push_top) -RB_DEBUG_COUNTER(frame_push_cfunc) -RB_DEBUG_COUNTER(frame_push_ifunc) -RB_DEBUG_COUNTER(frame_push_eval) -RB_DEBUG_COUNTER(frame_push_rescue) -RB_DEBUG_COUNTER(frame_push_dummy) - -RB_DEBUG_COUNTER(frame_R2R) -RB_DEBUG_COUNTER(frame_R2C) -RB_DEBUG_COUNTER(frame_C2C) -RB_DEBUG_COUNTER(frame_C2R) - -/* instance variable counts */ -RB_DEBUG_COUNTER(ivar_get_obj_hit) // Only T_OBJECT hits -RB_DEBUG_COUNTER(ivar_get_obj_miss) // Only T_OBJECT misses -RB_DEBUG_COUNTER(ivar_get_ic_hit) // All hits -RB_DEBUG_COUNTER(ivar_get_ic_miss) // All misses -RB_DEBUG_COUNTER(ivar_set_ic_hit) // All hits -RB_DEBUG_COUNTER(ivar_set_obj_hit) // Only T_OBJECT hits -RB_DEBUG_COUNTER(ivar_set_obj_miss) // Only T_OBJECT misses -RB_DEBUG_COUNTER(ivar_set_ic_miss) // All misses -RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject) // Miss because non T_OBJECT -RB_DEBUG_COUNTER(ivar_get_base) // Calls to `rb_ivar_get` (very slow path) -RB_DEBUG_COUNTER(ivar_set_base) // Calls to `ivar_set` (very slow path) -RB_DEBUG_COUNTER(ivar_get_ic_miss_set) // Misses on IV reads where the cache was wrong -RB_DEBUG_COUNTER(ivar_get_cc_miss_set) // Misses on attr_reader where the cache was wrong -RB_DEBUG_COUNTER(ivar_get_ic_miss_unset) // Misses on IV read where the cache wasn't set -RB_DEBUG_COUNTER(ivar_get_cc_miss_unset) // Misses on attr_reader where the cache wasn't set - -/* local variable counts - * - * * lvar_get: total lvar get counts (VM insn) - * * lvar_get_dynamic: lvar get counts if accessing upper env (VM insn) - * * lvar_set*: same as "get" - * * lvar_set_slowpath: counts using vm_env_write_slowpath() - */ -RB_DEBUG_COUNTER(lvar_get) -RB_DEBUG_COUNTER(lvar_get_dynamic) -RB_DEBUG_COUNTER(lvar_set) -RB_DEBUG_COUNTER(lvar_set_dynamic) -RB_DEBUG_COUNTER(lvar_set_slowpath) - -/* GC counts: - * - * * count: simple count - * * _minor: minor gc - * * _major: major gc - * * other suffix is corresponding to last_gc_info or - * gc_profile_record_flag in gc.c. - */ -RB_DEBUG_COUNTER(gc_count) -RB_DEBUG_COUNTER(gc_minor_newobj) -RB_DEBUG_COUNTER(gc_minor_malloc) -RB_DEBUG_COUNTER(gc_minor_method) -RB_DEBUG_COUNTER(gc_minor_capi) -RB_DEBUG_COUNTER(gc_minor_stress) -RB_DEBUG_COUNTER(gc_major_nofree) -RB_DEBUG_COUNTER(gc_major_oldgen) -RB_DEBUG_COUNTER(gc_major_shady) -RB_DEBUG_COUNTER(gc_major_force) -RB_DEBUG_COUNTER(gc_major_oldmalloc) - -RB_DEBUG_COUNTER(gc_enter_start) -RB_DEBUG_COUNTER(gc_enter_continue) -RB_DEBUG_COUNTER(gc_enter_rest) -RB_DEBUG_COUNTER(gc_enter_finalizer) - -RB_DEBUG_COUNTER(gc_isptr_trial) -RB_DEBUG_COUNTER(gc_isptr_range) -RB_DEBUG_COUNTER(gc_isptr_align) -RB_DEBUG_COUNTER(gc_isptr_maybe) - -/* object allocation counts: - * - * * obj_newobj: newobj counts - * * obj_newobj_slowpath: newobj with slowpath counts - * * obj_newobj_wb_unprotected: newobj for wb_unprotected. - * * obj_free: obj_free() counts - * * obj_promote: promoted counts (oldgen) - * * obj_wb_unprotect: wb unprotect counts - * - * * obj_[type]_[attr]: *free'ed counts* for each type. - * Note that it is not a allocated counts. - * * [type] - * * _obj: T_OBJECT - * * _str: T_STRING - * * _ary: T_ARRAY - * * _xxx: T_XXX (hash, struct, ...) - * - * * [attr] - * * _ptr: R?? is not embed. - * * _embed: R?? is embed. - * * type specific attr. - * * str_shared: str is shared. - * * str_nofree: nofree - * * str_fstr: fstr - * * hash_empty: hash is empty - * * hash_1_4: has 1 to 4 entries - * * hash_5_8: has 5 to 8 entries - * * hash_g8: has n entries (n>8) - * * match_under4: has under 4 oniguruma regions allocated - * * match_ge4: has n regions allocated (4<=n<8) - * * match_ge8: has n regions allocated (8<=n) - * * data_empty: T_DATA but no memory free. - * * data_xfree: free'ed by xfree(). - * * data_imm_free: free'ed immediately. - * * data_zombie: free'ed with zombie. - * * imemo_*: T_IMEMO with each type. - */ -RB_DEBUG_COUNTER(obj_newobj) -RB_DEBUG_COUNTER(obj_newobj_slowpath) -RB_DEBUG_COUNTER(obj_newobj_wb_unprotected) -RB_DEBUG_COUNTER(obj_free) -RB_DEBUG_COUNTER(obj_promote) -RB_DEBUG_COUNTER(obj_wb_unprotect) - -RB_DEBUG_COUNTER(obj_obj_embed) -RB_DEBUG_COUNTER(obj_obj_ptr) -RB_DEBUG_COUNTER(obj_obj_too_complex) - -RB_DEBUG_COUNTER(obj_str_ptr) -RB_DEBUG_COUNTER(obj_str_embed) -RB_DEBUG_COUNTER(obj_str_shared) -RB_DEBUG_COUNTER(obj_str_nofree) -RB_DEBUG_COUNTER(obj_str_fstr) - -RB_DEBUG_COUNTER(obj_ary_embed) -RB_DEBUG_COUNTER(obj_ary_ptr) -RB_DEBUG_COUNTER(obj_ary_extracapa) -/* - ary_shared_create: shared ary by Array#dup and so on. - ary_shared: finished in shard. - ary_shared_root_occupied: shared_root but has only 1 refcnt. - The number (ary_shared - ary_shared_root_occupied) is meaningful. - */ -RB_DEBUG_COUNTER(obj_ary_shared_create) -RB_DEBUG_COUNTER(obj_ary_shared) -RB_DEBUG_COUNTER(obj_ary_shared_root_occupied) - -RB_DEBUG_COUNTER(obj_hash_empty) -RB_DEBUG_COUNTER(obj_hash_1) -RB_DEBUG_COUNTER(obj_hash_2) -RB_DEBUG_COUNTER(obj_hash_3) -RB_DEBUG_COUNTER(obj_hash_4) -RB_DEBUG_COUNTER(obj_hash_5_8) -RB_DEBUG_COUNTER(obj_hash_g8) - -RB_DEBUG_COUNTER(obj_hash_null) -RB_DEBUG_COUNTER(obj_hash_ar) -RB_DEBUG_COUNTER(obj_hash_st) -RB_DEBUG_COUNTER(obj_hash_force_convert) - -RB_DEBUG_COUNTER(obj_struct_embed) -RB_DEBUG_COUNTER(obj_struct_ptr) - -RB_DEBUG_COUNTER(obj_data_empty) -RB_DEBUG_COUNTER(obj_data_xfree) -RB_DEBUG_COUNTER(obj_data_imm_free) -RB_DEBUG_COUNTER(obj_data_zombie) - -RB_DEBUG_COUNTER(obj_match_under4) -RB_DEBUG_COUNTER(obj_match_ge4) -RB_DEBUG_COUNTER(obj_match_ge8) -RB_DEBUG_COUNTER(obj_match_ptr) - -RB_DEBUG_COUNTER(obj_iclass_ptr) -RB_DEBUG_COUNTER(obj_class_ptr) -RB_DEBUG_COUNTER(obj_module_ptr) - -RB_DEBUG_COUNTER(obj_bignum_ptr) -RB_DEBUG_COUNTER(obj_bignum_embed) -RB_DEBUG_COUNTER(obj_float) -RB_DEBUG_COUNTER(obj_complex) -RB_DEBUG_COUNTER(obj_rational) - -RB_DEBUG_COUNTER(obj_regexp_ptr) -RB_DEBUG_COUNTER(obj_file_ptr) -RB_DEBUG_COUNTER(obj_symbol) - -RB_DEBUG_COUNTER(obj_imemo_ment) -RB_DEBUG_COUNTER(obj_imemo_iseq) -RB_DEBUG_COUNTER(obj_imemo_env) -RB_DEBUG_COUNTER(obj_imemo_tmpbuf) -RB_DEBUG_COUNTER(obj_imemo_ast) -RB_DEBUG_COUNTER(obj_imemo_cref) -RB_DEBUG_COUNTER(obj_imemo_svar) -RB_DEBUG_COUNTER(obj_imemo_throw_data) -RB_DEBUG_COUNTER(obj_imemo_ifunc) -RB_DEBUG_COUNTER(obj_imemo_memo) -RB_DEBUG_COUNTER(obj_imemo_parser_strterm) -RB_DEBUG_COUNTER(obj_imemo_callinfo) -RB_DEBUG_COUNTER(obj_imemo_callcache) -RB_DEBUG_COUNTER(obj_imemo_constcache) - -/* ar_table */ -RB_DEBUG_COUNTER(artable_hint_hit) -RB_DEBUG_COUNTER(artable_hint_miss) -RB_DEBUG_COUNTER(artable_hint_notfound) - -/* heap function counts - * - * * heap_xmalloc/realloc/xfree: call counts - */ -RB_DEBUG_COUNTER(heap_xmalloc) -RB_DEBUG_COUNTER(heap_xrealloc) -RB_DEBUG_COUNTER(heap_xfree) - -// VM sync -RB_DEBUG_COUNTER(vm_sync_lock) -RB_DEBUG_COUNTER(vm_sync_lock_enter) -RB_DEBUG_COUNTER(vm_sync_lock_enter_nb) -RB_DEBUG_COUNTER(vm_sync_lock_enter_cr) -RB_DEBUG_COUNTER(vm_sync_barrier) - -/* load (not implemented yet) */ -/* -RB_DEBUG_COUNTER(load_files) -RB_DEBUG_COUNTER(load_path_is_not_realpath) -*/ -#endif - -#ifndef RUBY_DEBUG_COUNTER_H -#define RUBY_DEBUG_COUNTER_H 1 - -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/ruby.h" /* for VALUE */ - -#if !defined(__GNUC__) && USE_DEBUG_COUNTER -#error "USE_DEBUG_COUNTER is not supported by other than __GNUC__" -#endif - -enum rb_debug_counter_type { -#define RB_DEBUG_COUNTER(name) RB_DEBUG_COUNTER_##name, -#include __FILE__ - RB_DEBUG_COUNTER_MAX -#undef RB_DEBUG_COUNTER -}; - -#if USE_DEBUG_COUNTER -extern size_t rb_debug_counter[]; -RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; -RUBY_EXTERN void rb_debug_counter_add_atomic(enum rb_debug_counter_type type, int add); - -inline static int -rb_debug_counter_add(enum rb_debug_counter_type type, int add, int cond) -{ - if (cond) { - if (ruby_single_main_ractor != NULL) { - rb_debug_counter[(int)type] += add; - } - else { - rb_debug_counter_add_atomic(type, add); - } - } - return cond; -} - -inline static int -rb_debug_counter_max(enum rb_debug_counter_type type, unsigned int num) -{ - // TODO: sync - if (rb_debug_counter[(int)type] < num) { - rb_debug_counter[(int)type] = num; - return 1; - } - else { - return 0; - } -} - -VALUE rb_debug_counter_reset(VALUE klass); -VALUE rb_debug_counter_show(VALUE klass); - -#define RB_DEBUG_COUNTER_INC(type) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, 1) -#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !(cond))) -#define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !!(cond)) -#define RB_DEBUG_COUNTER_ADD(type, num) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, (num), 1) -#define RB_DEBUG_COUNTER_SETMAX(type, num) rb_debug_counter_max(RB_DEBUG_COUNTER_##type, (unsigned int)(num)) - -#else -#define RB_DEBUG_COUNTER_INC(type) ((void)0) -#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!!(cond)) -#define RB_DEBUG_COUNTER_INC_IF(type, cond) (!!(cond)) -#define RB_DEBUG_COUNTER_ADD(type, num) ((void)0) -#define RB_DEBUG_COUNTER_SETMAX(type, num) 0 -#endif - -void rb_debug_counter_show_results(const char *msg); - -RUBY_SYMBOL_EXPORT_BEGIN - -size_t ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr); -void ruby_debug_counter_reset(void); -void ruby_debug_counter_show_at_exit(int enable); - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_DEBUG_COUNTER_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h deleted file mode 100644 index 26df526..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef DLN_H -#define DLN_H -/********************************************************************** - - dln.h - - - $Author$ - created at: Wed Jan 19 16:53:09 JST 1994 - - Copyright (C) 1993-2007 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby/defines.h" /* for RUBY_SYMBOL_EXPORT_BEGIN */ - -RUBY_SYMBOL_EXPORT_BEGIN - -#ifndef DLN_FIND_EXTRA_ARG -#define DLN_FIND_EXTRA_ARG -#endif -#ifndef DLN_FIND_EXTRA_ARG_DECL -#define DLN_FIND_EXTRA_ARG_DECL -#endif - -bool dln_supported_p(void); -char *dln_find_exe_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL); -char *dln_find_file_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL); -void *dln_load(const char*); -void *dln_open(const char *file, char *error, size_t size); -void *dln_symbol(void*,const char*); - -RUBY_SYMBOL_EXPORT_END - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h deleted file mode 100644 index e6ddb1b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef RUBY_ENCINDEX_H -#define RUBY_ENCINDEX_H 1 -/********************************************************************** - - encindex.h - - - $Author$ - created at: Tue Sep 15 13:21:14 JST 2015 - - Copyright (C) 2015 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby/encoding.h" /* rb_ascii8bit_encindex etc. */ -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -enum ruby_preserved_encindex { - RUBY_ENCINDEX_ASCII_8BIT, - RUBY_ENCINDEX_UTF_8, - RUBY_ENCINDEX_US_ASCII, - - /* preserved indexes */ - RUBY_ENCINDEX_UTF_16BE, - RUBY_ENCINDEX_UTF_16LE, - RUBY_ENCINDEX_UTF_32BE, - RUBY_ENCINDEX_UTF_32LE, - RUBY_ENCINDEX_UTF_16, - RUBY_ENCINDEX_UTF_32, - RUBY_ENCINDEX_UTF8_MAC, - - /* for old options of regexp */ - RUBY_ENCINDEX_EUC_JP, - RUBY_ENCINDEX_Windows_31J, - - RUBY_ENCINDEX_BUILTIN_MAX -}; - -#define ENCINDEX_ASCII_8BIT RUBY_ENCINDEX_ASCII_8BIT -#define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8 -#define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII -#define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE -#define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE -#define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE -#define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE -#define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16 -#define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32 -#define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC -#define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP -#define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J -#define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX - -#define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII_8BIT -#define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8 -#define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII - -int rb_enc_find_index2(const char *name, long len); - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_ENCINDEX_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h deleted file mode 100644 index 9a55112..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h +++ /dev/null @@ -1,324 +0,0 @@ -#ifndef RUBY_EVAL_INTERN_H -#define RUBY_EVAL_INTERN_H - -#include "ruby/ruby.h" -#include "vm_core.h" - -static inline void -vm_passed_block_handler_set(rb_execution_context_t *ec, VALUE block_handler) -{ - vm_block_handler_verify(block_handler); - ec->passed_block_handler = block_handler; -} - -static inline void -pass_passed_block_handler(rb_execution_context_t *ec) -{ - VALUE block_handler = rb_vm_frame_block_handler(ec->cfp); - vm_passed_block_handler_set(ec, block_handler); - VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_PASSED); -} - -#define PASS_PASSED_BLOCK_HANDLER_EC(ec) pass_passed_block_handler(ec) -#define PASS_PASSED_BLOCK_HANDLER() pass_passed_block_handler(GET_EC()) - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif - -#include -#if defined(__wasm__) && !defined(__EMSCRIPTEN__) -# include "wasm/setjmp.h" -#else -# include -#endif - -#ifdef __APPLE__ -# ifdef HAVE_CRT_EXTERNS_H -# include -# else -# include "missing/crt_externs.h" -# endif -#endif - -#ifndef HAVE_STRING_H -char *strrchr(const char *, const char); -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_NET_SOCKET_H -#include -#endif - -#define ruby_setjmp(env) RUBY_SETJMP(env) -#define ruby_longjmp(env,val) RUBY_LONGJMP((env),(val)) -#ifdef __CYGWIN__ -# ifndef _setjmp -int _setjmp(jmp_buf); -# endif -# ifndef _longjmp -NORETURN(void _longjmp(jmp_buf, int)); -# endif -#endif - -#include -#include -#include - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -/* - Solaris sys/select.h switches select to select_large_fdset to support larger - file descriptors if FD_SETSIZE is larger than 1024 on 32bit environment. - But Ruby doesn't change FD_SETSIZE because fd_set is allocated dynamically. - So following definition is required to use select_large_fdset. -*/ -#ifdef HAVE_SELECT_LARGE_FDSET -#define select(n, r, w, e, t) select_large_fdset((n), (r), (w), (e), (t)) -extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval *); -#endif - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#include - -#define EC_PUSH_TAG(ec) do { \ - rb_execution_context_t * const _ec = (ec); \ - struct rb_vm_tag _tag; \ - _tag.state = TAG_NONE; \ - _tag.tag = Qundef; \ - _tag.prev = _ec->tag; \ - _tag.lock_rec = rb_ec_vm_lock_rec(_ec); \ - rb_vm_tag_jmpbuf_init(&_tag.buf); \ - -#define EC_POP_TAG() \ - _ec->tag = _tag.prev; \ - rb_vm_tag_jmpbuf_deinit(&_tag.buf); \ -} while (0) - -#define EC_TMPPOP_TAG() \ - _ec->tag = _tag.prev - -#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag) - -#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || defined __clang__ -/* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings. - * This macro also prevents Clang from dumping core in EC_EXEC_TAG(). - * (I confirmed Clang 4.0.1 and 5.0.0.) - */ -# define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var)) -# define VAR_INITIALIZED(var) ((var) = VAR_FROM_MEMORY(var)) -# define VAR_NOCLOBBERED(var) volatile var -#else -# define VAR_FROM_MEMORY(var) (var) -# define VAR_INITIALIZED(var) ((void)&(var)) -# define VAR_NOCLOBBERED(var) var -#endif - -static inline void -rb_ec_vm_lock_rec_check(const rb_execution_context_t *ec, unsigned int recorded_lock_rec) -{ - unsigned int current_lock_rec = rb_ec_vm_lock_rec(ec); - if (current_lock_rec != recorded_lock_rec) { - rb_ec_vm_lock_rec_release(ec, recorded_lock_rec, current_lock_rec); - } -} - -/* clear ec->tag->state, and return the value */ -static inline int -rb_ec_tag_state(const rb_execution_context_t *ec) -{ - struct rb_vm_tag *tag = ec->tag; - enum ruby_tag_type state = tag->state; - tag->state = TAG_NONE; - rb_ec_vm_lock_rec_check(ec, tag->lock_rec); - RBIMPL_ASSUME(state > TAG_NONE); - RBIMPL_ASSUME(state <= TAG_FATAL); - return state; -} - -NORETURN(static inline void rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st)); -static inline void -rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st) -{ - RUBY_ASSERT(st > TAG_NONE && st <= TAG_FATAL, ": Invalid tag jump: %d", (int)st); - ec->tag->state = st; - ruby_longjmp(RB_VM_TAG_JMPBUF_GET(ec->tag->buf), 1); -} - -/* - setjmp() in assignment expression rhs is undefined behavior - [ISO/IEC 9899:1999] 7.13.1.1 -*/ -#define EC_EXEC_TAG() \ - (UNLIKELY(ruby_setjmp(RB_VM_TAG_JMPBUF_GET(_tag.buf))) ? rb_ec_tag_state(VAR_FROM_MEMORY(_ec)) : (EC_REPUSH_TAG(), 0)) - -#define EC_JUMP_TAG(ec, st) rb_ec_tag_jump(ec, st) - -#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc) - -/* CREF operators */ - -#define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1 -#define CREF_FL_OMOD_SHARED IMEMO_FL_USER2 -#define CREF_FL_SINGLETON IMEMO_FL_USER3 - -static inline int CREF_SINGLETON(const rb_cref_t *cref); - -static inline VALUE -CREF_CLASS(const rb_cref_t *cref) -{ - if (CREF_SINGLETON(cref)) { - return CLASS_OF(cref->klass_or_self); - } - else { - return cref->klass_or_self; - } -} - -static inline VALUE -CREF_CLASS_FOR_DEFINITION(const rb_cref_t *cref) -{ - if (CREF_SINGLETON(cref)) { - return rb_singleton_class(cref->klass_or_self); - } - else { - return cref->klass_or_self; - } -} - -static inline rb_cref_t * -CREF_NEXT(const rb_cref_t *cref) -{ - return cref->next; -} - -static inline const rb_scope_visibility_t * -CREF_SCOPE_VISI(const rb_cref_t *cref) -{ - return &cref->scope_visi; -} - -static inline VALUE -CREF_REFINEMENTS(const rb_cref_t *cref) -{ - return cref->refinements; -} - -static inline void -CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs) -{ - RB_OBJ_WRITE(cref, &cref->refinements, refs); -} - -static inline int -CREF_PUSHED_BY_EVAL(const rb_cref_t *cref) -{ - return cref->flags & CREF_FL_PUSHED_BY_EVAL; -} - -static inline void -CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref) -{ - cref->flags |= CREF_FL_PUSHED_BY_EVAL; -} - -static inline int -CREF_SINGLETON(const rb_cref_t *cref) -{ - return cref->flags & CREF_FL_SINGLETON; -} - -static inline void -CREF_SINGLETON_SET(rb_cref_t *cref) -{ - cref->flags |= CREF_FL_SINGLETON; -} - -static inline int -CREF_OMOD_SHARED(const rb_cref_t *cref) -{ - return cref->flags & CREF_FL_OMOD_SHARED; -} - -static inline void -CREF_OMOD_SHARED_SET(rb_cref_t *cref) -{ - cref->flags |= CREF_FL_OMOD_SHARED; -} - -static inline void -CREF_OMOD_SHARED_UNSET(rb_cref_t *cref) -{ - cref->flags &= ~CREF_FL_OMOD_SHARED; -} - -enum { - RAISED_EXCEPTION = 1, - RAISED_STACKOVERFLOW = 2, - RAISED_NOMEMORY = 4 -}; -#define rb_ec_raised_set(ec, f) ((ec)->raised_flag |= (f)) -#define rb_ec_raised_reset(ec, f) ((ec)->raised_flag &= ~(f)) -#define rb_ec_raised_p(ec, f) (((ec)->raised_flag & (f)) != 0) -#define rb_ec_raised_clear(ec) ((ec)->raised_flag = 0) -int rb_ec_set_raised(rb_execution_context_t *ec); -int rb_ec_reset_raised(rb_execution_context_t *ec); -int rb_ec_stack_check(rb_execution_context_t *ec); - -VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self); -VALUE rb_make_exception(int argc, const VALUE *argv); - -NORETURN(void rb_method_name_error(VALUE, VALUE)); - -NORETURN(void rb_fiber_start(rb_fiber_t*)); - -NORETURN(void rb_print_undef(VALUE, ID, rb_method_visibility_t)); -NORETURN(void rb_print_undef_str(VALUE, VALUE)); -NORETURN(void rb_print_inaccessible(VALUE, ID, rb_method_visibility_t)); -NORETURN(void rb_vm_localjump_error(const char *,VALUE, int)); -NORETURN(void rb_vm_jump_tag_but_local_jump(enum ruby_tag_type)); - -VALUE rb_vm_make_jump_tag_but_local_jump(enum ruby_tag_type state, VALUE val); -rb_cref_t *rb_vm_cref(void); -rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void); -VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, VALUE block_handler, VALUE filename); -void rb_vm_set_progname(VALUE filename); -VALUE rb_vm_cbase(void); - -/* vm_backtrace.c */ -VALUE rb_ec_backtrace_object(const rb_execution_context_t *ec); -VALUE rb_ec_backtrace_str_ary(const rb_execution_context_t *ec, long lev, long n); -VALUE rb_ec_backtrace_location_ary(const rb_execution_context_t *ec, long lev, long n, bool skip_internal); - -#ifndef CharNext /* defined as CharNext[AW] on Windows. */ -# ifdef HAVE_MBLEN -# define CharNext(p) rb_char_next(p) -static inline char * -rb_char_next(const char *p) -{ - if (p) { - int len = mblen(p, RUBY_MBCHAR_MAXSIZE); - p += len > 0 ? len : 1; - } - return (char *)p; -} -# else -# define CharNext(p) ((p) + 1) -# endif -#endif - -#endif /* RUBY_EVAL_INTERN_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h deleted file mode 100644 index 2ca7b0c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h +++ /dev/null @@ -1,237 +0,0 @@ -#ifndef RB_HRTIME_H -#define RB_HRTIME_H -#include "ruby/ruby.h" -#include -#if defined(HAVE_SYS_TIME_H) -# include -#endif - -#include "internal/compilers.h" - -/* - * Hi-res monotonic clock. It is currently nsec resolution, which has over - * 500 years of range (with an unsigned 64-bit integer). Developers - * targeting small systems may try 32-bit and low-resolution (milliseconds). - * - * TBD: Is nsec even necessary? usec resolution seems enough for userspace - * and it'll be suitable for use with devices lasting over 500,000 years - * (maybe some devices designed for long-term space travel) - * - * Current API: - * - * * rb_hrtime_now - current clock value (monotonic if available) - * * rb_hrtime_mul - multiply with overflow check - * * rb_hrtime_add - add with overflow check - * * rb_timeval2hrtime - convert from timeval - * * rb_timespec2hrtime - convert from timespec - * * rb_msec2hrtime - convert from millisecond - * * rb_sec2hrtime - convert from time_t (seconds) - * * rb_hrtime2timeval - convert to timeval - * * rb_hrtime2timespec - convert to timespec - * - * Note: no conversion to milliseconds is provided here because different - * functions have different limits (e.g. epoll_wait vs w32_wait_events). - * So we provide RB_HRTIME_PER_MSEC and similar macros for implementing - * this for each use case. - */ -#define RB_HRTIME_PER_USEC ((rb_hrtime_t)1000) -#define RB_HRTIME_PER_MSEC (RB_HRTIME_PER_USEC * (rb_hrtime_t)1000) -#define RB_HRTIME_PER_SEC (RB_HRTIME_PER_MSEC * (rb_hrtime_t)1000) -#define RB_HRTIME_MAX UINT64_MAX -#define RB_HRTIME_MIN ((rb_hrtime_t)0) - -/* - * Lets try to support time travelers. Lets assume anybody with a time machine - * also has access to a modern gcc or clang with 128-bit int support - */ -#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL -typedef int128_t rb_hrtime_t; -#else -typedef uint64_t rb_hrtime_t; -#endif - -/* thread.c */ -/* returns the value of the monotonic clock (if available) */ -rb_hrtime_t rb_hrtime_now(void); - -/* - * multiply @a and @b with overflow check and return the - * (clamped to RB_HRTIME_MAX) result. - */ -static inline rb_hrtime_t -rb_hrtime_mul(rb_hrtime_t a, rb_hrtime_t b) -{ - rb_hrtime_t c; - -#ifdef ckd_mul - if (ckd_mul(&c, a, b)) - return RB_HRTIME_MAX; - -#elif __has_builtin(__builtin_mul_overflow) - if (__builtin_mul_overflow(a, b, &c)) - return RB_HRTIME_MAX; -#else - if (b != 0 && a > RB_HRTIME_MAX / b) /* overflow */ - return RB_HRTIME_MAX; - c = a * b; -#endif - return c; -} - -/* - * add @a and @b with overflow check and return the - * (clamped to RB_HRTIME_MAX) result. - */ -static inline rb_hrtime_t -rb_hrtime_add(rb_hrtime_t a, rb_hrtime_t b) -{ - rb_hrtime_t c; - -#ifdef ckd_add - if (ckd_add(&c, a, b)) - return RB_HRTIME_MAX; - -#elif __has_builtin(__builtin_add_overflow) - if (__builtin_add_overflow(a, b, &c)) - return RB_HRTIME_MAX; -#else - c = a + b; - if (c < a) /* overflow */ - return RB_HRTIME_MAX; -#endif - return c; -} - -static inline rb_hrtime_t -rb_hrtime_sub(rb_hrtime_t a, rb_hrtime_t b) -{ - if (a < b) { - return RB_HRTIME_MIN; - } - return a - b; -} - -/* - * convert a timeval struct to rb_hrtime_t, clamping at RB_HRTIME_MAX - */ -static inline rb_hrtime_t -rb_timeval2hrtime(const struct timeval *tv) -{ - rb_hrtime_t s = rb_hrtime_mul((rb_hrtime_t)tv->tv_sec, RB_HRTIME_PER_SEC); - rb_hrtime_t u = rb_hrtime_mul((rb_hrtime_t)tv->tv_usec, RB_HRTIME_PER_USEC); - - return rb_hrtime_add(s, u); -} - -/* - * convert a timespec struct to rb_hrtime_t, clamping at RB_HRTIME_MAX - */ -static inline rb_hrtime_t -rb_timespec2hrtime(const struct timespec *ts) -{ - rb_hrtime_t s = rb_hrtime_mul((rb_hrtime_t)ts->tv_sec, RB_HRTIME_PER_SEC); - - return rb_hrtime_add(s, (rb_hrtime_t)ts->tv_nsec); -} - -/* - * convert a millisecond value to rb_hrtime_t, clamping at RB_HRTIME_MAX - */ -static inline rb_hrtime_t -rb_msec2hrtime(unsigned long msec) -{ - return rb_hrtime_mul((rb_hrtime_t)msec, RB_HRTIME_PER_MSEC); -} - -/* - * convert a time_t value to rb_hrtime_t, clamping at RB_HRTIME_MAX - * Negative values will be clamped at 0. - */ -static inline rb_hrtime_t -rb_sec2hrtime(time_t sec) -{ - if (sec <= 0) return 0; - - return rb_hrtime_mul((rb_hrtime_t)sec, RB_HRTIME_PER_SEC); -} - -/* - * convert a rb_hrtime_t value to a timespec, suitable for calling - * functions like ppoll(2) or kevent(2) - */ -static inline struct timespec * -rb_hrtime2timespec(struct timespec *ts, const rb_hrtime_t *hrt) -{ - if (hrt) { - ts->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC); - ts->tv_nsec = (int32_t)(*hrt % RB_HRTIME_PER_SEC); - return ts; - } - return 0; -} - -/* - * convert a rb_hrtime_t value to a timeval, suitable for calling - * functions like select(2) - */ -static inline struct timeval * -rb_hrtime2timeval(struct timeval *tv, const rb_hrtime_t *hrt) -{ - if (hrt) { - tv->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC); - tv->tv_usec = (int32_t)((*hrt % RB_HRTIME_PER_SEC)/RB_HRTIME_PER_USEC); - - return tv; - } - return 0; -} - -#include "internal/warnings.h" -#include "internal/time.h" - -/* - * Back when we used "struct timeval", not all platforms implemented - * tv_sec as time_t. Nowadays we use "struct timespec" and tv_sec - * seems to be implemented more consistently across platforms. - * At least other parts of our code hasn't had to deal with non-time_t - * tv_sec in timespec... - */ -#define TIMESPEC_SEC_MAX TIMET_MAX -#define TIMESPEC_SEC_MIN TIMET_MIN - -COMPILER_WARNING_PUSH -#if __has_warning("-Wimplicit-int-float-conversion") -COMPILER_WARNING_IGNORED(-Wimplicit-int-float-conversion) -#elif defined(_MSC_VER) -/* C4305: 'initializing': truncation from '__int64' to 'const double' */ -COMPILER_WARNING_IGNORED(4305) -#endif -static const double TIMESPEC_SEC_MAX_as_double = TIMESPEC_SEC_MAX; -COMPILER_WARNING_POP - -static inline rb_hrtime_t * -double2hrtime(rb_hrtime_t *hrt, double d) -{ - /* assume timespec.tv_sec has same signedness as time_t */ - const double TIMESPEC_SEC_MAX_PLUS_ONE = 2.0 * (TIMESPEC_SEC_MAX_as_double / 2.0 + 1.0); - - if (TIMESPEC_SEC_MAX_PLUS_ONE <= d) { - *hrt = RB_HRTIME_MAX; - return NULL; - } - else if (d <= 0) { - *hrt = 0; - } - else { - *hrt = (rb_hrtime_t)(d * (double)RB_HRTIME_PER_SEC); - } - return hrt; -} - -static inline double -hrtime2double(rb_hrtime_t hrt) -{ - return (double)hrt / (double)RB_HRTIME_PER_SEC; -} - -#endif /* RB_HRTIME_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h deleted file mode 100644 index 66a6531..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h +++ /dev/null @@ -1,343 +0,0 @@ -/* DO NOT EDIT THIS FILE DIRECTLY */ -/********************************************************************** - - id.h - - - $Author$ - created at: Sun Oct 19 21:12:51 2008 - - Copyright (C) 2007 Koichi Sasada - -**********************************************************************/ - -#ifndef RUBY_ID_H -#define RUBY_ID_H - -enum ruby_id_types { - RUBY_ID_STATIC_SYM = 0x01, - RUBY_ID_LOCAL = 0x00, - RUBY_ID_INSTANCE = (0x01<<1), - RUBY_ID_GLOBAL = (0x03<<1), - RUBY_ID_ATTRSET = (0x04<<1), - RUBY_ID_CONST = (0x05<<1), - RUBY_ID_CLASS = (0x06<<1), - RUBY_ID_JUNK = (0x07<<1), - RUBY_ID_INTERNAL = RUBY_ID_JUNK, - RUBY_ID_SCOPE_SHIFT = 4, - RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1) -}; - -#define ID_STATIC_SYM RUBY_ID_STATIC_SYM -#define ID_SCOPE_SHIFT RUBY_ID_SCOPE_SHIFT -#define ID_SCOPE_MASK RUBY_ID_SCOPE_MASK -#define ID_LOCAL RUBY_ID_LOCAL -#define ID_INSTANCE RUBY_ID_INSTANCE -#define ID_GLOBAL RUBY_ID_GLOBAL -#define ID_ATTRSET RUBY_ID_ATTRSET -#define ID_CONST RUBY_ID_CONST -#define ID_CLASS RUBY_ID_CLASS -#define ID_JUNK RUBY_ID_JUNK -#define ID_INTERNAL RUBY_ID_INTERNAL - -#define symIFUNC ID2SYM(idIFUNC) -#define symCFUNC ID2SYM(idCFUNC) - -#define RUBY_TOKEN_DOT2 128 -#define RUBY_TOKEN_DOT3 129 -#define RUBY_TOKEN_BDOT2 130 -#define RUBY_TOKEN_BDOT3 131 -#define RUBY_TOKEN_UPLUS 132 -#define RUBY_TOKEN_UMINUS 133 -#define RUBY_TOKEN_POW 134 -#define RUBY_TOKEN_CMP 135 -#define RUBY_TOKEN_LSHFT 136 -#define RUBY_TOKEN_RSHFT 137 -#define RUBY_TOKEN_LEQ 138 -#define RUBY_TOKEN_GEQ 139 -#define RUBY_TOKEN_EQ 140 -#define RUBY_TOKEN_EQQ 141 -#define RUBY_TOKEN_NEQ 142 -#define RUBY_TOKEN_MATCH 143 -#define RUBY_TOKEN_NMATCH 144 -#define RUBY_TOKEN_AREF 145 -#define RUBY_TOKEN_ASET 146 -#define RUBY_TOKEN_COLON2 147 -#define RUBY_TOKEN_ANDOP 148 -#define RUBY_TOKEN_OROP 149 -#define RUBY_TOKEN_ANDDOT 150 -#define RUBY_TOKEN(t) RUBY_TOKEN_##t - -#define RUBY_TOKEN2ID_TYPE(tok, type) ((tok<> ID_SCOPE_SHIFT -}; - -#endif /* RUBY_ID_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h deleted file mode 100644 index f72e2d1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef RUBY_ID_TABLE_H -#define RUBY_ID_TABLE_H 1 -#include "ruby/internal/config.h" -#include -#include "ruby/ruby.h" - -struct rb_id_table; - -/* compatible with ST_* */ -enum rb_id_table_iterator_result { - ID_TABLE_CONTINUE = ST_CONTINUE, - ID_TABLE_STOP = ST_STOP, - ID_TABLE_DELETE = ST_DELETE, - ID_TABLE_REPLACE = ST_REPLACE, - ID_TABLE_ITERATOR_RESULT_END -}; - -struct rb_id_table *rb_id_table_create(size_t size); -void rb_id_table_free(struct rb_id_table *tbl); -void rb_id_table_clear(struct rb_id_table *tbl); - -size_t rb_id_table_memsize(const struct rb_id_table *tbl); - -int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val); -int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp); -int rb_id_table_delete(struct rb_id_table *tbl, ID id); - -typedef enum rb_id_table_iterator_result rb_id_table_update_value_callback_func_t(VALUE *val, void *data, int existing); -typedef enum rb_id_table_iterator_result rb_id_table_foreach_func_t(ID id, VALUE val, void *data); -typedef enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t(VALUE val, void *data); -void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data); -void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data); -void rb_id_table_foreach_values_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, rb_id_table_update_value_callback_func_t *replace, void *data); - -RUBY_SYMBOL_EXPORT_BEGIN -size_t rb_id_table_size(const struct rb_id_table *tbl); -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_ID_TABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc deleted file mode 100644 index 5fa986e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file contains YARV instruction list. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/insns.inc.erb" - or tool/insns2vm.rb - */ - -/* BIN : Basic Instruction Name */ -#define BIN(n) YARVINSN_##n - -enum ruby_vminsn_type { - BIN(nop), - BIN(getlocal), - BIN(setlocal), - BIN(getblockparam), - BIN(setblockparam), - BIN(getblockparamproxy), - BIN(getspecial), - BIN(setspecial), - BIN(getinstancevariable), - BIN(setinstancevariable), - BIN(getclassvariable), - BIN(setclassvariable), - BIN(opt_getconstant_path), - BIN(getconstant), - BIN(setconstant), - BIN(getglobal), - BIN(setglobal), - BIN(putnil), - BIN(putself), - BIN(putobject), - BIN(putspecialobject), - BIN(putstring), - BIN(putchilledstring), - BIN(concatstrings), - BIN(anytostring), - BIN(toregexp), - BIN(intern), - BIN(newarray), - BIN(newarraykwsplat), - BIN(pushtoarraykwsplat), - BIN(duparray), - BIN(duphash), - BIN(expandarray), - BIN(concatarray), - BIN(concattoarray), - BIN(pushtoarray), - BIN(splatarray), - BIN(splatkw), - BIN(newhash), - BIN(newrange), - BIN(pop), - BIN(dup), - BIN(dupn), - BIN(swap), - BIN(opt_reverse), - BIN(topn), - BIN(setn), - BIN(adjuststack), - BIN(defined), - BIN(definedivar), - BIN(checkmatch), - BIN(checkkeyword), - BIN(checktype), - BIN(defineclass), - BIN(definemethod), - BIN(definesmethod), - BIN(send), - BIN(opt_send_without_block), - BIN(objtostring), - BIN(opt_str_freeze), - BIN(opt_nil_p), - BIN(opt_str_uminus), - BIN(opt_newarray_send), - BIN(invokesuper), - BIN(invokeblock), - BIN(leave), - BIN(throw), - BIN(jump), - BIN(branchif), - BIN(branchunless), - BIN(branchnil), - BIN(once), - BIN(opt_case_dispatch), - BIN(opt_plus), - BIN(opt_minus), - BIN(opt_mult), - BIN(opt_div), - BIN(opt_mod), - BIN(opt_eq), - BIN(opt_neq), - BIN(opt_lt), - BIN(opt_le), - BIN(opt_gt), - BIN(opt_ge), - BIN(opt_ltlt), - BIN(opt_and), - BIN(opt_or), - BIN(opt_aref), - BIN(opt_aset), - BIN(opt_aset_with), - BIN(opt_aref_with), - BIN(opt_length), - BIN(opt_size), - BIN(opt_empty_p), - BIN(opt_succ), - BIN(opt_not), - BIN(opt_regexpmatch2), - BIN(invokebuiltin), - BIN(opt_invokebuiltin_delegate), - BIN(opt_invokebuiltin_delegate_leave), - BIN(getlocal_WC_0), - BIN(getlocal_WC_1), - BIN(setlocal_WC_0), - BIN(setlocal_WC_1), - BIN(putobject_INT2FIX_0_), - BIN(putobject_INT2FIX_1_), - BIN(trace_nop), - BIN(trace_getlocal), - BIN(trace_setlocal), - BIN(trace_getblockparam), - BIN(trace_setblockparam), - BIN(trace_getblockparamproxy), - BIN(trace_getspecial), - BIN(trace_setspecial), - BIN(trace_getinstancevariable), - BIN(trace_setinstancevariable), - BIN(trace_getclassvariable), - BIN(trace_setclassvariable), - BIN(trace_opt_getconstant_path), - BIN(trace_getconstant), - BIN(trace_setconstant), - BIN(trace_getglobal), - BIN(trace_setglobal), - BIN(trace_putnil), - BIN(trace_putself), - BIN(trace_putobject), - BIN(trace_putspecialobject), - BIN(trace_putstring), - BIN(trace_putchilledstring), - BIN(trace_concatstrings), - BIN(trace_anytostring), - BIN(trace_toregexp), - BIN(trace_intern), - BIN(trace_newarray), - BIN(trace_newarraykwsplat), - BIN(trace_pushtoarraykwsplat), - BIN(trace_duparray), - BIN(trace_duphash), - BIN(trace_expandarray), - BIN(trace_concatarray), - BIN(trace_concattoarray), - BIN(trace_pushtoarray), - BIN(trace_splatarray), - BIN(trace_splatkw), - BIN(trace_newhash), - BIN(trace_newrange), - BIN(trace_pop), - BIN(trace_dup), - BIN(trace_dupn), - BIN(trace_swap), - BIN(trace_opt_reverse), - BIN(trace_topn), - BIN(trace_setn), - BIN(trace_adjuststack), - BIN(trace_defined), - BIN(trace_definedivar), - BIN(trace_checkmatch), - BIN(trace_checkkeyword), - BIN(trace_checktype), - BIN(trace_defineclass), - BIN(trace_definemethod), - BIN(trace_definesmethod), - BIN(trace_send), - BIN(trace_opt_send_without_block), - BIN(trace_objtostring), - BIN(trace_opt_str_freeze), - BIN(trace_opt_nil_p), - BIN(trace_opt_str_uminus), - BIN(trace_opt_newarray_send), - BIN(trace_invokesuper), - BIN(trace_invokeblock), - BIN(trace_leave), - BIN(trace_throw), - BIN(trace_jump), - BIN(trace_branchif), - BIN(trace_branchunless), - BIN(trace_branchnil), - BIN(trace_once), - BIN(trace_opt_case_dispatch), - BIN(trace_opt_plus), - BIN(trace_opt_minus), - BIN(trace_opt_mult), - BIN(trace_opt_div), - BIN(trace_opt_mod), - BIN(trace_opt_eq), - BIN(trace_opt_neq), - BIN(trace_opt_lt), - BIN(trace_opt_le), - BIN(trace_opt_gt), - BIN(trace_opt_ge), - BIN(trace_opt_ltlt), - BIN(trace_opt_and), - BIN(trace_opt_or), - BIN(trace_opt_aref), - BIN(trace_opt_aset), - BIN(trace_opt_aset_with), - BIN(trace_opt_aref_with), - BIN(trace_opt_length), - BIN(trace_opt_size), - BIN(trace_opt_empty_p), - BIN(trace_opt_succ), - BIN(trace_opt_not), - BIN(trace_opt_regexpmatch2), - BIN(trace_invokebuiltin), - BIN(trace_opt_invokebuiltin_delegate), - BIN(trace_opt_invokebuiltin_delegate_leave), - BIN(trace_getlocal_WC_0), - BIN(trace_getlocal_WC_1), - BIN(trace_setlocal_WC_0), - BIN(trace_setlocal_WC_1), - BIN(trace_putobject_INT2FIX_0_), - BIN(trace_putobject_INT2FIX_1_), - VM_INSTRUCTION_SIZE -}; - -#define ASSERT_VM_INSTRUCTION_SIZE(array) \ - STATIC_ASSERT(numberof_##array, numberof(array) == VM_INSTRUCTION_SIZE) diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc deleted file mode 100644 index f12d5ce..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc +++ /dev/null @@ -1,9530 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file contains instruction information for yarv instruction sequence.. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/insns_info.inc.erb" - or tool/insns2vm.rb - */ - -enum ruby_insn_type_chars { - TS_VARIABLE = '.', - TS_CALLDATA = 'C', - TS_CDHASH = 'H', - TS_IC = 'K', - TS_IVC = 'A', - TS_ICVARC = 'J', - TS_ID = 'I', - TS_ISE = 'T', - TS_ISEQ = 'S', - TS_OFFSET = 'O', - TS_VALUE = 'V', - TS_LINDEX = 'L', - TS_FUNCPTR = 'F', - TS_NUM = 'N', - TS_BUILTIN = 'R', -}; - -static inline union iseq_inline_storage_entry * -ISEQ_IS_ENTRY_START(const struct rb_iseq_constant_body *body, char op_type) -{ - unsigned int relative_ic_offset = 0; - switch (op_type) { - case TS_IC: - relative_ic_offset += body->ise_size; - case TS_ISE: - relative_ic_offset += body->icvarc_size; - case TS_ICVARC: - relative_ic_offset += body->ivc_size; - case TS_IVC: - break; - default: - rb_bug("Wrong op type"); - } - return &body->is_entries[relative_ic_offset]; -} - -CONSTFUNC(MAYBE_UNUSED(static const char *insn_name(VALUE insn))); - -RUBY_SYMBOL_EXPORT_BEGIN /* for debuggers */ -extern const int rb_vm_max_insn_name_size; -extern const char rb_vm_insn_name_base[]; -extern const unsigned short rb_vm_insn_name_offset[VM_INSTRUCTION_SIZE]; -RUBY_SYMBOL_EXPORT_END - -#ifdef RUBY_VM_INSNS_INFO -const int rb_vm_max_insn_name_size = 38; - -const char rb_vm_insn_name_base[] = - "nop" "\0" - "getlocal" "\0" - "setlocal" "\0" - "getblockparam" "\0" - "setblockparam" "\0" - "getblockparamproxy" "\0" - "getspecial" "\0" - "setspecial" "\0" - "getinstancevariable" "\0" - "setinstancevariable" "\0" - "getclassvariable" "\0" - "setclassvariable" "\0" - "opt_getconstant_path" "\0" - "getconstant" "\0" - "setconstant" "\0" - "getglobal" "\0" - "setglobal" "\0" - "putnil" "\0" - "putself" "\0" - "putobject" "\0" - "putspecialobject" "\0" - "putstring" "\0" - "putchilledstring" "\0" - "concatstrings" "\0" - "anytostring" "\0" - "toregexp" "\0" - "intern" "\0" - "newarray" "\0" - "newarraykwsplat" "\0" - "pushtoarraykwsplat" "\0" - "duparray" "\0" - "duphash" "\0" - "expandarray" "\0" - "concatarray" "\0" - "concattoarray" "\0" - "pushtoarray" "\0" - "splatarray" "\0" - "splatkw" "\0" - "newhash" "\0" - "newrange" "\0" - "pop" "\0" - "dup" "\0" - "dupn" "\0" - "swap" "\0" - "opt_reverse" "\0" - "topn" "\0" - "setn" "\0" - "adjuststack" "\0" - "defined" "\0" - "definedivar" "\0" - "checkmatch" "\0" - "checkkeyword" "\0" - "checktype" "\0" - "defineclass" "\0" - "definemethod" "\0" - "definesmethod" "\0" - "send" "\0" - "opt_send_without_block" "\0" - "objtostring" "\0" - "opt_str_freeze" "\0" - "opt_nil_p" "\0" - "opt_str_uminus" "\0" - "opt_newarray_send" "\0" - "invokesuper" "\0" - "invokeblock" "\0" - "leave" "\0" - "throw" "\0" - "jump" "\0" - "branchif" "\0" - "branchunless" "\0" - "branchnil" "\0" - "once" "\0" - "opt_case_dispatch" "\0" - "opt_plus" "\0" - "opt_minus" "\0" - "opt_mult" "\0" - "opt_div" "\0" - "opt_mod" "\0" - "opt_eq" "\0" - "opt_neq" "\0" - "opt_lt" "\0" - "opt_le" "\0" - "opt_gt" "\0" - "opt_ge" "\0" - "opt_ltlt" "\0" - "opt_and" "\0" - "opt_or" "\0" - "opt_aref" "\0" - "opt_aset" "\0" - "opt_aset_with" "\0" - "opt_aref_with" "\0" - "opt_length" "\0" - "opt_size" "\0" - "opt_empty_p" "\0" - "opt_succ" "\0" - "opt_not" "\0" - "opt_regexpmatch2" "\0" - "invokebuiltin" "\0" - "opt_invokebuiltin_delegate" "\0" - "opt_invokebuiltin_delegate_leave" "\0" - "getlocal_WC_0" "\0" - "getlocal_WC_1" "\0" - "setlocal_WC_0" "\0" - "setlocal_WC_1" "\0" - "putobject_INT2FIX_0_" "\0" - "putobject_INT2FIX_1_" "\0" - "trace_nop" "\0" - "trace_getlocal" "\0" - "trace_setlocal" "\0" - "trace_getblockparam" "\0" - "trace_setblockparam" "\0" - "trace_getblockparamproxy" "\0" - "trace_getspecial" "\0" - "trace_setspecial" "\0" - "trace_getinstancevariable" "\0" - "trace_setinstancevariable" "\0" - "trace_getclassvariable" "\0" - "trace_setclassvariable" "\0" - "trace_opt_getconstant_path" "\0" - "trace_getconstant" "\0" - "trace_setconstant" "\0" - "trace_getglobal" "\0" - "trace_setglobal" "\0" - "trace_putnil" "\0" - "trace_putself" "\0" - "trace_putobject" "\0" - "trace_putspecialobject" "\0" - "trace_putstring" "\0" - "trace_putchilledstring" "\0" - "trace_concatstrings" "\0" - "trace_anytostring" "\0" - "trace_toregexp" "\0" - "trace_intern" "\0" - "trace_newarray" "\0" - "trace_newarraykwsplat" "\0" - "trace_pushtoarraykwsplat" "\0" - "trace_duparray" "\0" - "trace_duphash" "\0" - "trace_expandarray" "\0" - "trace_concatarray" "\0" - "trace_concattoarray" "\0" - "trace_pushtoarray" "\0" - "trace_splatarray" "\0" - "trace_splatkw" "\0" - "trace_newhash" "\0" - "trace_newrange" "\0" - "trace_pop" "\0" - "trace_dup" "\0" - "trace_dupn" "\0" - "trace_swap" "\0" - "trace_opt_reverse" "\0" - "trace_topn" "\0" - "trace_setn" "\0" - "trace_adjuststack" "\0" - "trace_defined" "\0" - "trace_definedivar" "\0" - "trace_checkmatch" "\0" - "trace_checkkeyword" "\0" - "trace_checktype" "\0" - "trace_defineclass" "\0" - "trace_definemethod" "\0" - "trace_definesmethod" "\0" - "trace_send" "\0" - "trace_opt_send_without_block" "\0" - "trace_objtostring" "\0" - "trace_opt_str_freeze" "\0" - "trace_opt_nil_p" "\0" - "trace_opt_str_uminus" "\0" - "trace_opt_newarray_send" "\0" - "trace_invokesuper" "\0" - "trace_invokeblock" "\0" - "trace_leave" "\0" - "trace_throw" "\0" - "trace_jump" "\0" - "trace_branchif" "\0" - "trace_branchunless" "\0" - "trace_branchnil" "\0" - "trace_once" "\0" - "trace_opt_case_dispatch" "\0" - "trace_opt_plus" "\0" - "trace_opt_minus" "\0" - "trace_opt_mult" "\0" - "trace_opt_div" "\0" - "trace_opt_mod" "\0" - "trace_opt_eq" "\0" - "trace_opt_neq" "\0" - "trace_opt_lt" "\0" - "trace_opt_le" "\0" - "trace_opt_gt" "\0" - "trace_opt_ge" "\0" - "trace_opt_ltlt" "\0" - "trace_opt_and" "\0" - "trace_opt_or" "\0" - "trace_opt_aref" "\0" - "trace_opt_aset" "\0" - "trace_opt_aset_with" "\0" - "trace_opt_aref_with" "\0" - "trace_opt_length" "\0" - "trace_opt_size" "\0" - "trace_opt_empty_p" "\0" - "trace_opt_succ" "\0" - "trace_opt_not" "\0" - "trace_opt_regexpmatch2" "\0" - "trace_invokebuiltin" "\0" - "trace_opt_invokebuiltin_delegate" "\0" - "trace_opt_invokebuiltin_delegate_leave" "\0" - "trace_getlocal_WC_0" "\0" - "trace_getlocal_WC_1" "\0" - "trace_setlocal_WC_0" "\0" - "trace_setlocal_WC_1" "\0" - "trace_putobject_INT2FIX_0_" "\0" - "trace_putobject_INT2FIX_1_" "\0" - ; - -const unsigned short rb_vm_insn_name_offset[] = { - 0, 4, 13, 22, 36, 50, 69, 80, 91, 111, 131, 148, - 165, 186, 198, 210, 220, 230, 237, 245, 255, 272, 282, 299, - 313, 325, 334, 341, 350, 366, 385, 394, 402, 414, 426, 440, - 452, 463, 471, 479, 488, 492, 496, 501, 506, 518, 523, 528, - 540, 548, 560, 571, 584, 594, 606, 619, 633, 638, 661, 673, - 688, 698, 713, 731, 743, 755, 761, 767, 772, 781, 794, 804, - 809, 827, 836, 846, 855, 863, 871, 878, 886, 893, 900, 907, - 914, 923, 931, 938, 947, 956, 970, 984, 995, 1004, 1016, 1025, - 1033, 1050, 1064, 1091, 1124, 1138, 1152, 1166, 1180, 1201, 1222, 1232, - 1247, 1262, 1282, 1302, 1327, 1344, 1361, 1387, 1413, 1436, 1459, 1486, - 1504, 1522, 1538, 1554, 1567, 1581, 1597, 1620, 1636, 1659, 1679, 1697, - 1712, 1725, 1740, 1762, 1787, 1802, 1816, 1834, 1852, 1872, 1890, 1907, - 1921, 1935, 1950, 1960, 1970, 1981, 1992, 2010, 2021, 2032, 2050, 2064, - 2082, 2099, 2118, 2134, 2152, 2171, 2191, 2202, 2231, 2249, 2270, 2286, - 2307, 2331, 2349, 2367, 2379, 2391, 2402, 2417, 2436, 2452, 2463, 2487, - 2502, 2518, 2533, 2547, 2561, 2574, 2588, 2601, 2614, 2627, 2640, 2655, - 2669, 2682, 2697, 2712, 2732, 2752, 2769, 2784, 2802, 2817, 2831, 2854, - 2874, 2907, 2946, 2966, 2986, 3006, 3026, 3053, -}; - -ASSERT_VM_INSTRUCTION_SIZE(rb_vm_insn_name_offset); -#endif - -const char * -insn_name(VALUE i) -{ - return &rb_vm_insn_name_base[rb_vm_insn_name_offset[i]]; -} - -CONSTFUNC(MAYBE_UNUSED(static int insn_len(VALUE insn))); - -RUBY_SYMBOL_EXPORT_BEGIN /* for debuggers */ -extern const uint8_t rb_vm_insn_len_info[VM_INSTRUCTION_SIZE]; -RUBY_SYMBOL_EXPORT_END - -#ifdef RUBY_VM_INSNS_INFO -const uint8_t rb_vm_insn_len_info[] = { - 1, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, - 2, 1, 3, 1, 2, 2, 1, 2, 2, 3, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, - 2, 2, 4, 4, 2, 3, 2, 4, 3, 3, 3, 2, 2, 3, 2, 3, 3, 3, 2, 1, 2, 2, 2, - 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, - 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 1, 1, 1, 3, 3, 3, 3, 3, 3, 2, 3, - 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 3, 1, 2, 2, 1, 2, 2, - 3, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 4, 4, 2, 3, 2, 4, 3, - 3, 3, 2, 2, 3, 2, 3, 3, 3, 2, 1, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, - 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, - 2, 2, 2, 1, 1, -}; - -ASSERT_VM_INSTRUCTION_SIZE(rb_vm_insn_len_info); -#endif - -int -insn_len(VALUE i) -{ - return rb_vm_insn_len_info[i]; -} - -CONSTFUNC(MAYBE_UNUSED(static const char *insn_op_types(VALUE insn))); -CONSTFUNC(MAYBE_UNUSED(static int insn_op_type(VALUE insn, long pos))); - -RUBY_SYMBOL_EXPORT_BEGIN /* for debuggers */ -extern const char rb_vm_insn_op_base[]; -extern const unsigned short rb_vm_insn_op_offset[VM_INSTRUCTION_SIZE]; -RUBY_SYMBOL_EXPORT_END - -#ifdef RUBY_VM_INSNS_INFO -const char rb_vm_insn_op_base[] = - "" "\0" "LN" "\0" "LN" "\0" "LN" "\0" "LN" "\0" - "LN" "\0" "NN" "\0" "N" "\0" "IA" "\0" "IA" "\0" - "IJ" "\0" "IJ" "\0" "K" "\0" "I" "\0" "I" "\0" - "I" "\0" "I" "\0" "" "\0" "" "\0" "V" "\0" - "N" "\0" "V" "\0" "V" "\0" "N" "\0" "" "\0" - "NN" "\0" "" "\0" "N" "\0" "N" "\0" "" "\0" - "V" "\0" "V" "\0" "NN" "\0" "" "\0" "" "\0" - "N" "\0" "V" "\0" "" "\0" "N" "\0" "N" "\0" - "" "\0" "" "\0" "N" "\0" "" "\0" "N" "\0" - "N" "\0" "N" "\0" "N" "\0" "NVV" "\0" "IAV" "\0" - "N" "\0" "LL" "\0" "N" "\0" "ISN" "\0" "IS" "\0" - "IS" "\0" "CS" "\0" "C" "\0" "C" "\0" "VC" "\0" - "C" "\0" "VC" "\0" "NI" "\0" "CS" "\0" "C" "\0" - "" "\0" "N" "\0" "O" "\0" "O" "\0" "O" "\0" - "O" "\0" "ST" "\0" "HO" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "CC" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "VC" "\0" - "VC" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "R" "\0" "RN" "\0" "RN" "\0" - "L" "\0" "L" "\0" "L" "\0" "L" "\0" "" "\0" - "" "\0" "" "\0" "LN" "\0" "LN" "\0" "LN" "\0" - "LN" "\0" "LN" "\0" "NN" "\0" "N" "\0" "IA" "\0" - "IA" "\0" "IJ" "\0" "IJ" "\0" "K" "\0" "I" "\0" - "I" "\0" "I" "\0" "I" "\0" "" "\0" "" "\0" - "V" "\0" "N" "\0" "V" "\0" "V" "\0" "N" "\0" - "" "\0" "NN" "\0" "" "\0" "N" "\0" "N" "\0" - "" "\0" "V" "\0" "V" "\0" "NN" "\0" "" "\0" - "" "\0" "N" "\0" "V" "\0" "" "\0" "N" "\0" - "N" "\0" "" "\0" "" "\0" "N" "\0" "" "\0" - "N" "\0" "N" "\0" "N" "\0" "N" "\0" "NVV" "\0" - "IAV" "\0" "N" "\0" "LL" "\0" "N" "\0" "ISN" "\0" - "IS" "\0" "IS" "\0" "CS" "\0" "C" "\0" "C" "\0" - "VC" "\0" "C" "\0" "VC" "\0" "NI" "\0" "CS" "\0" - "C" "\0" "" "\0" "N" "\0" "O" "\0" "O" "\0" - "O" "\0" "O" "\0" "ST" "\0" "HO" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "CC" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "VC" "\0" "VC" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "R" "\0" "RN" "\0" - "RN" "\0" "L" "\0" "L" "\0" "L" "\0" "L" "\0" - "" "\0" "" "\0" - ; - -const unsigned short rb_vm_insn_op_offset[] = { - 0, 1, 4, 7, 10, 13, 16, 19, 21, 24, 27, 30, - 33, 35, 37, 39, 41, 43, 44, 45, 47, 49, 51, 53, - 55, 56, 59, 60, 62, 64, 65, 67, 69, 72, 73, 74, - 76, 78, 79, 81, 83, 84, 85, 87, 88, 90, 92, 94, - 96, 100, 104, 106, 109, 111, 115, 118, 121, 124, 126, 128, - 131, 133, 136, 139, 142, 144, 145, 147, 149, 151, 153, 155, - 158, 161, 163, 165, 167, 169, 171, 173, 176, 178, 180, 182, - 184, 186, 188, 190, 192, 194, 197, 200, 202, 204, 206, 208, - 210, 212, 214, 217, 220, 222, 224, 226, 228, 229, 230, 231, - 234, 237, 240, 243, 246, 249, 251, 254, 257, 260, 263, 265, - 267, 269, 271, 273, 274, 275, 277, 279, 281, 283, 285, 286, - 289, 290, 292, 294, 295, 297, 299, 302, 303, 304, 306, 308, - 309, 311, 313, 314, 315, 317, 318, 320, 322, 324, 326, 330, - 334, 336, 339, 341, 345, 348, 351, 354, 356, 358, 361, 363, - 366, 369, 372, 374, 375, 377, 379, 381, 383, 385, 388, 391, - 393, 395, 397, 399, 401, 403, 406, 408, 410, 412, 414, 416, - 418, 420, 422, 424, 427, 430, 432, 434, 436, 438, 440, 442, - 444, 447, 450, 452, 454, 456, 458, 459, -}; - -ASSERT_VM_INSTRUCTION_SIZE(rb_vm_insn_op_offset); -#endif - -const char * -insn_op_types(VALUE i) -{ - return &rb_vm_insn_op_base[rb_vm_insn_op_offset[i]]; -} - -int -insn_op_type(VALUE i, long j) -{ - if (j >= insn_len(i)) { - return 0; - } - else { - return insn_op_types(i)[j]; - } -} - -#line 10 "tool/ruby_vm/views/_leaf_helpers.erb" - -#include "iseq.h" - -// This is used to tell RJIT that this insn would be leaf if CHECK_INTS didn't exist. -// It should be used only when RUBY_VM_CHECK_INTS is directly written in insns.def. -static bool leafness_of_check_ints = false; - -static bool -leafness_of_defined(rb_num_t op_type) -{ - /* see also: vm_insnhelper.c:vm_defined() */ - switch (op_type) { - case DEFINED_IVAR: - case DEFINED_GVAR: - case DEFINED_CVAR: - case DEFINED_YIELD: - case DEFINED_REF: - case DEFINED_ZSUPER: - return false; - case DEFINED_CONST: - case DEFINED_CONST_FROM: - /* has rb_autoload_load(); */ - return false; - case DEFINED_FUNC: - case DEFINED_METHOD: - /* calls #respond_to_missing? */ - return false; - default: - rb_bug("unknown operand %ld: blame @shyouhei.", op_type); - } -} - -static bool -leafness_of_checkmatch(rb_num_t flag) -{ - /* see also: vm_insnhelper.c:check_match() */ - if (flag == VM_CHECKMATCH_TYPE_WHEN) { - return true; - } - else { - /* has rb_funcallv() */ - return false; - } -} -#line 503 "insns_info.inc" - -#line 10 "tool/ruby_vm/views/_sp_inc_helpers.erb" - -static rb_snum_t -sp_inc_of_sendish(const struct rb_callinfo *ci) -{ - /* Send-ish instructions will: - * - * 1. Pop block argument, if any. - * 2. Pop ordinal arguments. - * 3. Pop receiver. - * 4. Push return value. - */ - const int argb = (vm_ci_flag(ci) & VM_CALL_ARGS_BLOCKARG) ? 1 : 0; - const int argc = vm_ci_argc(ci); - const int recv = 1; - const int retn = 1; - - /* 1. 2. 3. 4. */ - return 0 - argb - argc - recv + retn; -} - -static rb_snum_t -sp_inc_of_invokeblock(const struct rb_callinfo *ci) -{ - /* sp_inc of invokeblock is almost identical to that of sendish - * instructions, except that it does not pop receiver. */ - return sp_inc_of_sendish(ci) + 1; -} -#line 533 "insns_info.inc" - -#ifndef RUBY_VM_EXEC_H -/* can't #include "vm_exec.h" here... */ -typedef long OFFSET; -typedef unsigned long lindex_t; -typedef VALUE GENTRY; -typedef rb_iseq_t *ISEQ; -#endif - -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_nop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_nop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_nop(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_nop(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putself(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putself(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putself(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putself(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_intern(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_intern(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_intern(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_intern(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newarraykwsplat(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_pop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_pop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_pop(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_pop(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_dup(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_dup(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_dup(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_dup(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_swap(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_swap(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_swap(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_swap(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_send(CALL_INFO ci, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_opt_send_without_block(CALL_INFO ci))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_newarray_send(rb_num_t num, ID method))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_invokesuper(CALL_INFO ci, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_invokeblock(CALL_INFO ci))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_leave(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_leave(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_leave(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_leave(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putobject_INT2FIX_1_(void))); - -/* attr enum ruby_vminsn_type bin @ nop()()() */ -enum ruby_vminsn_type -attr_bin_nop(void) -{ - return BIN(nop); -} - -/* attr bool handles_sp @ nop()()() */ -bool -attr_handles_sp_nop(void) -{ - return false; -} - -/* attr bool leaf @ nop()()() */ -bool -attr_leaf_nop(void) -{ - return true; -} - -/* attr const char* name @ nop()()() */ -const char* -attr_name_nop(void) -{ - return insn_name(BIN(nop)); -} - -/* attr rb_num_t open @ nop()()() */ -rb_num_t -attr_open_nop(void) -{ - return 0; -} - -/* attr rb_num_t popn @ nop()()() */ -rb_num_t -attr_popn_nop(void) -{ - return 0; -} - -/* attr rb_num_t retn @ nop()()() */ -rb_num_t -attr_retn_nop(void) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ nop()()() */ -rb_snum_t -attr_sp_inc_nop(void) -{ - return 0; -} - -/* attr rb_num_t width @ nop()()() */ -rb_num_t -attr_width_nop(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ getlocal(idx, level)()(val) */ -enum ruby_vminsn_type -attr_bin_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(getlocal); -} - -/* attr bool handles_sp @ getlocal(idx, level)()(val) */ -bool -attr_handles_sp_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ getlocal(idx, level)()(val) */ -bool -attr_leaf_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ getlocal(idx, level)()(val) */ -const char* -attr_name_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(getlocal)); -} - -/* attr rb_num_t open @ getlocal(idx, level)()(val) */ -rb_num_t -attr_open_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getlocal(idx, level)()(val) */ -rb_num_t -attr_popn_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getlocal(idx, level)()(val) */ -rb_num_t -attr_retn_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getlocal(idx, level)()(val) */ -rb_snum_t -attr_sp_inc_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t width @ getlocal(idx, level)()(val) */ -rb_num_t -attr_width_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setlocal(idx, level)(val)() */ -enum ruby_vminsn_type -attr_bin_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(setlocal); -} - -/* attr bool handles_sp @ setlocal(idx, level)(val)() */ -bool -attr_handles_sp_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ setlocal(idx, level)(val)() */ -bool -attr_leaf_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ setlocal(idx, level)(val)() */ -const char* -attr_name_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(setlocal)); -} - -/* attr rb_num_t open @ setlocal(idx, level)(val)() */ -rb_num_t -attr_open_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setlocal(idx, level)(val)() */ -rb_num_t -attr_popn_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setlocal(idx, level)(val)() */ -rb_num_t -attr_retn_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setlocal(idx, level)(val)() */ -rb_snum_t -attr_sp_inc_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return -1; -} - -/* attr rb_num_t width @ setlocal(idx, level)(val)() */ -rb_num_t -attr_width_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getblockparam(idx, level)()(val) */ -enum ruby_vminsn_type -attr_bin_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(getblockparam); -} - -/* attr bool handles_sp @ getblockparam(idx, level)()(val) */ -bool -attr_handles_sp_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ getblockparam(idx, level)()(val) */ -bool -attr_leaf_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ getblockparam(idx, level)()(val) */ -const char* -attr_name_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(getblockparam)); -} - -/* attr rb_num_t open @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_open_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_popn_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_retn_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getblockparam(idx, level)()(val) */ -rb_snum_t -attr_sp_inc_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t width @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_width_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setblockparam(idx, level)(val)() */ -enum ruby_vminsn_type -attr_bin_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(setblockparam); -} - -/* attr bool handles_sp @ setblockparam(idx, level)(val)() */ -bool -attr_handles_sp_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ setblockparam(idx, level)(val)() */ -bool -attr_leaf_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ setblockparam(idx, level)(val)() */ -const char* -attr_name_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(setblockparam)); -} - -/* attr rb_num_t open @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_open_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_popn_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_retn_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setblockparam(idx, level)(val)() */ -rb_snum_t -attr_sp_inc_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return -1; -} - -/* attr rb_num_t width @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_width_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getblockparamproxy(idx, level)()(val) */ -enum ruby_vminsn_type -attr_bin_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(getblockparamproxy); -} - -/* attr bool handles_sp @ getblockparamproxy(idx, level)()(val) */ -bool -attr_handles_sp_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ getblockparamproxy(idx, level)()(val) */ -bool -attr_leaf_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ getblockparamproxy(idx, level)()(val) */ -const char* -attr_name_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(getblockparamproxy)); -} - -/* attr rb_num_t open @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_open_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_popn_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_retn_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getblockparamproxy(idx, level)()(val) */ -rb_snum_t -attr_sp_inc_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t width @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_width_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getspecial(key, type)()(val) */ -enum ruby_vminsn_type -attr_bin_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return BIN(getspecial); -} - -/* attr bool handles_sp @ getspecial(key, type)()(val) */ -bool -attr_handles_sp_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return false; -} - -/* attr bool leaf @ getspecial(key, type)()(val) */ -bool -attr_leaf_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return -#line 192 "insns.def" -(type == 0) ? true : false; -#line 2046 "insns_info.inc" -} - -/* attr const char* name @ getspecial(key, type)()(val) */ -const char* -attr_name_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return insn_name(BIN(getspecial)); -} - -/* attr rb_num_t open @ getspecial(key, type)()(val) */ -rb_num_t -attr_open_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getspecial(key, type)()(val) */ -rb_num_t -attr_popn_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getspecial(key, type)()(val) */ -rb_num_t -attr_retn_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getspecial(key, type)()(val) */ -rb_snum_t -attr_sp_inc_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 1; -} - -/* attr rb_num_t width @ getspecial(key, type)()(val) */ -rb_num_t -attr_width_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setspecial(key)(obj)() */ -enum ruby_vminsn_type -attr_bin_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return BIN(setspecial); -} - -/* attr bool handles_sp @ setspecial(key)(obj)() */ -bool -attr_handles_sp_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return false; -} - -/* attr bool leaf @ setspecial(key)(obj)() */ -bool -attr_leaf_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return true; -} - -/* attr const char* name @ setspecial(key)(obj)() */ -const char* -attr_name_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return insn_name(BIN(setspecial)); -} - -/* attr rb_num_t open @ setspecial(key)(obj)() */ -rb_num_t -attr_open_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 1; -} - -/* attr rb_num_t popn @ setspecial(key)(obj)() */ -rb_num_t -attr_popn_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 1; -} - -/* attr rb_num_t retn @ setspecial(key)(obj)() */ -rb_num_t -attr_retn_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setspecial(key)(obj)() */ -rb_snum_t -attr_sp_inc_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return -1; -} - -/* attr rb_num_t width @ setspecial(key)(obj)() */ -rb_num_t -attr_width_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getinstancevariable(id, ic)()(val) */ -enum ruby_vminsn_type -attr_bin_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return BIN(getinstancevariable); -} - -/* attr bool handles_sp @ getinstancevariable(id, ic)()(val) */ -bool -attr_handles_sp_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return false; -} - -/* attr bool leaf @ getinstancevariable(id, ic)()(val) */ -bool -attr_leaf_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return -#line 214 "insns.def" -false; -#line 2202 "insns_info.inc" -} - -/* attr const char* name @ getinstancevariable(id, ic)()(val) */ -const char* -attr_name_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return insn_name(BIN(getinstancevariable)); -} - -/* attr rb_num_t open @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_open_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_popn_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_retn_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getinstancevariable(id, ic)()(val) */ -rb_snum_t -attr_sp_inc_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 1; -} - -/* attr rb_num_t width @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_width_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setinstancevariable(id, ic)(val)() */ -enum ruby_vminsn_type -attr_bin_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return BIN(setinstancevariable); -} - -/* attr bool handles_sp @ setinstancevariable(id, ic)(val)() */ -bool -attr_handles_sp_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return false; -} - -/* attr bool leaf @ setinstancevariable(id, ic)(val)() */ -bool -attr_leaf_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return -#line 225 "insns.def" -false; -#line 2295 "insns_info.inc" -} - -/* attr const char* name @ setinstancevariable(id, ic)(val)() */ -const char* -attr_name_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return insn_name(BIN(setinstancevariable)); -} - -/* attr rb_num_t open @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_open_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_popn_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_retn_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setinstancevariable(id, ic)(val)() */ -rb_snum_t -attr_sp_inc_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return -1; -} - -/* attr rb_num_t width @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_width_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getclassvariable(id, ic)()(val) */ -enum ruby_vminsn_type -attr_bin_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return BIN(getclassvariable); -} - -/* attr bool handles_sp @ getclassvariable(id, ic)()(val) */ -bool -attr_handles_sp_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return false; -} - -/* attr bool leaf @ getclassvariable(id, ic)()(val) */ -bool -attr_leaf_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return -#line 237 "insns.def" -false; -#line 2388 "insns_info.inc" -} - -/* attr const char* name @ getclassvariable(id, ic)()(val) */ -const char* -attr_name_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return insn_name(BIN(getclassvariable)); -} - -/* attr rb_num_t open @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_open_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_popn_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_retn_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getclassvariable(id, ic)()(val) */ -rb_snum_t -attr_sp_inc_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 1; -} - -/* attr rb_num_t width @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_width_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setclassvariable(id, ic)(val)() */ -enum ruby_vminsn_type -attr_bin_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return BIN(setclassvariable); -} - -/* attr bool handles_sp @ setclassvariable(id, ic)(val)() */ -bool -attr_handles_sp_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return false; -} - -/* attr bool leaf @ setclassvariable(id, ic)(val)() */ -bool -attr_leaf_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return -#line 250 "insns.def" -false; -#line 2481 "insns_info.inc" -} - -/* attr const char* name @ setclassvariable(id, ic)(val)() */ -const char* -attr_name_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return insn_name(BIN(setclassvariable)); -} - -/* attr rb_num_t open @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_open_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_popn_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_retn_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setclassvariable(id, ic)(val)() */ -rb_snum_t -attr_sp_inc_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return -1; -} - -/* attr rb_num_t width @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_width_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_getconstant_path(ic)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return BIN(opt_getconstant_path); -} - -/* attr bool handles_sp @ opt_getconstant_path(ic)()(val) */ -bool -attr_handles_sp_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return false; -} - -/* attr bool leaf @ opt_getconstant_path(ic)()(val) */ -bool -attr_leaf_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return -#line 261 "insns.def" -false; -#line 2565 "insns_info.inc" -} - -/* attr const char* name @ opt_getconstant_path(ic)()(val) */ -const char* -attr_name_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return insn_name(BIN(opt_getconstant_path)); -} - -/* attr rb_num_t open @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_open_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_popn_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_retn_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_getconstant_path(ic)()(val) */ -rb_snum_t -attr_sp_inc_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 1; -} - -/* attr rb_num_t width @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_width_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getconstant(id)(klass, allow_nil)(val) */ -enum ruby_vminsn_type -attr_bin_getconstant(MAYBE_UNUSED(ID id)) -{ - return BIN(getconstant); -} - -/* attr bool handles_sp @ getconstant(id)(klass, allow_nil)(val) */ -bool -attr_handles_sp_getconstant(MAYBE_UNUSED(ID id)) -{ - return false; -} - -/* attr bool leaf @ getconstant(id)(klass, allow_nil)(val) */ -bool -attr_leaf_getconstant(MAYBE_UNUSED(ID id)) -{ - return -#line 276 "insns.def" -false; -#line 2631 "insns_info.inc" -} - -/* attr const char* name @ getconstant(id)(klass, allow_nil)(val) */ -const char* -attr_name_getconstant(MAYBE_UNUSED(ID id)) -{ - return insn_name(BIN(getconstant)); -} - -/* attr rb_num_t open @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_open_getconstant(MAYBE_UNUSED(ID id)) -{ - return 1; -} - -/* attr rb_num_t popn @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_popn_getconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr rb_num_t retn @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_retn_getconstant(MAYBE_UNUSED(ID id)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getconstant(id)(klass, allow_nil)(val) */ -rb_snum_t -attr_sp_inc_getconstant(MAYBE_UNUSED(ID id)) -{ - return -1; -} - -/* attr rb_num_t width @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_width_getconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setconstant(id)(val, cbase)() */ -enum ruby_vminsn_type -attr_bin_setconstant(MAYBE_UNUSED(ID id)) -{ - return BIN(setconstant); -} - -/* attr bool handles_sp @ setconstant(id)(val, cbase)() */ -bool -attr_handles_sp_setconstant(MAYBE_UNUSED(ID id)) -{ - return false; -} - -/* attr bool leaf @ setconstant(id)(val, cbase)() */ -bool -attr_leaf_setconstant(MAYBE_UNUSED(ID id)) -{ - return -#line 292 "insns.def" -false; -#line 2697 "insns_info.inc" -} - -/* attr const char* name @ setconstant(id)(val, cbase)() */ -const char* -attr_name_setconstant(MAYBE_UNUSED(ID id)) -{ - return insn_name(BIN(setconstant)); -} - -/* attr rb_num_t open @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_open_setconstant(MAYBE_UNUSED(ID id)) -{ - return 1; -} - -/* attr rb_num_t popn @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_popn_setconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr rb_num_t retn @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_retn_setconstant(MAYBE_UNUSED(ID id)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setconstant(id)(val, cbase)() */ -rb_snum_t -attr_sp_inc_setconstant(MAYBE_UNUSED(ID id)) -{ - return -2; -} - -/* attr rb_num_t width @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_width_setconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getglobal(gid)()(val) */ -enum ruby_vminsn_type -attr_bin_getglobal(MAYBE_UNUSED(ID gid)) -{ - return BIN(getglobal); -} - -/* attr bool handles_sp @ getglobal(gid)()(val) */ -bool -attr_handles_sp_getglobal(MAYBE_UNUSED(ID gid)) -{ - return false; -} - -/* attr bool leaf @ getglobal(gid)()(val) */ -bool -attr_leaf_getglobal(MAYBE_UNUSED(ID gid)) -{ - return -#line 305 "insns.def" -false; -#line 2763 "insns_info.inc" -} - -/* attr const char* name @ getglobal(gid)()(val) */ -const char* -attr_name_getglobal(MAYBE_UNUSED(ID gid)) -{ - return insn_name(BIN(getglobal)); -} - -/* attr rb_num_t open @ getglobal(gid)()(val) */ -rb_num_t -attr_open_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t popn @ getglobal(gid)()(val) */ -rb_num_t -attr_popn_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 0; -} - -/* attr rb_num_t retn @ getglobal(gid)()(val) */ -rb_num_t -attr_retn_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getglobal(gid)()(val) */ -rb_snum_t -attr_sp_inc_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t width @ getglobal(gid)()(val) */ -rb_num_t -attr_width_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setglobal(gid)(val)() */ -enum ruby_vminsn_type -attr_bin_setglobal(MAYBE_UNUSED(ID gid)) -{ - return BIN(setglobal); -} - -/* attr bool handles_sp @ setglobal(gid)(val)() */ -bool -attr_handles_sp_setglobal(MAYBE_UNUSED(ID gid)) -{ - return false; -} - -/* attr bool leaf @ setglobal(gid)(val)() */ -bool -attr_leaf_setglobal(MAYBE_UNUSED(ID gid)) -{ - return -#line 316 "insns.def" -false; -#line 2829 "insns_info.inc" -} - -/* attr const char* name @ setglobal(gid)(val)() */ -const char* -attr_name_setglobal(MAYBE_UNUSED(ID gid)) -{ - return insn_name(BIN(setglobal)); -} - -/* attr rb_num_t open @ setglobal(gid)(val)() */ -rb_num_t -attr_open_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t popn @ setglobal(gid)(val)() */ -rb_num_t -attr_popn_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t retn @ setglobal(gid)(val)() */ -rb_num_t -attr_retn_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setglobal(gid)(val)() */ -rb_snum_t -attr_sp_inc_setglobal(MAYBE_UNUSED(ID gid)) -{ - return -1; -} - -/* attr rb_num_t width @ setglobal(gid)(val)() */ -rb_num_t -attr_width_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putnil()()(val) */ -enum ruby_vminsn_type -attr_bin_putnil(void) -{ - return BIN(putnil); -} - -/* attr bool handles_sp @ putnil()()(val) */ -bool -attr_handles_sp_putnil(void) -{ - return false; -} - -/* attr bool leaf @ putnil()()(val) */ -bool -attr_leaf_putnil(void) -{ - return true; -} - -/* attr const char* name @ putnil()()(val) */ -const char* -attr_name_putnil(void) -{ - return insn_name(BIN(putnil)); -} - -/* attr rb_num_t open @ putnil()()(val) */ -rb_num_t -attr_open_putnil(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putnil()()(val) */ -rb_num_t -attr_popn_putnil(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putnil()()(val) */ -rb_num_t -attr_retn_putnil(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putnil()()(val) */ -rb_snum_t -attr_sp_inc_putnil(void) -{ - return 1; -} - -/* attr rb_num_t width @ putnil()()(val) */ -rb_num_t -attr_width_putnil(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ putself()()(val) */ -enum ruby_vminsn_type -attr_bin_putself(void) -{ - return BIN(putself); -} - -/* attr bool handles_sp @ putself()()(val) */ -bool -attr_handles_sp_putself(void) -{ - return false; -} - -/* attr bool leaf @ putself()()(val) */ -bool -attr_leaf_putself(void) -{ - return true; -} - -/* attr const char* name @ putself()()(val) */ -const char* -attr_name_putself(void) -{ - return insn_name(BIN(putself)); -} - -/* attr rb_num_t open @ putself()()(val) */ -rb_num_t -attr_open_putself(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putself()()(val) */ -rb_num_t -attr_popn_putself(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putself()()(val) */ -rb_num_t -attr_retn_putself(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putself()()(val) */ -rb_snum_t -attr_sp_inc_putself(void) -{ - return 1; -} - -/* attr rb_num_t width @ putself()()(val) */ -rb_num_t -attr_width_putself(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ putobject(val)()(val) */ -enum ruby_vminsn_type -attr_bin_putobject(MAYBE_UNUSED(VALUE val)) -{ - return BIN(putobject); -} - -/* attr bool handles_sp @ putobject(val)()(val) */ -bool -attr_handles_sp_putobject(MAYBE_UNUSED(VALUE val)) -{ - return false; -} - -/* attr bool leaf @ putobject(val)()(val) */ -bool -attr_leaf_putobject(MAYBE_UNUSED(VALUE val)) -{ - return true; -} - -/* attr const char* name @ putobject(val)()(val) */ -const char* -attr_name_putobject(MAYBE_UNUSED(VALUE val)) -{ - return insn_name(BIN(putobject)); -} - -/* attr rb_num_t open @ putobject(val)()(val) */ -rb_num_t -attr_open_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 1; -} - -/* attr rb_num_t popn @ putobject(val)()(val) */ -rb_num_t -attr_popn_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 0; -} - -/* attr rb_num_t retn @ putobject(val)()(val) */ -rb_num_t -attr_retn_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putobject(val)()(val) */ -rb_snum_t -attr_sp_inc_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 1; -} - -/* attr rb_num_t width @ putobject(val)()(val) */ -rb_num_t -attr_width_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putspecialobject(value_type)()(val) */ -enum ruby_vminsn_type -attr_bin_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return BIN(putspecialobject); -} - -/* attr bool handles_sp @ putspecialobject(value_type)()(val) */ -bool -attr_handles_sp_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return false; -} - -/* attr bool leaf @ putspecialobject(value_type)()(val) */ -bool -attr_leaf_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return -#line 363 "insns.def" -(value_type == VM_SPECIAL_OBJECT_VMCORE); -#line 3084 "insns_info.inc" -} - -/* attr const char* name @ putspecialobject(value_type)()(val) */ -const char* -attr_name_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return insn_name(BIN(putspecialobject)); -} - -/* attr rb_num_t open @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_open_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 1; -} - -/* attr rb_num_t popn @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_popn_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 0; -} - -/* attr rb_num_t retn @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_retn_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putspecialobject(value_type)()(val) */ -rb_snum_t -attr_sp_inc_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 1; -} - -/* attr rb_num_t width @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_width_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putstring(str)()(val) */ -enum ruby_vminsn_type -attr_bin_putstring(MAYBE_UNUSED(VALUE str)) -{ - return BIN(putstring); -} - -/* attr bool handles_sp @ putstring(str)()(val) */ -bool -attr_handles_sp_putstring(MAYBE_UNUSED(VALUE str)) -{ - return false; -} - -/* attr bool leaf @ putstring(str)()(val) */ -bool -attr_leaf_putstring(MAYBE_UNUSED(VALUE str)) -{ - return true; -} - -/* attr const char* name @ putstring(str)()(val) */ -const char* -attr_name_putstring(MAYBE_UNUSED(VALUE str)) -{ - return insn_name(BIN(putstring)); -} - -/* attr rb_num_t open @ putstring(str)()(val) */ -rb_num_t -attr_open_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t popn @ putstring(str)()(val) */ -rb_num_t -attr_popn_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 0; -} - -/* attr rb_num_t retn @ putstring(str)()(val) */ -rb_num_t -attr_retn_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putstring(str)()(val) */ -rb_snum_t -attr_sp_inc_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t width @ putstring(str)()(val) */ -rb_num_t -attr_width_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putchilledstring(str)()(val) */ -enum ruby_vminsn_type -attr_bin_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return BIN(putchilledstring); -} - -/* attr bool handles_sp @ putchilledstring(str)()(val) */ -bool -attr_handles_sp_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return false; -} - -/* attr bool leaf @ putchilledstring(str)()(val) */ -bool -attr_leaf_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return true; -} - -/* attr const char* name @ putchilledstring(str)()(val) */ -const char* -attr_name_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return insn_name(BIN(putchilledstring)); -} - -/* attr rb_num_t open @ putchilledstring(str)()(val) */ -rb_num_t -attr_open_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t popn @ putchilledstring(str)()(val) */ -rb_num_t -attr_popn_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 0; -} - -/* attr rb_num_t retn @ putchilledstring(str)()(val) */ -rb_num_t -attr_retn_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putchilledstring(str)()(val) */ -rb_snum_t -attr_sp_inc_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t width @ putchilledstring(str)()(val) */ -rb_num_t -attr_width_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ concatstrings(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(concatstrings); -} - -/* attr bool handles_sp @ concatstrings(num)(...)(val) */ -bool -attr_handles_sp_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ concatstrings(num)(...)(val) */ -bool -attr_leaf_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 399 "insns.def" -false; -#line 3276 "insns_info.inc" -} - -/* attr const char* name @ concatstrings(num)(...)(val) */ -const char* -attr_name_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(concatstrings)); -} - -/* attr rb_num_t open @ concatstrings(num)(...)(val) */ -rb_num_t -attr_open_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ concatstrings(num)(...)(val) */ -rb_num_t -attr_popn_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ concatstrings(num)(...)(val) */ -rb_num_t -attr_retn_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ concatstrings(num)(...)(val) */ -rb_snum_t -attr_sp_inc_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 400 "insns.def" -1 - (rb_snum_t)num; -#line 3314 "insns_info.inc" -} - -/* attr rb_num_t width @ concatstrings(num)(...)(val) */ -rb_num_t -attr_width_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ anytostring()(val, str)(val) */ -enum ruby_vminsn_type -attr_bin_anytostring(void) -{ - return BIN(anytostring); -} - -/* attr bool handles_sp @ anytostring()(val, str)(val) */ -bool -attr_handles_sp_anytostring(void) -{ - return false; -} - -/* attr bool leaf @ anytostring()(val, str)(val) */ -bool -attr_leaf_anytostring(void) -{ - return true; -} - -/* attr const char* name @ anytostring()(val, str)(val) */ -const char* -attr_name_anytostring(void) -{ - return insn_name(BIN(anytostring)); -} - -/* attr rb_num_t open @ anytostring()(val, str)(val) */ -rb_num_t -attr_open_anytostring(void) -{ - return 0; -} - -/* attr rb_num_t popn @ anytostring()(val, str)(val) */ -rb_num_t -attr_popn_anytostring(void) -{ - return 2; -} - -/* attr rb_num_t retn @ anytostring()(val, str)(val) */ -rb_num_t -attr_retn_anytostring(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ anytostring()(val, str)(val) */ -rb_snum_t -attr_sp_inc_anytostring(void) -{ - return -1; -} - -/* attr rb_num_t width @ anytostring()(val, str)(val) */ -rb_num_t -attr_width_anytostring(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ toregexp(opt, cnt)(...)(val) */ -enum ruby_vminsn_type -attr_bin_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return BIN(toregexp); -} - -/* attr bool handles_sp @ toregexp(opt, cnt)(...)(val) */ -bool -attr_handles_sp_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return false; -} - -/* attr bool leaf @ toregexp(opt, cnt)(...)(val) */ -bool -attr_leaf_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return -#line 426 "insns.def" -false; -#line 3417 "insns_info.inc" -} - -/* attr const char* name @ toregexp(opt, cnt)(...)(val) */ -const char* -attr_name_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return insn_name(BIN(toregexp)); -} - -/* attr rb_num_t open @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_open_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 2; -} - -/* attr rb_num_t popn @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_popn_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 0; -} - -/* attr rb_num_t retn @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_retn_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ toregexp(opt, cnt)(...)(val) */ -rb_snum_t -attr_sp_inc_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return -#line 427 "insns.def" -1 - (rb_snum_t)cnt; -#line 3470 "insns_info.inc" -} - -/* attr rb_num_t width @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_width_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ intern()(str)(sym) */ -enum ruby_vminsn_type -attr_bin_intern(void) -{ - return BIN(intern); -} - -/* attr bool handles_sp @ intern()(str)(sym) */ -bool -attr_handles_sp_intern(void) -{ - return false; -} - -/* attr bool leaf @ intern()(str)(sym) */ -bool -attr_leaf_intern(void) -{ - return true; -} - -/* attr const char* name @ intern()(str)(sym) */ -const char* -attr_name_intern(void) -{ - return insn_name(BIN(intern)); -} - -/* attr rb_num_t open @ intern()(str)(sym) */ -rb_num_t -attr_open_intern(void) -{ - return 0; -} - -/* attr rb_num_t popn @ intern()(str)(sym) */ -rb_num_t -attr_popn_intern(void) -{ - return 1; -} - -/* attr rb_num_t retn @ intern()(str)(sym) */ -rb_num_t -attr_retn_intern(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ intern()(str)(sym) */ -rb_snum_t -attr_sp_inc_intern(void) -{ - return 0; -} - -/* attr rb_num_t width @ intern()(str)(sym) */ -rb_num_t -attr_width_intern(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ newarray(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(newarray); -} - -/* attr bool handles_sp @ newarray(num)(...)(val) */ -bool -attr_handles_sp_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ newarray(num)(...)(val) */ -bool -attr_leaf_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return true; -} - -/* attr const char* name @ newarray(num)(...)(val) */ -const char* -attr_name_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(newarray)); -} - -/* attr rb_num_t open @ newarray(num)(...)(val) */ -rb_num_t -attr_open_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ newarray(num)(...)(val) */ -rb_num_t -attr_popn_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ newarray(num)(...)(val) */ -rb_num_t -attr_retn_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newarray(num)(...)(val) */ -rb_snum_t -attr_sp_inc_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 450 "insns.def" -1 - (rb_snum_t)num; -#line 3602 "insns_info.inc" -} - -/* attr rb_num_t width @ newarray(num)(...)(val) */ -rb_num_t -attr_width_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ newarraykwsplat(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(newarraykwsplat); -} - -/* attr bool handles_sp @ newarraykwsplat(num)(...)(val) */ -bool -attr_handles_sp_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ newarraykwsplat(num)(...)(val) */ -bool -attr_leaf_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return true; -} - -/* attr const char* name @ newarraykwsplat(num)(...)(val) */ -const char* -attr_name_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(newarraykwsplat)); -} - -/* attr rb_num_t open @ newarraykwsplat(num)(...)(val) */ -rb_num_t -attr_open_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ newarraykwsplat(num)(...)(val) */ -rb_num_t -attr_popn_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ newarraykwsplat(num)(...)(val) */ -rb_num_t -attr_retn_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newarraykwsplat(num)(...)(val) */ -rb_snum_t -attr_sp_inc_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 465 "insns.def" -1 - (rb_snum_t)num; -#line 3668 "insns_info.inc" -} - -/* attr rb_num_t width @ newarraykwsplat(num)(...)(val) */ -rb_num_t -attr_width_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ pushtoarraykwsplat()(ary, hash)(ary) */ -enum ruby_vminsn_type -attr_bin_pushtoarraykwsplat(void) -{ - return BIN(pushtoarraykwsplat); -} - -/* attr bool handles_sp @ pushtoarraykwsplat()(ary, hash)(ary) */ -bool -attr_handles_sp_pushtoarraykwsplat(void) -{ - return false; -} - -/* attr bool leaf @ pushtoarraykwsplat()(ary, hash)(ary) */ -bool -attr_leaf_pushtoarraykwsplat(void) -{ - return true; -} - -/* attr const char* name @ pushtoarraykwsplat()(ary, hash)(ary) */ -const char* -attr_name_pushtoarraykwsplat(void) -{ - return insn_name(BIN(pushtoarraykwsplat)); -} - -/* attr rb_num_t open @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_open_pushtoarraykwsplat(void) -{ - return 0; -} - -/* attr rb_num_t popn @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_popn_pushtoarraykwsplat(void) -{ - return 2; -} - -/* attr rb_num_t retn @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_retn_pushtoarraykwsplat(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_snum_t -attr_sp_inc_pushtoarraykwsplat(void) -{ - return -1; -} - -/* attr rb_num_t width @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_width_pushtoarraykwsplat(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ duparray(ary)()(val) */ -enum ruby_vminsn_type -attr_bin_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return BIN(duparray); -} - -/* attr bool handles_sp @ duparray(ary)()(val) */ -bool -attr_handles_sp_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return false; -} - -/* attr bool leaf @ duparray(ary)()(val) */ -bool -attr_leaf_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return true; -} - -/* attr const char* name @ duparray(ary)()(val) */ -const char* -attr_name_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return insn_name(BIN(duparray)); -} - -/* attr rb_num_t open @ duparray(ary)()(val) */ -rb_num_t -attr_open_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 1; -} - -/* attr rb_num_t popn @ duparray(ary)()(val) */ -rb_num_t -attr_popn_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 0; -} - -/* attr rb_num_t retn @ duparray(ary)()(val) */ -rb_num_t -attr_retn_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ duparray(ary)()(val) */ -rb_snum_t -attr_sp_inc_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 1; -} - -/* attr rb_num_t width @ duparray(ary)()(val) */ -rb_num_t -attr_width_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ duphash(hash)()(val) */ -enum ruby_vminsn_type -attr_bin_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return BIN(duphash); -} - -/* attr bool handles_sp @ duphash(hash)()(val) */ -bool -attr_handles_sp_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return false; -} - -/* attr bool leaf @ duphash(hash)()(val) */ -bool -attr_leaf_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return true; -} - -/* attr const char* name @ duphash(hash)()(val) */ -const char* -attr_name_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return insn_name(BIN(duphash)); -} - -/* attr rb_num_t open @ duphash(hash)()(val) */ -rb_num_t -attr_open_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 1; -} - -/* attr rb_num_t popn @ duphash(hash)()(val) */ -rb_num_t -attr_popn_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 0; -} - -/* attr rb_num_t retn @ duphash(hash)()(val) */ -rb_num_t -attr_retn_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ duphash(hash)()(val) */ -rb_snum_t -attr_sp_inc_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 1; -} - -/* attr rb_num_t width @ duphash(hash)()(val) */ -rb_num_t -attr_width_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ expandarray(num, flag)(..., ary)(...) */ -enum ruby_vminsn_type -attr_bin_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return BIN(expandarray); -} - -/* attr bool handles_sp @ expandarray(num, flag)(..., ary)(...) */ -bool -attr_handles_sp_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return -#line 525 "insns.def" -true; -#line 3887 "insns_info.inc" -} - -/* attr bool leaf @ expandarray(num, flag)(..., ary)(...) */ -bool -attr_leaf_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return -#line 526 "insns.def" -false; -#line 3900 "insns_info.inc" -} - -/* attr const char* name @ expandarray(num, flag)(..., ary)(...) */ -const char* -attr_name_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return insn_name(BIN(expandarray)); -} - -/* attr rb_num_t open @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_open_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 2; -} - -/* attr rb_num_t popn @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_popn_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 1; -} - -/* attr rb_num_t retn @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_retn_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ expandarray(num, flag)(..., ary)(...) */ -rb_snum_t -attr_sp_inc_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return -#line 527 "insns.def" -(rb_snum_t)num - 1 + (flag & 1 ? 1 : 0); -#line 3953 "insns_info.inc" -} - -/* attr rb_num_t width @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_width_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ concatarray()(ary1, ary2)(ary) */ -enum ruby_vminsn_type -attr_bin_concatarray(void) -{ - return BIN(concatarray); -} - -/* attr bool handles_sp @ concatarray()(ary1, ary2)(ary) */ -bool -attr_handles_sp_concatarray(void) -{ - return false; -} - -/* attr bool leaf @ concatarray()(ary1, ary2)(ary) */ -bool -attr_leaf_concatarray(void) -{ - return -#line 540 "insns.def" -false; -#line 3987 "insns_info.inc" -} - -/* attr const char* name @ concatarray()(ary1, ary2)(ary) */ -const char* -attr_name_concatarray(void) -{ - return insn_name(BIN(concatarray)); -} - -/* attr rb_num_t open @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_open_concatarray(void) -{ - return 0; -} - -/* attr rb_num_t popn @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_popn_concatarray(void) -{ - return 2; -} - -/* attr rb_num_t retn @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_retn_concatarray(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ concatarray()(ary1, ary2)(ary) */ -rb_snum_t -attr_sp_inc_concatarray(void) -{ - return -1; -} - -/* attr rb_num_t width @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_width_concatarray(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ concattoarray()(ary1, ary2)(ary) */ -enum ruby_vminsn_type -attr_bin_concattoarray(void) -{ - return BIN(concattoarray); -} - -/* attr bool handles_sp @ concattoarray()(ary1, ary2)(ary) */ -bool -attr_handles_sp_concattoarray(void) -{ - return false; -} - -/* attr bool leaf @ concattoarray()(ary1, ary2)(ary) */ -bool -attr_leaf_concattoarray(void) -{ - return -#line 554 "insns.def" -false; -#line 4053 "insns_info.inc" -} - -/* attr const char* name @ concattoarray()(ary1, ary2)(ary) */ -const char* -attr_name_concattoarray(void) -{ - return insn_name(BIN(concattoarray)); -} - -/* attr rb_num_t open @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_open_concattoarray(void) -{ - return 0; -} - -/* attr rb_num_t popn @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_popn_concattoarray(void) -{ - return 2; -} - -/* attr rb_num_t retn @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_retn_concattoarray(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ concattoarray()(ary1, ary2)(ary) */ -rb_snum_t -attr_sp_inc_concattoarray(void) -{ - return -1; -} - -/* attr rb_num_t width @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_width_concattoarray(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ pushtoarray(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(pushtoarray); -} - -/* attr bool handles_sp @ pushtoarray(num)(...)(val) */ -bool -attr_handles_sp_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ pushtoarray(num)(...)(val) */ -bool -attr_leaf_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return true; -} - -/* attr const char* name @ pushtoarray(num)(...)(val) */ -const char* -attr_name_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(pushtoarray)); -} - -/* attr rb_num_t open @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_open_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_popn_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_retn_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ pushtoarray(num)(...)(val) */ -rb_snum_t -attr_sp_inc_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 565 "insns.def" --(rb_snum_t)num; -#line 4154 "insns_info.inc" -} - -/* attr rb_num_t width @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_width_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ splatarray(flag)(ary)(obj) */ -enum ruby_vminsn_type -attr_bin_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return BIN(splatarray); -} - -/* attr bool handles_sp @ splatarray(flag)(ary)(obj) */ -bool -attr_handles_sp_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return false; -} - -/* attr bool leaf @ splatarray(flag)(ary)(obj) */ -bool -attr_leaf_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return -#line 577 "insns.def" -false; -#line 4185 "insns_info.inc" -} - -/* attr const char* name @ splatarray(flag)(ary)(obj) */ -const char* -attr_name_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return insn_name(BIN(splatarray)); -} - -/* attr rb_num_t open @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_open_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 1; -} - -/* attr rb_num_t popn @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_popn_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 1; -} - -/* attr rb_num_t retn @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_retn_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ splatarray(flag)(ary)(obj) */ -rb_snum_t -attr_sp_inc_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 0; -} - -/* attr rb_num_t width @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_width_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ splatkw()(hash, block)(obj, block) */ -enum ruby_vminsn_type -attr_bin_splatkw(void) -{ - return BIN(splatkw); -} - -/* attr bool handles_sp @ splatkw()(hash, block)(obj, block) */ -bool -attr_handles_sp_splatkw(void) -{ - return false; -} - -/* attr bool leaf @ splatkw()(hash, block)(obj, block) */ -bool -attr_leaf_splatkw(void) -{ - return -#line 588 "insns.def" -false; -#line 4251 "insns_info.inc" -} - -/* attr const char* name @ splatkw()(hash, block)(obj, block) */ -const char* -attr_name_splatkw(void) -{ - return insn_name(BIN(splatkw)); -} - -/* attr rb_num_t open @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_open_splatkw(void) -{ - return 0; -} - -/* attr rb_num_t popn @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_popn_splatkw(void) -{ - return 2; -} - -/* attr rb_num_t retn @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_retn_splatkw(void) -{ - return 2; -} - -/* attr rb_snum_t sp_inc @ splatkw()(hash, block)(obj, block) */ -rb_snum_t -attr_sp_inc_splatkw(void) -{ - return 0; -} - -/* attr rb_num_t width @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_width_splatkw(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ newhash(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(newhash); -} - -/* attr bool handles_sp @ newhash(num)(...)(val) */ -bool -attr_handles_sp_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ newhash(num)(...)(val) */ -bool -attr_leaf_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 604 "insns.def" -false; -#line 4317 "insns_info.inc" -} - -/* attr const char* name @ newhash(num)(...)(val) */ -const char* -attr_name_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(newhash)); -} - -/* attr rb_num_t open @ newhash(num)(...)(val) */ -rb_num_t -attr_open_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ newhash(num)(...)(val) */ -rb_num_t -attr_popn_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ newhash(num)(...)(val) */ -rb_num_t -attr_retn_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newhash(num)(...)(val) */ -rb_snum_t -attr_sp_inc_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 605 "insns.def" -1 - (rb_snum_t)num; -#line 4355 "insns_info.inc" -} - -/* attr rb_num_t width @ newhash(num)(...)(val) */ -rb_num_t -attr_width_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ newrange(flag)(low, high)(val) */ -enum ruby_vminsn_type -attr_bin_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return BIN(newrange); -} - -/* attr bool handles_sp @ newrange(flag)(low, high)(val) */ -bool -attr_handles_sp_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return false; -} - -/* attr bool leaf @ newrange(flag)(low, high)(val) */ -bool -attr_leaf_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return -#line 625 "insns.def" -false; -#line 4386 "insns_info.inc" -} - -/* attr const char* name @ newrange(flag)(low, high)(val) */ -const char* -attr_name_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return insn_name(BIN(newrange)); -} - -/* attr rb_num_t open @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_open_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_num_t popn @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_popn_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr rb_num_t retn @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_retn_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newrange(flag)(low, high)(val) */ -rb_snum_t -attr_sp_inc_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return -1; -} - -/* attr rb_num_t width @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_width_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ pop()(val)() */ -enum ruby_vminsn_type -attr_bin_pop(void) -{ - return BIN(pop); -} - -/* attr bool handles_sp @ pop()(val)() */ -bool -attr_handles_sp_pop(void) -{ - return false; -} - -/* attr bool leaf @ pop()(val)() */ -bool -attr_leaf_pop(void) -{ - return true; -} - -/* attr const char* name @ pop()(val)() */ -const char* -attr_name_pop(void) -{ - return insn_name(BIN(pop)); -} - -/* attr rb_num_t open @ pop()(val)() */ -rb_num_t -attr_open_pop(void) -{ - return 0; -} - -/* attr rb_num_t popn @ pop()(val)() */ -rb_num_t -attr_popn_pop(void) -{ - return 1; -} - -/* attr rb_num_t retn @ pop()(val)() */ -rb_num_t -attr_retn_pop(void) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ pop()(val)() */ -rb_snum_t -attr_sp_inc_pop(void) -{ - return -1; -} - -/* attr rb_num_t width @ pop()(val)() */ -rb_num_t -attr_width_pop(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ dup()(val)(val1, val2) */ -enum ruby_vminsn_type -attr_bin_dup(void) -{ - return BIN(dup); -} - -/* attr bool handles_sp @ dup()(val)(val1, val2) */ -bool -attr_handles_sp_dup(void) -{ - return false; -} - -/* attr bool leaf @ dup()(val)(val1, val2) */ -bool -attr_leaf_dup(void) -{ - return true; -} - -/* attr const char* name @ dup()(val)(val1, val2) */ -const char* -attr_name_dup(void) -{ - return insn_name(BIN(dup)); -} - -/* attr rb_num_t open @ dup()(val)(val1, val2) */ -rb_num_t -attr_open_dup(void) -{ - return 0; -} - -/* attr rb_num_t popn @ dup()(val)(val1, val2) */ -rb_num_t -attr_popn_dup(void) -{ - return 1; -} - -/* attr rb_num_t retn @ dup()(val)(val1, val2) */ -rb_num_t -attr_retn_dup(void) -{ - return 2; -} - -/* attr rb_snum_t sp_inc @ dup()(val)(val1, val2) */ -rb_snum_t -attr_sp_inc_dup(void) -{ - return 1; -} - -/* attr rb_num_t width @ dup()(val)(val1, val2) */ -rb_num_t -attr_width_dup(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ dupn(n)(...)(...) */ -enum ruby_vminsn_type -attr_bin_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(dupn); -} - -/* attr bool handles_sp @ dupn(n)(...)(...) */ -bool -attr_handles_sp_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ dupn(n)(...)(...) */ -bool -attr_leaf_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ dupn(n)(...)(...) */ -const char* -attr_name_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(dupn)); -} - -/* attr rb_num_t open @ dupn(n)(...)(...) */ -rb_num_t -attr_open_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ dupn(n)(...)(...) */ -rb_num_t -attr_popn_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ dupn(n)(...)(...) */ -rb_num_t -attr_retn_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ dupn(n)(...)(...) */ -rb_snum_t -attr_sp_inc_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 661 "insns.def" -n; -#line 4613 "insns_info.inc" -} - -/* attr rb_num_t width @ dupn(n)(...)(...) */ -rb_num_t -attr_width_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ swap()(val, obj)(obj, val) */ -enum ruby_vminsn_type -attr_bin_swap(void) -{ - return BIN(swap); -} - -/* attr bool handles_sp @ swap()(val, obj)(obj, val) */ -bool -attr_handles_sp_swap(void) -{ - return false; -} - -/* attr bool leaf @ swap()(val, obj)(obj, val) */ -bool -attr_leaf_swap(void) -{ - return true; -} - -/* attr const char* name @ swap()(val, obj)(obj, val) */ -const char* -attr_name_swap(void) -{ - return insn_name(BIN(swap)); -} - -/* attr rb_num_t open @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_open_swap(void) -{ - return 0; -} - -/* attr rb_num_t popn @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_popn_swap(void) -{ - return 2; -} - -/* attr rb_num_t retn @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_retn_swap(void) -{ - return 2; -} - -/* attr rb_snum_t sp_inc @ swap()(val, obj)(obj, val) */ -rb_snum_t -attr_sp_inc_swap(void) -{ - return 0; -} - -/* attr rb_num_t width @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_width_swap(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ opt_reverse(n)(...)(...) */ -enum ruby_vminsn_type -attr_bin_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(opt_reverse); -} - -/* attr bool handles_sp @ opt_reverse(n)(...)(...) */ -bool -attr_handles_sp_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ opt_reverse(n)(...)(...) */ -bool -attr_leaf_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ opt_reverse(n)(...)(...) */ -const char* -attr_name_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(opt_reverse)); -} - -/* attr rb_num_t open @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_open_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_popn_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_retn_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ opt_reverse(n)(...)(...) */ -rb_snum_t -attr_sp_inc_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 685 "insns.def" -0; -#line 4742 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_width_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ topn(n)(...)(val) */ -enum ruby_vminsn_type -attr_bin_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(topn); -} - -/* attr bool handles_sp @ topn(n)(...)(val) */ -bool -attr_handles_sp_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ topn(n)(...)(val) */ -bool -attr_leaf_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ topn(n)(...)(val) */ -const char* -attr_name_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(topn)); -} - -/* attr rb_num_t open @ topn(n)(...)(val) */ -rb_num_t -attr_open_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ topn(n)(...)(val) */ -rb_num_t -attr_popn_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ topn(n)(...)(val) */ -rb_num_t -attr_retn_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ topn(n)(...)(val) */ -rb_snum_t -attr_sp_inc_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 715 "insns.def" -1; -#line 4808 "insns_info.inc" -} - -/* attr rb_num_t width @ topn(n)(...)(val) */ -rb_num_t -attr_width_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setn(n)(..., val)(val) */ -enum ruby_vminsn_type -attr_bin_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(setn); -} - -/* attr bool handles_sp @ setn(n)(..., val)(val) */ -bool -attr_handles_sp_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ setn(n)(..., val)(val) */ -bool -attr_leaf_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ setn(n)(..., val)(val) */ -const char* -attr_name_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(setn)); -} - -/* attr rb_num_t open @ setn(n)(..., val)(val) */ -rb_num_t -attr_open_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ setn(n)(..., val)(val) */ -rb_num_t -attr_popn_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t retn @ setn(n)(..., val)(val) */ -rb_num_t -attr_retn_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ setn(n)(..., val)(val) */ -rb_snum_t -attr_sp_inc_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 726 "insns.def" -0; -#line 4874 "insns_info.inc" -} - -/* attr rb_num_t width @ setn(n)(..., val)(val) */ -rb_num_t -attr_width_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ adjuststack(n)(...)(...) */ -enum ruby_vminsn_type -attr_bin_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(adjuststack); -} - -/* attr bool handles_sp @ adjuststack(n)(...)(...) */ -bool -attr_handles_sp_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ adjuststack(n)(...)(...) */ -bool -attr_leaf_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ adjuststack(n)(...)(...) */ -const char* -attr_name_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(adjuststack)); -} - -/* attr rb_num_t open @ adjuststack(n)(...)(...) */ -rb_num_t -attr_open_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ adjuststack(n)(...)(...) */ -rb_num_t -attr_popn_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ adjuststack(n)(...)(...) */ -rb_num_t -attr_retn_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ adjuststack(n)(...)(...) */ -rb_snum_t -attr_sp_inc_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 737 "insns.def" --(rb_snum_t)n; -#line 4940 "insns_info.inc" -} - -/* attr rb_num_t width @ adjuststack(n)(...)(...) */ -rb_num_t -attr_width_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ defined(op_type, obj, pushval)(v)(val) */ -enum ruby_vminsn_type -attr_bin_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return BIN(defined); -} - -/* attr bool handles_sp @ defined(op_type, obj, pushval)(v)(val) */ -bool -attr_handles_sp_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return false; -} - -/* attr bool leaf @ defined(op_type, obj, pushval)(v)(val) */ -bool -attr_leaf_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return -#line 752 "insns.def" -leafness_of_defined(op_type); -#line 4983 "insns_info.inc" -} - -/* attr const char* name @ defined(op_type, obj, pushval)(v)(val) */ -const char* -attr_name_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return insn_name(BIN(defined)); -} - -/* attr rb_num_t open @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_open_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 3; -} - -/* attr rb_num_t popn @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_popn_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_num_t retn @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_retn_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ defined(op_type, obj, pushval)(v)(val) */ -rb_snum_t -attr_sp_inc_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 0; -} - -/* attr rb_num_t width @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_width_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 4; -} - -/* attr enum ruby_vminsn_type bin @ definedivar(id, ic, pushval)()(val) */ -enum ruby_vminsn_type -attr_bin_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return BIN(definedivar); -} - -/* attr bool handles_sp @ definedivar(id, ic, pushval)()(val) */ -bool -attr_handles_sp_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return false; -} - -/* attr bool leaf @ definedivar(id, ic, pushval)()(val) */ -bool -attr_leaf_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return -#line 766 "insns.def" -false; -#line 5085 "insns_info.inc" -} - -/* attr const char* name @ definedivar(id, ic, pushval)()(val) */ -const char* -attr_name_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return insn_name(BIN(definedivar)); -} - -/* attr rb_num_t open @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_open_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 3; -} - -/* attr rb_num_t popn @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_popn_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 0; -} - -/* attr rb_num_t retn @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_retn_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ definedivar(id, ic, pushval)()(val) */ -rb_snum_t -attr_sp_inc_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_num_t width @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_width_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 4; -} - -/* attr enum ruby_vminsn_type bin @ checkmatch(flag)(target, pattern)(result) */ -enum ruby_vminsn_type -attr_bin_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return BIN(checkmatch); -} - -/* attr bool handles_sp @ checkmatch(flag)(target, pattern)(result) */ -bool -attr_handles_sp_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return false; -} - -/* attr bool leaf @ checkmatch(flag)(target, pattern)(result) */ -bool -attr_leaf_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return -#line 786 "insns.def" -leafness_of_checkmatch(flag); -#line 5175 "insns_info.inc" -} - -/* attr const char* name @ checkmatch(flag)(target, pattern)(result) */ -const char* -attr_name_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return insn_name(BIN(checkmatch)); -} - -/* attr rb_num_t open @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_open_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_num_t popn @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_popn_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr rb_num_t retn @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_retn_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ checkmatch(flag)(target, pattern)(result) */ -rb_snum_t -attr_sp_inc_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return -1; -} - -/* attr rb_num_t width @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_width_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -enum ruby_vminsn_type -attr_bin_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return BIN(checkkeyword); -} - -/* attr bool handles_sp @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -bool -attr_handles_sp_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return false; -} - -/* attr bool leaf @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -bool -attr_leaf_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return true; -} - -/* attr const char* name @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -const char* -attr_name_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return insn_name(BIN(checkkeyword)); -} - -/* attr rb_num_t open @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_open_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 2; -} - -/* attr rb_num_t popn @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_popn_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 0; -} - -/* attr rb_num_t retn @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_retn_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_snum_t -attr_sp_inc_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 1; -} - -/* attr rb_num_t width @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_width_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ checktype(type)(val)(ret) */ -enum ruby_vminsn_type -attr_bin_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return BIN(checktype); -} - -/* attr bool handles_sp @ checktype(type)(val)(ret) */ -bool -attr_handles_sp_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return false; -} - -/* attr bool leaf @ checktype(type)(val)(ret) */ -bool -attr_leaf_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return true; -} - -/* attr const char* name @ checktype(type)(val)(ret) */ -const char* -attr_name_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return insn_name(BIN(checktype)); -} - -/* attr rb_num_t open @ checktype(type)(val)(ret) */ -rb_num_t -attr_open_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 1; -} - -/* attr rb_num_t popn @ checktype(type)(val)(ret) */ -rb_num_t -attr_popn_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 1; -} - -/* attr rb_num_t retn @ checktype(type)(val)(ret) */ -rb_num_t -attr_retn_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ checktype(type)(val)(ret) */ -rb_snum_t -attr_sp_inc_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 0; -} - -/* attr rb_num_t width @ checktype(type)(val)(ret) */ -rb_num_t -attr_width_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -enum ruby_vminsn_type -attr_bin_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return BIN(defineclass); -} - -/* attr bool handles_sp @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -bool -attr_handles_sp_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return true; -} - -/* attr bool leaf @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -bool -attr_leaf_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return false; -} - -/* attr const char* name @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -const char* -attr_name_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return insn_name(BIN(defineclass)); -} - -/* attr rb_num_t open @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_open_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 3; -} - -/* attr rb_num_t popn @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_popn_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 2; -} - -/* attr rb_num_t retn @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_retn_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_snum_t -attr_sp_inc_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return -1; -} - -/* attr rb_num_t width @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_width_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 4; -} - -/* attr enum ruby_vminsn_type bin @ definemethod(id, iseq)()() */ -enum ruby_vminsn_type -attr_bin_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return BIN(definemethod); -} - -/* attr bool handles_sp @ definemethod(id, iseq)()() */ -bool -attr_handles_sp_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return true; -} - -/* attr bool leaf @ definemethod(id, iseq)()() */ -bool -attr_leaf_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return false; -} - -/* attr const char* name @ definemethod(id, iseq)()() */ -const char* -attr_name_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return insn_name(BIN(definemethod)); -} - -/* attr rb_num_t open @ definemethod(id, iseq)()() */ -rb_num_t -attr_open_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ definemethod(id, iseq)()() */ -rb_num_t -attr_popn_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ definemethod(id, iseq)()() */ -rb_num_t -attr_retn_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ definemethod(id, iseq)()() */ -rb_snum_t -attr_sp_inc_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_num_t width @ definemethod(id, iseq)()() */ -rb_num_t -attr_width_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ definesmethod(id, iseq)(obj)() */ -enum ruby_vminsn_type -attr_bin_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return BIN(definesmethod); -} - -/* attr bool handles_sp @ definesmethod(id, iseq)(obj)() */ -bool -attr_handles_sp_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return true; -} - -/* attr bool leaf @ definesmethod(id, iseq)(obj)() */ -bool -attr_leaf_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return false; -} - -/* attr const char* name @ definesmethod(id, iseq)(obj)() */ -const char* -attr_name_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return insn_name(BIN(definesmethod)); -} - -/* attr rb_num_t open @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_open_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_popn_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 1; -} - -/* attr rb_num_t retn @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_retn_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ definesmethod(id, iseq)(obj)() */ -rb_snum_t -attr_sp_inc_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return -1; -} - -/* attr rb_num_t width @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_width_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ send(cd, blockiseq)(...)(val) */ -enum ruby_vminsn_type -attr_bin_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return BIN(send); -} - -/* attr rb_snum_t comptime_sp_inc @ send(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_send( - MAYBE_UNUSED(CALL_INFO ci), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 868 "insns.def" -sp_inc_of_sendish(ci); -#line 5672 "insns_info.inc" -} - -/* attr bool handles_sp @ send(cd, blockiseq)(...)(val) */ -bool -attr_handles_sp_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return true; -} - -/* attr bool leaf @ send(cd, blockiseq)(...)(val) */ -bool -attr_leaf_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return false; -} - -/* attr const char* name @ send(cd, blockiseq)(...)(val) */ -const char* -attr_name_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return insn_name(BIN(send)); -} - -/* attr rb_num_t open @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_open_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_popn_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_retn_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ send(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_sp_inc_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 867 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 5745 "insns_info.inc" -} - -/* attr rb_num_t width @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_width_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_send_without_block(cd)(...)(val) */ -enum ruby_vminsn_type -attr_bin_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_send_without_block); -} - -/* attr rb_snum_t comptime_sp_inc @ opt_send_without_block(cd)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_opt_send_without_block(MAYBE_UNUSED(CALL_INFO ci)) -{ - return -#line 888 "insns.def" -sp_inc_of_sendish(ci); -#line 5772 "insns_info.inc" -} - -/* attr bool handles_sp @ opt_send_without_block(cd)(...)(val) */ -bool -attr_handles_sp_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 886 "insns.def" -true; -#line 5782 "insns_info.inc" -} - -/* attr bool leaf @ opt_send_without_block(cd)(...)(val) */ -bool -attr_leaf_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return ! attr_handles_sp_opt_send_without_block(cd); -} - -/* attr const char* name @ opt_send_without_block(cd)(...)(val) */ -const char* -attr_name_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_send_without_block)); -} - -/* attr rb_num_t open @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_open_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_popn_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_retn_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_send_without_block(cd)(...)(val) */ -rb_snum_t -attr_sp_inc_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 887 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 5827 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_width_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ objtostring(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(objtostring); -} - -/* attr bool handles_sp @ objtostring(cd)(recv)(val) */ -bool -attr_handles_sp_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ objtostring(cd)(recv)(val) */ -bool -attr_leaf_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 906 "insns.def" -false; -#line 5858 "insns_info.inc" -} - -/* attr const char* name @ objtostring(cd)(recv)(val) */ -const char* -attr_name_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(objtostring)); -} - -/* attr rb_num_t open @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_open_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_popn_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_retn_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ objtostring(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_width_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_str_freeze(str, cd)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_str_freeze); -} - -/* attr bool handles_sp @ opt_str_freeze(str, cd)()(val) */ -bool -attr_handles_sp_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_str_freeze(str, cd)()(val) */ -bool -attr_leaf_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_str_freeze(str, cd)()(val) */ -const char* -attr_name_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_str_freeze)); -} - -/* attr rb_num_t open @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_open_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_popn_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_retn_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_str_freeze(str, cd)()(val) */ -rb_snum_t -attr_sp_inc_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_width_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_nil_p(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_nil_p); -} - -/* attr bool handles_sp @ opt_nil_p(cd)(recv)(val) */ -bool -attr_handles_sp_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_nil_p(cd)(recv)(val) */ -bool -attr_leaf_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_nil_p(cd)(recv)(val) */ -const char* -attr_name_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_nil_p)); -} - -/* attr rb_num_t open @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_open_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_nil_p(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_width_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_str_uminus(str, cd)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_str_uminus); -} - -/* attr bool handles_sp @ opt_str_uminus(str, cd)()(val) */ -bool -attr_handles_sp_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_str_uminus(str, cd)()(val) */ -bool -attr_leaf_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_str_uminus(str, cd)()(val) */ -const char* -attr_name_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_str_uminus)); -} - -/* attr rb_num_t open @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_open_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_popn_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_retn_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_str_uminus(str, cd)()(val) */ -rb_snum_t -attr_sp_inc_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_width_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_newarray_send(num, method)(...)(val) */ -enum ruby_vminsn_type -attr_bin_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return BIN(opt_newarray_send); -} - -/* attr rb_snum_t comptime_sp_inc @ opt_newarray_send(num, method)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return -#line 968 "insns.def" -1 - (rb_snum_t)num; -#line 6166 "insns_info.inc" -} - -/* attr bool handles_sp @ opt_newarray_send(num, method)(...)(val) */ -bool -attr_handles_sp_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return false; -} - -/* attr bool leaf @ opt_newarray_send(num, method)(...)(val) */ -bool -attr_leaf_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return -#line 966 "insns.def" -false; -#line 6189 "insns_info.inc" -} - -/* attr const char* name @ opt_newarray_send(num, method)(...)(val) */ -const char* -attr_name_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return insn_name(BIN(opt_newarray_send)); -} - -/* attr rb_num_t open @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_open_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_popn_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_retn_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_newarray_send(num, method)(...)(val) */ -rb_snum_t -attr_sp_inc_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return -#line 967 "insns.def" -1 - (rb_snum_t)num; -#line 6242 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_width_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(ID method) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ invokesuper(cd, blockiseq)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return BIN(invokesuper); -} - -/* attr rb_snum_t comptime_sp_inc @ invokesuper(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_invokesuper( - MAYBE_UNUSED(CALL_INFO ci), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 992 "insns.def" -sp_inc_of_sendish(ci); -#line 6275 "insns_info.inc" -} - -/* attr bool handles_sp @ invokesuper(cd, blockiseq)(...)(val) */ -bool -attr_handles_sp_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return true; -} - -/* attr bool leaf @ invokesuper(cd, blockiseq)(...)(val) */ -bool -attr_leaf_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return false; -} - -/* attr const char* name @ invokesuper(cd, blockiseq)(...)(val) */ -const char* -attr_name_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return insn_name(BIN(invokesuper)); -} - -/* attr rb_num_t open @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_open_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_popn_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_retn_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokesuper(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_sp_inc_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 991 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 6348 "insns_info.inc" -} - -/* attr rb_num_t width @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_width_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ invokeblock(cd)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(invokeblock); -} - -/* attr rb_snum_t comptime_sp_inc @ invokeblock(cd)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_invokeblock(MAYBE_UNUSED(CALL_INFO ci)) -{ - return -#line 1012 "insns.def" -sp_inc_of_invokeblock(ci); -#line 6375 "insns_info.inc" -} - -/* attr bool handles_sp @ invokeblock(cd)(...)(val) */ -bool -attr_handles_sp_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1010 "insns.def" -true; -#line 6385 "insns_info.inc" -} - -/* attr bool leaf @ invokeblock(cd)(...)(val) */ -bool -attr_leaf_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return ! attr_handles_sp_invokeblock(cd); -} - -/* attr const char* name @ invokeblock(cd)(...)(val) */ -const char* -attr_name_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(invokeblock)); -} - -/* attr rb_num_t open @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_open_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_popn_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t retn @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_retn_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokeblock(cd)(...)(val) */ -rb_snum_t -attr_sp_inc_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1011 "insns.def" -sp_inc_of_invokeblock(cd->ci); -#line 6430 "insns_info.inc" -} - -/* attr rb_num_t width @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_width_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ leave()(val)(val) */ -enum ruby_vminsn_type -attr_bin_leave(void) -{ - return BIN(leave); -} - -/* attr bool handles_sp @ leave()(val)(val) */ -bool -attr_handles_sp_leave(void) -{ - return -#line 1034 "insns.def" -true; -#line 6454 "insns_info.inc" -} - -/* attr bool leaf @ leave()(val)(val) */ -bool -attr_leaf_leave(void) -{ - return -#line 1033 "insns.def" -false; -#line 6464 "insns_info.inc" -} - -/* attr const char* name @ leave()(val)(val) */ -const char* -attr_name_leave(void) -{ - return insn_name(BIN(leave)); -} - -/* attr rb_num_t open @ leave()(val)(val) */ -rb_num_t -attr_open_leave(void) -{ - return 0; -} - -/* attr rb_num_t popn @ leave()(val)(val) */ -rb_num_t -attr_popn_leave(void) -{ - return 1; -} - -/* attr rb_num_t retn @ leave()(val)(val) */ -rb_num_t -attr_retn_leave(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ leave()(val)(val) */ -rb_snum_t -attr_sp_inc_leave(void) -{ - return 0; -} - -/* attr rb_num_t width @ leave()(val)(val) */ -rb_num_t -attr_width_leave(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ throw(throw_state)(throwobj)(val) */ -enum ruby_vminsn_type -attr_bin_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return BIN(throw); -} - -/* attr bool handles_sp @ throw(throw_state)(throwobj)(val) */ -bool -attr_handles_sp_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return false; -} - -/* attr bool leaf @ throw(throw_state)(throwobj)(val) */ -bool -attr_leaf_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return -#line 1067 "insns.def" -false; -#line 6530 "insns_info.inc" -} - -/* attr const char* name @ throw(throw_state)(throwobj)(val) */ -const char* -attr_name_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return insn_name(BIN(throw)); -} - -/* attr rb_num_t open @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_open_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 1; -} - -/* attr rb_num_t popn @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_popn_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 1; -} - -/* attr rb_num_t retn @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_retn_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ throw(throw_state)(throwobj)(val) */ -rb_snum_t -attr_sp_inc_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 0; -} - -/* attr rb_num_t width @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_width_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ jump(dst)()() */ -enum ruby_vminsn_type -attr_bin_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(jump); -} - -/* attr bool handles_sp @ jump(dst)()() */ -bool -attr_handles_sp_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ jump(dst)()() */ -bool -attr_leaf_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1085 "insns.def" -leafness_of_check_ints; -#line 6596 "insns_info.inc" -} - -/* attr const char* name @ jump(dst)()() */ -const char* -attr_name_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(jump)); -} - -/* attr rb_num_t open @ jump(dst)()() */ -rb_num_t -attr_open_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ jump(dst)()() */ -rb_num_t -attr_popn_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_num_t retn @ jump(dst)()() */ -rb_num_t -attr_retn_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ jump(dst)()() */ -rb_snum_t -attr_sp_inc_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_num_t width @ jump(dst)()() */ -rb_num_t -attr_width_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ branchif(dst)(val)() */ -enum ruby_vminsn_type -attr_bin_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(branchif); -} - -/* attr bool handles_sp @ branchif(dst)(val)() */ -bool -attr_handles_sp_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ branchif(dst)(val)() */ -bool -attr_leaf_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1098 "insns.def" -leafness_of_check_ints; -#line 6662 "insns_info.inc" -} - -/* attr const char* name @ branchif(dst)(val)() */ -const char* -attr_name_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(branchif)); -} - -/* attr rb_num_t open @ branchif(dst)(val)() */ -rb_num_t -attr_open_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ branchif(dst)(val)() */ -rb_num_t -attr_popn_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t retn @ branchif(dst)(val)() */ -rb_num_t -attr_retn_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ branchif(dst)(val)() */ -rb_snum_t -attr_sp_inc_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return -1; -} - -/* attr rb_num_t width @ branchif(dst)(val)() */ -rb_num_t -attr_width_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ branchunless(dst)(val)() */ -enum ruby_vminsn_type -attr_bin_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(branchunless); -} - -/* attr bool handles_sp @ branchunless(dst)(val)() */ -bool -attr_handles_sp_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ branchunless(dst)(val)() */ -bool -attr_leaf_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1113 "insns.def" -leafness_of_check_ints; -#line 6728 "insns_info.inc" -} - -/* attr const char* name @ branchunless(dst)(val)() */ -const char* -attr_name_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(branchunless)); -} - -/* attr rb_num_t open @ branchunless(dst)(val)() */ -rb_num_t -attr_open_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ branchunless(dst)(val)() */ -rb_num_t -attr_popn_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t retn @ branchunless(dst)(val)() */ -rb_num_t -attr_retn_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ branchunless(dst)(val)() */ -rb_snum_t -attr_sp_inc_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return -1; -} - -/* attr rb_num_t width @ branchunless(dst)(val)() */ -rb_num_t -attr_width_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ branchnil(dst)(val)() */ -enum ruby_vminsn_type -attr_bin_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(branchnil); -} - -/* attr bool handles_sp @ branchnil(dst)(val)() */ -bool -attr_handles_sp_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ branchnil(dst)(val)() */ -bool -attr_leaf_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1128 "insns.def" -leafness_of_check_ints; -#line 6794 "insns_info.inc" -} - -/* attr const char* name @ branchnil(dst)(val)() */ -const char* -attr_name_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(branchnil)); -} - -/* attr rb_num_t open @ branchnil(dst)(val)() */ -rb_num_t -attr_open_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ branchnil(dst)(val)() */ -rb_num_t -attr_popn_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t retn @ branchnil(dst)(val)() */ -rb_num_t -attr_retn_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ branchnil(dst)(val)() */ -rb_snum_t -attr_sp_inc_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return -1; -} - -/* attr rb_num_t width @ branchnil(dst)(val)() */ -rb_num_t -attr_width_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ once(iseq, ise)()(val) */ -enum ruby_vminsn_type -attr_bin_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return BIN(once); -} - -/* attr bool handles_sp @ once(iseq, ise)()(val) */ -bool -attr_handles_sp_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return true; -} - -/* attr bool leaf @ once(iseq, ise)()(val) */ -bool -attr_leaf_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return false; -} - -/* attr const char* name @ once(iseq, ise)()(val) */ -const char* -attr_name_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return insn_name(BIN(once)); -} - -/* attr rb_num_t open @ once(iseq, ise)()(val) */ -rb_num_t -attr_open_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 2; -} - -/* attr rb_num_t popn @ once(iseq, ise)()(val) */ -rb_num_t -attr_popn_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 0; -} - -/* attr rb_num_t retn @ once(iseq, ise)()(val) */ -rb_num_t -attr_retn_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ once(iseq, ise)()(val) */ -rb_snum_t -attr_sp_inc_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 1; -} - -/* attr rb_num_t width @ once(iseq, ise)()(val) */ -rb_num_t -attr_width_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_case_dispatch(hash, else_offset)(..., key)() */ -enum ruby_vminsn_type -attr_bin_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return BIN(opt_case_dispatch); -} - -/* attr bool handles_sp @ opt_case_dispatch(hash, else_offset)(..., key)() */ -bool -attr_handles_sp_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return false; -} - -/* attr bool leaf @ opt_case_dispatch(hash, else_offset)(..., key)() */ -bool -attr_leaf_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return true; -} - -/* attr const char* name @ opt_case_dispatch(hash, else_offset)(..., key)() */ -const char* -attr_name_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return insn_name(BIN(opt_case_dispatch)); -} - -/* attr rb_num_t open @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_open_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_popn_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_retn_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_snum_t -attr_sp_inc_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return -#line 1156 "insns.def" --1; -#line 7009 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_width_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_plus(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_plus); -} - -/* attr bool handles_sp @ opt_plus(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_plus(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_plus(cd)(recv, obj)(val) */ -const char* -attr_name_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_plus)); -} - -/* attr rb_num_t open @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_plus(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_minus(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_minus); -} - -/* attr bool handles_sp @ opt_minus(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_minus(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_minus(cd)(recv, obj)(val) */ -const char* -attr_name_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_minus)); -} - -/* attr rb_num_t open @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_minus(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_mult(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_mult); -} - -/* attr bool handles_sp @ opt_mult(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_mult(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_mult(cd)(recv, obj)(val) */ -const char* -attr_name_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_mult)); -} - -/* attr rb_num_t open @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_mult(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_div(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_div); -} - -/* attr bool handles_sp @ opt_div(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_div(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1217 "insns.def" -false; -#line 7232 "insns_info.inc" -} - -/* attr const char* name @ opt_div(cd)(recv, obj)(val) */ -const char* -attr_name_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_div)); -} - -/* attr rb_num_t open @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_div(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_mod(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_mod); -} - -/* attr bool handles_sp @ opt_mod(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_mod(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1233 "insns.def" -false; -#line 7298 "insns_info.inc" -} - -/* attr const char* name @ opt_mod(cd)(recv, obj)(val) */ -const char* -attr_name_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_mod)); -} - -/* attr rb_num_t open @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_mod(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_eq(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_eq); -} - -/* attr bool handles_sp @ opt_eq(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_eq(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_eq(cd)(recv, obj)(val) */ -const char* -attr_name_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_eq)); -} - -/* attr rb_num_t open @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_eq(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_neq); -} - -/* attr bool handles_sp @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -bool -attr_leaf_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -const char* -attr_name_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_neq)); -} - -/* attr rb_num_t open @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -1; -} - -/* attr rb_num_t width @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_lt(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_lt); -} - -/* attr bool handles_sp @ opt_lt(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_lt(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_lt(cd)(recv, obj)(val) */ -const char* -attr_name_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_lt)); -} - -/* attr rb_num_t open @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_lt(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_le(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_le); -} - -/* attr bool handles_sp @ opt_le(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_le(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_le(cd)(recv, obj)(val) */ -const char* -attr_name_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_le)); -} - -/* attr rb_num_t open @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_le(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_gt(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_gt); -} - -/* attr bool handles_sp @ opt_gt(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_gt(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_gt(cd)(recv, obj)(val) */ -const char* -attr_name_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_gt)); -} - -/* attr rb_num_t open @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_gt(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_ge(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_ge); -} - -/* attr bool handles_sp @ opt_ge(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_ge(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_ge(cd)(recv, obj)(val) */ -const char* -attr_name_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_ge)); -} - -/* attr rb_num_t open @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_ge(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_ltlt(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_ltlt); -} - -/* attr bool handles_sp @ opt_ltlt(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_ltlt(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1335 "insns.def" -false; -#line 7769 "insns_info.inc" -} - -/* attr const char* name @ opt_ltlt(cd)(recv, obj)(val) */ -const char* -attr_name_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_ltlt)); -} - -/* attr rb_num_t open @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_ltlt(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_and(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_and); -} - -/* attr bool handles_sp @ opt_and(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_and(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_and(cd)(recv, obj)(val) */ -const char* -attr_name_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_and)); -} - -/* attr rb_num_t open @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_and(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_or(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_or); -} - -/* attr bool handles_sp @ opt_or(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_or(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_or(cd)(recv, obj)(val) */ -const char* -attr_name_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_or)); -} - -/* attr rb_num_t open @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_or(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_aref(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_aref); -} - -/* attr bool handles_sp @ opt_aref(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_aref(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1382 "insns.def" -false; -#line 7961 "insns_info.inc" -} - -/* attr const char* name @ opt_aref(cd)(recv, obj)(val) */ -const char* -attr_name_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_aref)); -} - -/* attr rb_num_t open @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aref(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_aset(cd)(recv, obj, set)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_aset); -} - -/* attr bool handles_sp @ opt_aset(cd)(recv, obj, set)(val) */ -bool -attr_handles_sp_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_aset(cd)(recv, obj, set)(val) */ -bool -attr_leaf_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1399 "insns.def" -false; -#line 8027 "insns_info.inc" -} - -/* attr const char* name @ opt_aset(cd)(recv, obj, set)(val) */ -const char* -attr_name_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_aset)); -} - -/* attr rb_num_t open @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_open_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_popn_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 3; -} - -/* attr rb_num_t retn @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_retn_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aset(cd)(recv, obj, set)(val) */ -rb_snum_t -attr_sp_inc_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -2; -} - -/* attr rb_num_t width @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_width_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_aset_with(key, cd)(recv, val)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_aset_with); -} - -/* attr bool handles_sp @ opt_aset_with(key, cd)(recv, val)(val) */ -bool -attr_handles_sp_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_aset_with(key, cd)(recv, val)(val) */ -bool -attr_leaf_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -#line 1415 "insns.def" -false; -#line 8102 "insns_info.inc" -} - -/* attr const char* name @ opt_aset_with(key, cd)(recv, val)(val) */ -const char* -attr_name_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_aset_with)); -} - -/* attr rb_num_t open @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_open_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_popn_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_retn_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_snum_t -attr_sp_inc_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -1; -} - -/* attr rb_num_t width @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_width_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_aref_with(key, cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_aref_with); -} - -/* attr bool handles_sp @ opt_aref_with(key, cd)(recv)(val) */ -bool -attr_handles_sp_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_aref_with(key, cd)(recv)(val) */ -bool -attr_leaf_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -#line 1436 "insns.def" -false; -#line 8195 "insns_info.inc" -} - -/* attr const char* name @ opt_aref_with(key, cd)(recv)(val) */ -const char* -attr_name_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_aref_with)); -} - -/* attr rb_num_t open @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_open_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_popn_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_retn_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aref_with(key, cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t width @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_width_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_length(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_length); -} - -/* attr bool handles_sp @ opt_length(cd)(recv)(val) */ -bool -attr_handles_sp_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_length(cd)(recv)(val) */ -bool -attr_leaf_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_length(cd)(recv)(val) */ -const char* -attr_name_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_length)); -} - -/* attr rb_num_t open @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_open_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_length(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_width_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_size(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_size); -} - -/* attr bool handles_sp @ opt_size(cd)(recv)(val) */ -bool -attr_handles_sp_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_size(cd)(recv)(val) */ -bool -attr_leaf_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_size(cd)(recv)(val) */ -const char* -attr_name_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_size)); -} - -/* attr rb_num_t open @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_open_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_size(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_width_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_empty_p(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_empty_p); -} - -/* attr bool handles_sp @ opt_empty_p(cd)(recv)(val) */ -bool -attr_handles_sp_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_empty_p(cd)(recv)(val) */ -bool -attr_leaf_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_empty_p(cd)(recv)(val) */ -const char* -attr_name_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_empty_p)); -} - -/* attr rb_num_t open @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_open_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_empty_p(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_width_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_succ(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_succ); -} - -/* attr bool handles_sp @ opt_succ(cd)(recv)(val) */ -bool -attr_handles_sp_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_succ(cd)(recv)(val) */ -bool -attr_leaf_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_succ(cd)(recv)(val) */ -const char* -attr_name_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_succ)); -} - -/* attr rb_num_t open @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_open_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_succ(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_width_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_not(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_not); -} - -/* attr bool handles_sp @ opt_not(cd)(recv)(val) */ -bool -attr_handles_sp_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_not(cd)(recv)(val) */ -bool -attr_leaf_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_not(cd)(recv)(val) */ -const char* -attr_name_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_not)); -} - -/* attr rb_num_t open @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_open_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_not(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_width_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -enum ruby_vminsn_type -attr_bin_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_regexpmatch2); -} - -/* attr bool handles_sp @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -bool -attr_handles_sp_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -bool -attr_leaf_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1522 "insns.def" -false; -#line 8594 "insns_info.inc" -} - -/* attr const char* name @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -const char* -attr_name_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_regexpmatch2)); -} - -/* attr rb_num_t open @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_open_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_popn_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_retn_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_snum_t -attr_sp_inc_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_width_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ invokebuiltin(bf)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return BIN(invokebuiltin); -} - -/* attr bool handles_sp @ invokebuiltin(bf)(...)(val) */ -bool -attr_handles_sp_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return false; -} - -/* attr bool leaf @ invokebuiltin(bf)(...)(val) */ -bool -attr_leaf_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return -#line 1537 "insns.def" -false; -#line 8660 "insns_info.inc" -} - -/* attr const char* name @ invokebuiltin(bf)(...)(val) */ -const char* -attr_name_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return insn_name(BIN(invokebuiltin)); -} - -/* attr rb_num_t open @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_open_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 1; -} - -/* attr rb_num_t popn @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_popn_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 0; -} - -/* attr rb_num_t retn @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_retn_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokebuiltin(bf)(...)(val) */ -rb_snum_t -attr_sp_inc_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return -#line 1538 "insns.def" -1 - bf->argc; -#line 8698 "insns_info.inc" -} - -/* attr rb_num_t width @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_width_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_invokebuiltin_delegate(bf, index)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return BIN(opt_invokebuiltin_delegate); -} - -/* attr bool handles_sp @ opt_invokebuiltin_delegate(bf, index)()(val) */ -bool -attr_handles_sp_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return false; -} - -/* attr bool leaf @ opt_invokebuiltin_delegate(bf, index)()(val) */ -bool -attr_leaf_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return -#line 1549 "insns.def" -false; -#line 8738 "insns_info.inc" -} - -/* attr const char* name @ opt_invokebuiltin_delegate(bf, index)()(val) */ -const char* -attr_name_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return insn_name(BIN(opt_invokebuiltin_delegate)); -} - -/* attr rb_num_t open @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_open_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_popn_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_retn_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_snum_t -attr_sp_inc_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_width_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return BIN(opt_invokebuiltin_delegate_leave); -} - -/* attr bool handles_sp @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -bool -attr_handles_sp_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return false; -} - -/* attr bool leaf @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -bool -attr_leaf_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return -#line 1560 "insns.def" -false; -#line 8831 "insns_info.inc" -} - -/* attr const char* name @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -const char* -attr_name_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return insn_name(BIN(opt_invokebuiltin_delegate_leave)); -} - -/* attr rb_num_t open @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_open_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_popn_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_retn_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_snum_t -attr_sp_inc_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_width_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getlocal_WC_0(idx)()(val) */ -enum ruby_vminsn_type -attr_bin_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(getlocal_WC_0); -} - -/* attr bool handles_sp @ getlocal_WC_0(idx)()(val) */ -bool -attr_handles_sp_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ getlocal_WC_0(idx)()(val) */ -bool -attr_leaf_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ getlocal_WC_0(idx)()(val) */ -const char* -attr_name_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(getlocal_WC_0)); -} - -/* attr rb_num_t open @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_open_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_popn_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_num_t retn @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_retn_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getlocal_WC_0(idx)()(val) */ -rb_snum_t -attr_sp_inc_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t width @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_width_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getlocal_WC_1(idx)()(val) */ -enum ruby_vminsn_type -attr_bin_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(getlocal_WC_1); -} - -/* attr bool handles_sp @ getlocal_WC_1(idx)()(val) */ -bool -attr_handles_sp_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ getlocal_WC_1(idx)()(val) */ -bool -attr_leaf_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ getlocal_WC_1(idx)()(val) */ -const char* -attr_name_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(getlocal_WC_1)); -} - -/* attr rb_num_t open @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_open_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_popn_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_num_t retn @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_retn_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getlocal_WC_1(idx)()(val) */ -rb_snum_t -attr_sp_inc_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t width @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_width_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setlocal_WC_0(idx)(val)() */ -enum ruby_vminsn_type -attr_bin_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(setlocal_WC_0); -} - -/* attr bool handles_sp @ setlocal_WC_0(idx)(val)() */ -bool -attr_handles_sp_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ setlocal_WC_0(idx)(val)() */ -bool -attr_leaf_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ setlocal_WC_0(idx)(val)() */ -const char* -attr_name_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(setlocal_WC_0)); -} - -/* attr rb_num_t open @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_open_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_popn_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t retn @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_retn_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setlocal_WC_0(idx)(val)() */ -rb_snum_t -attr_sp_inc_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return -1; -} - -/* attr rb_num_t width @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_width_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setlocal_WC_1(idx)(val)() */ -enum ruby_vminsn_type -attr_bin_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(setlocal_WC_1); -} - -/* attr bool handles_sp @ setlocal_WC_1(idx)(val)() */ -bool -attr_handles_sp_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ setlocal_WC_1(idx)(val)() */ -bool -attr_leaf_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ setlocal_WC_1(idx)(val)() */ -const char* -attr_name_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(setlocal_WC_1)); -} - -/* attr rb_num_t open @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_open_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_popn_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t retn @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_retn_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setlocal_WC_1(idx)(val)() */ -rb_snum_t -attr_sp_inc_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return -1; -} - -/* attr rb_num_t width @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_width_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putobject_INT2FIX_0_()()(val) */ -enum ruby_vminsn_type -attr_bin_putobject_INT2FIX_0_(void) -{ - return BIN(putobject_INT2FIX_0_); -} - -/* attr bool handles_sp @ putobject_INT2FIX_0_()()(val) */ -bool -attr_handles_sp_putobject_INT2FIX_0_(void) -{ - return false; -} - -/* attr bool leaf @ putobject_INT2FIX_0_()()(val) */ -bool -attr_leaf_putobject_INT2FIX_0_(void) -{ - return true; -} - -/* attr const char* name @ putobject_INT2FIX_0_()()(val) */ -const char* -attr_name_putobject_INT2FIX_0_(void) -{ - return insn_name(BIN(putobject_INT2FIX_0_)); -} - -/* attr rb_num_t open @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_open_putobject_INT2FIX_0_(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_popn_putobject_INT2FIX_0_(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_retn_putobject_INT2FIX_0_(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putobject_INT2FIX_0_()()(val) */ -rb_snum_t -attr_sp_inc_putobject_INT2FIX_0_(void) -{ - return 1; -} - -/* attr rb_num_t width @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_width_putobject_INT2FIX_0_(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ putobject_INT2FIX_1_()()(val) */ -enum ruby_vminsn_type -attr_bin_putobject_INT2FIX_1_(void) -{ - return BIN(putobject_INT2FIX_1_); -} - -/* attr bool handles_sp @ putobject_INT2FIX_1_()()(val) */ -bool -attr_handles_sp_putobject_INT2FIX_1_(void) -{ - return false; -} - -/* attr bool leaf @ putobject_INT2FIX_1_()()(val) */ -bool -attr_leaf_putobject_INT2FIX_1_(void) -{ - return true; -} - -/* attr const char* name @ putobject_INT2FIX_1_()()(val) */ -const char* -attr_name_putobject_INT2FIX_1_(void) -{ - return insn_name(BIN(putobject_INT2FIX_1_)); -} - -/* attr rb_num_t open @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_open_putobject_INT2FIX_1_(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_popn_putobject_INT2FIX_1_(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_retn_putobject_INT2FIX_1_(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putobject_INT2FIX_1_()()(val) */ -rb_snum_t -attr_sp_inc_putobject_INT2FIX_1_(void) -{ - return 1; -} - -/* attr rb_num_t width @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_width_putobject_INT2FIX_1_(void) -{ - return 1; -} - -PUREFUNC(MAYBE_UNUSED(static int comptime_insn_stack_increase(int depth, int insn, const VALUE *opes))); -PUREFUNC(static rb_snum_t comptime_insn_stack_increase_dispatch(enum ruby_vminsn_type insn, const VALUE *opes)); - -rb_snum_t -comptime_insn_stack_increase_dispatch(enum ruby_vminsn_type insn, const VALUE *opes) -{ - static const signed char t[] = { - 0, 1, -1, 1, -1, 1, 1, -1, - 1, -1, 1, -1, 1, -1, -2, 1, - -1, 1, 1, 1, 1, 1, 1, -127, - -1, -127, 0, -127, -127, -1, 1, 1, - -127, -1, -1, -127, 0, 0, -127, -1, - -1, 1, -127, 0, -127, -127, -127, -127, - 0, 1, -1, 1, 0, -1, 0, -1, - -127, -127, 0, 1, 0, 1, -127, -127, - -127, 0, 0, 0, -1, -1, -1, 1, - -127, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -2, -1, 0, 0, 0, 0, 0, 0, - -1, -127, 1, 1, 1, 1, -1, -1, - 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, - }; - signed char c = t[insn]; - - ASSERT_VM_INSTRUCTION_SIZE(t); - if (c != -127) { - return c; - } - else switch(insn) { - default: - UNREACHABLE; - case BIN(concatstrings): - return attr_sp_inc_concatstrings(NUM2LONG(opes[0])); - case BIN(toregexp): - return attr_sp_inc_toregexp(NUM2LONG(opes[0]), NUM2LONG(opes[1])); - case BIN(newarray): - return attr_sp_inc_newarray(NUM2LONG(opes[0])); - case BIN(newarraykwsplat): - return attr_sp_inc_newarraykwsplat(NUM2LONG(opes[0])); - case BIN(expandarray): - return attr_sp_inc_expandarray(NUM2LONG(opes[0]), NUM2LONG(opes[1])); - case BIN(pushtoarray): - return attr_sp_inc_pushtoarray(NUM2LONG(opes[0])); - case BIN(newhash): - return attr_sp_inc_newhash(NUM2LONG(opes[0])); - case BIN(dupn): - return attr_sp_inc_dupn(NUM2LONG(opes[0])); - case BIN(opt_reverse): - return attr_sp_inc_opt_reverse(NUM2LONG(opes[0])); - case BIN(topn): - return attr_sp_inc_topn(NUM2LONG(opes[0])); - case BIN(setn): - return attr_sp_inc_setn(NUM2LONG(opes[0])); - case BIN(adjuststack): - return attr_sp_inc_adjuststack(NUM2LONG(opes[0])); - case BIN(send): - return attr_comptime_sp_inc_send((CALL_INFO)(opes[0]), (ISEQ)(opes[1])); - case BIN(opt_send_without_block): - return attr_comptime_sp_inc_opt_send_without_block((CALL_INFO)(opes[0])); - case BIN(opt_newarray_send): - return attr_comptime_sp_inc_opt_newarray_send(NUM2LONG(opes[0]), SYM2ID(opes[1])); - case BIN(invokesuper): - return attr_comptime_sp_inc_invokesuper((CALL_INFO)(opes[0]), (ISEQ)(opes[1])); - case BIN(invokeblock): - return attr_comptime_sp_inc_invokeblock((CALL_INFO)(opes[0])); - case BIN(opt_case_dispatch): - return attr_sp_inc_opt_case_dispatch((CDHASH)(opes[0]), (OFFSET)(opes[1])); - case BIN(invokebuiltin): - return attr_sp_inc_invokebuiltin((RB_BUILTIN)(opes[0])); - } -} - -int -comptime_insn_stack_increase(int depth, int insn, const VALUE *opes) -{ - enum ruby_vminsn_type itype = (enum ruby_vminsn_type)insn; - return depth + (int)comptime_insn_stack_increase_dispatch(itype, opes); -} - -PUREFUNC(MAYBE_UNUSED(static bool insn_may_depend_on_sp_or_pc(int insn, const VALUE *opes))); - -static bool -insn_may_depend_on_sp_or_pc(int insn, const VALUE *opes) -{ - switch (insn) { - case BIN(getspecial): - case BIN(getinstancevariable): - case BIN(setinstancevariable): - case BIN(getclassvariable): - case BIN(setclassvariable): - case BIN(opt_getconstant_path): - case BIN(getconstant): - case BIN(setconstant): - case BIN(getglobal): - case BIN(setglobal): - case BIN(putspecialobject): - case BIN(concatstrings): - case BIN(toregexp): - case BIN(expandarray): - case BIN(concatarray): - case BIN(concattoarray): - case BIN(splatarray): - case BIN(splatkw): - case BIN(newhash): - case BIN(newrange): - case BIN(defined): - case BIN(definedivar): - case BIN(checkmatch): - case BIN(defineclass): - case BIN(definemethod): - case BIN(definesmethod): - case BIN(send): - case BIN(opt_send_without_block): - case BIN(objtostring): - case BIN(opt_newarray_send): - case BIN(invokesuper): - case BIN(invokeblock): - case BIN(leave): - case BIN(throw): - case BIN(jump): - case BIN(branchif): - case BIN(branchunless): - case BIN(branchnil): - case BIN(once): - case BIN(opt_div): - case BIN(opt_mod): - case BIN(opt_ltlt): - case BIN(opt_aref): - case BIN(opt_aset): - case BIN(opt_aset_with): - case BIN(opt_aref_with): - case BIN(opt_regexpmatch2): - case BIN(invokebuiltin): - case BIN(opt_invokebuiltin_delegate): - case BIN(opt_invokebuiltin_delegate_leave): - case BIN(trace_nop): - case BIN(trace_getlocal): - case BIN(trace_setlocal): - case BIN(trace_getblockparam): - case BIN(trace_setblockparam): - case BIN(trace_getblockparamproxy): - case BIN(trace_getspecial): - case BIN(trace_setspecial): - case BIN(trace_getinstancevariable): - case BIN(trace_setinstancevariable): - case BIN(trace_getclassvariable): - case BIN(trace_setclassvariable): - case BIN(trace_opt_getconstant_path): - case BIN(trace_getconstant): - case BIN(trace_setconstant): - case BIN(trace_getglobal): - case BIN(trace_setglobal): - case BIN(trace_putnil): - case BIN(trace_putself): - case BIN(trace_putobject): - case BIN(trace_putspecialobject): - case BIN(trace_putstring): - case BIN(trace_putchilledstring): - case BIN(trace_concatstrings): - case BIN(trace_anytostring): - case BIN(trace_toregexp): - case BIN(trace_intern): - case BIN(trace_newarray): - case BIN(trace_newarraykwsplat): - case BIN(trace_pushtoarraykwsplat): - case BIN(trace_duparray): - case BIN(trace_duphash): - case BIN(trace_expandarray): - case BIN(trace_concatarray): - case BIN(trace_concattoarray): - case BIN(trace_pushtoarray): - case BIN(trace_splatarray): - case BIN(trace_splatkw): - case BIN(trace_newhash): - case BIN(trace_newrange): - case BIN(trace_pop): - case BIN(trace_dup): - case BIN(trace_dupn): - case BIN(trace_swap): - case BIN(trace_opt_reverse): - case BIN(trace_topn): - case BIN(trace_setn): - case BIN(trace_adjuststack): - case BIN(trace_defined): - case BIN(trace_definedivar): - case BIN(trace_checkmatch): - case BIN(trace_checkkeyword): - case BIN(trace_checktype): - case BIN(trace_defineclass): - case BIN(trace_definemethod): - case BIN(trace_definesmethod): - case BIN(trace_send): - case BIN(trace_opt_send_without_block): - case BIN(trace_objtostring): - case BIN(trace_opt_str_freeze): - case BIN(trace_opt_nil_p): - case BIN(trace_opt_str_uminus): - case BIN(trace_opt_newarray_send): - case BIN(trace_invokesuper): - case BIN(trace_invokeblock): - case BIN(trace_leave): - case BIN(trace_throw): - case BIN(trace_jump): - case BIN(trace_branchif): - case BIN(trace_branchunless): - case BIN(trace_branchnil): - case BIN(trace_once): - case BIN(trace_opt_case_dispatch): - case BIN(trace_opt_plus): - case BIN(trace_opt_minus): - case BIN(trace_opt_mult): - case BIN(trace_opt_div): - case BIN(trace_opt_mod): - case BIN(trace_opt_eq): - case BIN(trace_opt_neq): - case BIN(trace_opt_lt): - case BIN(trace_opt_le): - case BIN(trace_opt_gt): - case BIN(trace_opt_ge): - case BIN(trace_opt_ltlt): - case BIN(trace_opt_and): - case BIN(trace_opt_or): - case BIN(trace_opt_aref): - case BIN(trace_opt_aset): - case BIN(trace_opt_aset_with): - case BIN(trace_opt_aref_with): - case BIN(trace_opt_length): - case BIN(trace_opt_size): - case BIN(trace_opt_empty_p): - case BIN(trace_opt_succ): - case BIN(trace_opt_not): - case BIN(trace_opt_regexpmatch2): - case BIN(trace_invokebuiltin): - case BIN(trace_opt_invokebuiltin_delegate): - case BIN(trace_opt_invokebuiltin_delegate_leave): - case BIN(trace_getlocal_WC_0): - case BIN(trace_getlocal_WC_1): - case BIN(trace_setlocal_WC_0): - case BIN(trace_setlocal_WC_1): - case BIN(trace_putobject_INT2FIX_0_): - case BIN(trace_putobject_INT2FIX_1_): - return true; - default: - return false; - } -} - diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h deleted file mode 100644 index 4fb99d1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef RUBY_INTERNAL_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_INTERNAL_H 1 -/** - * @author $Author$ - * @date Tue May 17 11:42:20 JST 2011 - * @copyright Copyright (C) 2011 Yukihiro Matsumoto - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ -#include "ruby/internal/config.h" - -#ifdef __cplusplus -# error not for C++ -#endif - -#define LIKELY(x) RB_LIKELY(x) -#define UNLIKELY(x) RB_UNLIKELY(x) - -#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#define roomof(x, y) (((x) + (y) - 1) / (y)) -#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) - -/* Prevent compiler from reordering access */ -#define ACCESS_ONCE(type,x) (*((volatile type *)&(x))) - -#define UNDEF_P RB_UNDEF_P -#define NIL_OR_UNDEF_P RB_NIL_OR_UNDEF_P - -#include "ruby/ruby.h" - -/* Following macros were formerly defined in this header but moved to somewhere - * else. In order to detect them we undef here. */ - -/* internal/array.h */ -#undef RARRAY_AREF - -/* internal/class.h */ -#undef RClass -#undef RCLASS_SUPER - -/* internal/hash.h */ -#undef RHASH_IFNONE -#undef RHASH_SIZE -#undef RHASH_TBL -#undef RHASH_EMPTY_P - -/* internal/struct.h */ -#undef RSTRUCT_LEN -#undef RSTRUCT_PTR -#undef RSTRUCT_SET -#undef RSTRUCT_GET - -/* Also, we keep the following macros here. They are expected to be - * overridden in each headers. */ - -/* internal/array.h */ -#define rb_ary_new_from_args(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/io.h */ -#define rb_io_fptr_finalize(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/string.h */ -#define rb_fstring_cstr(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/symbol.h */ -#define rb_sym_intern_ascii_cstr(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/vm.h */ -#define rb_funcallv(...) rb_nonexistent_symbol(__VA_ARGS__) -#define rb_method_basic_definition_p(...) rb_nonexistent_symbol(__VA_ARGS__) - - -/* MRI debug support */ - -/* gc.c */ -void rb_obj_info_dump(VALUE obj); -void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func); - -/* debug.c */ - -RUBY_SYMBOL_EXPORT_BEGIN -void ruby_debug_breakpoint(void); -PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2); -RUBY_SYMBOL_EXPORT_END - -// show obj data structure without any side-effect -#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING) - -// same as rp, but add message header -#define rp_m(msg, obj) do { \ - fputs((msg), stderr); \ - rb_obj_info_dump((VALUE)(obj)); \ -} while (0) - -// `ruby_debug_breakpoint()` does nothing, -// but breakpoint is set in run.gdb, so `make gdb` can stop here. -#define bp() ruby_debug_breakpoint() - -#define RBOOL(v) ((v) ? Qtrue : Qfalse) -#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM) - -#ifndef __MINGW32__ -#undef memcpy -#define memcpy ruby_nonempty_memcpy -#endif -#endif /* RUBY_INTERNAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h deleted file mode 100644 index 39f6fcb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef INTERNAL_ARRAY_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ARRAY_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Array. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for RARRAY_LEN */ - -#ifndef ARRAY_DEBUG -# define ARRAY_DEBUG (0+RUBY_DEBUG) -#endif - -#define RARRAY_SHARED_FLAG ELTS_SHARED -#define RARRAY_SHARED_ROOT_FLAG FL_USER12 -#define RARRAY_PTR_IN_USE_FLAG FL_USER14 - -/* array.c */ -VALUE rb_ary_hash_values(long len, const VALUE *elements); -VALUE rb_ary_last(int, const VALUE *, VALUE); -void rb_ary_set_len(VALUE, long); -void rb_ary_delete_same(VALUE, VALUE); -VALUE rb_ary_hidden_new_fill(long capa); -VALUE rb_ary_at(VALUE, VALUE); -size_t rb_ary_memsize(VALUE); -VALUE rb_to_array_type(VALUE obj); -VALUE rb_to_array(VALUE obj); -void rb_ary_cancel_sharing(VALUE ary); -size_t rb_ary_size_as_embedded(VALUE ary); -void rb_ary_make_embedded(VALUE ary); -bool rb_ary_embeddable_p(VALUE ary); -VALUE rb_ary_diff(VALUE ary1, VALUE ary2); - -static inline VALUE rb_ary_entry_internal(VALUE ary, long offset); -static inline bool ARY_PTR_USING_P(VALUE ary); - -VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *); -VALUE rb_check_to_array(VALUE ary); -VALUE rb_ary_behead(VALUE, long); -VALUE rb_ary_aref1(VALUE ary, VALUE i); - -struct rb_execution_context_struct; -VALUE rb_ec_ary_new_from_values(struct rb_execution_context_struct *ec, long n, const VALUE *elts); - -// YJIT needs this function to never allocate and never raise -static inline VALUE -rb_ary_entry_internal(VALUE ary, long offset) -{ - long len = RARRAY_LEN(ary); - const VALUE *ptr = RARRAY_CONST_PTR(ary); - if (len == 0) return Qnil; - if (offset < 0) { - offset += len; - if (offset < 0) return Qnil; - } - else if (len <= offset) { - return Qnil; - } - return ptr[offset]; -} - -static inline bool -ARY_PTR_USING_P(VALUE ary) -{ - return FL_TEST_RAW(ary, RARRAY_PTR_IN_USE_FLAG); -} - -RBIMPL_ATTR_MAYBE_UNUSED() -static inline int -ary_should_not_be_shared_and_embedded(VALUE ary) -{ - return !FL_ALL_RAW(ary, RARRAY_SHARED_FLAG|RARRAY_EMBED_FLAG); -} - -static inline bool -ARY_SHARED_P(VALUE ary) -{ - assert(RB_TYPE_P(ary, T_ARRAY)); - assert(ary_should_not_be_shared_and_embedded(ary)); - return FL_TEST_RAW(ary, RARRAY_SHARED_FLAG); -} - -static inline bool -ARY_EMBED_P(VALUE ary) -{ - assert(RB_TYPE_P(ary, T_ARRAY)); - assert(ary_should_not_be_shared_and_embedded(ary)); - return FL_TEST_RAW(ary, RARRAY_EMBED_FLAG); -} - -static inline VALUE -ARY_SHARED_ROOT(VALUE ary) -{ - assert(ARY_SHARED_P(ary)); - return RARRAY(ary)->as.heap.aux.shared_root; -} - -static inline bool -ARY_SHARED_ROOT_P(VALUE ary) -{ - assert(RB_TYPE_P(ary, T_ARRAY)); - return FL_TEST_RAW(ary, RARRAY_SHARED_ROOT_FLAG); -} - -static inline long -ARY_SHARED_ROOT_REFCNT(VALUE ary) -{ - assert(ARY_SHARED_ROOT_P(ary)); - return RARRAY(ary)->as.heap.aux.capa; -} - -#undef rb_ary_new_from_args -#if RBIMPL_HAS_WARNING("-Wgnu-zero-variadic-macro-arguments") -# /* Skip it; clang -pedantic doesn't like the following */ -#elif defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO) -#define rb_ary_new_from_args(n, ...) \ - __extension__ ({ \ - const VALUE args_to_new_ary[] = {__VA_ARGS__}; \ - if (__builtin_constant_p(n)) { \ - STATIC_ASSERT(rb_ary_new_from_args, numberof(args_to_new_ary) == (n)); \ - } \ - rb_ary_new_from_values(numberof(args_to_new_ary), args_to_new_ary); \ - }) -#endif - -#undef RARRAY_AREF -RBIMPL_ATTR_PURE_UNLESS_DEBUG() -RBIMPL_ATTR_ARTIFICIAL() -static inline VALUE -RARRAY_AREF(VALUE ary, long i) -{ - VALUE val; - RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY); - - RBIMPL_WARNING_PUSH(); -#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ == 13 - RBIMPL_WARNING_IGNORED(-Warray-bounds); -#endif - val = RARRAY_CONST_PTR(ary)[i]; - RBIMPL_WARNING_POP(); - return val; -} - -#endif /* INTERNAL_ARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h deleted file mode 100644 index a594036..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef INTERNAL_BOP_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BOP_H - -#include "internal.h" -#include "ruby/internal/dllexport.h" - -enum ruby_basic_operators { - BOP_PLUS, - BOP_MINUS, - BOP_MULT, - BOP_DIV, - BOP_MOD, - BOP_EQ, - BOP_EQQ, - BOP_LT, - BOP_LE, - BOP_LTLT, - BOP_AREF, - BOP_ASET, - BOP_LENGTH, - BOP_SIZE, - BOP_EMPTY_P, - BOP_NIL_P, - BOP_SUCC, - BOP_GT, - BOP_GE, - BOP_NOT, - BOP_NEQ, - BOP_MATCH, - BOP_FREEZE, - BOP_UMINUS, - BOP_MAX, - BOP_MIN, - BOP_HASH, - BOP_CALL, - BOP_AND, - BOP_OR, - BOP_CMP, - BOP_DEFAULT, - - BOP_LAST_ -}; - -RUBY_EXTERN short ruby_vm_redefined_flag[BOP_LAST_]; - -/* optimize insn */ -#define INTEGER_REDEFINED_OP_FLAG (1 << 0) -#define FLOAT_REDEFINED_OP_FLAG (1 << 1) -#define STRING_REDEFINED_OP_FLAG (1 << 2) -#define ARRAY_REDEFINED_OP_FLAG (1 << 3) -#define HASH_REDEFINED_OP_FLAG (1 << 4) -/* #define BIGNUM_REDEFINED_OP_FLAG (1 << 5) */ -#define SYMBOL_REDEFINED_OP_FLAG (1 << 6) -#define TIME_REDEFINED_OP_FLAG (1 << 7) -#define REGEXP_REDEFINED_OP_FLAG (1 << 8) -#define NIL_REDEFINED_OP_FLAG (1 << 9) -#define TRUE_REDEFINED_OP_FLAG (1 << 10) -#define FALSE_REDEFINED_OP_FLAG (1 << 11) -#define PROC_REDEFINED_OP_FLAG (1 << 12) - -#define BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0)) - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h deleted file mode 100644 index db8d3ae..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef INTERNAL_BIGNUM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BIGNUM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Bignums. - */ -#include "ruby/internal/config.h" /* for HAVE_LIBGMP */ -#include /* for size_t */ - -#ifdef HAVE_SYS_TYPES_H -# include /* for ssize_t (note: on Windows ssize_t is */ -#endif /* `#define`d in ruby/config.h) */ - -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for struct RBasic */ - -#ifndef BDIGIT -# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGIT SIZEOF_INT -# define BDIGIT_DBL unsigned LONG_LONG -# define BDIGIT_DBL_SIGNED LONG_LONG -# define PRI_BDIGIT_PREFIX "" -# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX -# elif SIZEOF_INT*2 <= SIZEOF_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGIT SIZEOF_INT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "" -# define PRI_BDIGIT_DBL_PREFIX "l" -# elif SIZEOF_SHORT*2 <= SIZEOF_LONG -# define BDIGIT unsigned short -# define SIZEOF_BDIGIT SIZEOF_SHORT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "h" -# define PRI_BDIGIT_DBL_PREFIX "l" -# else -# define BDIGIT unsigned short -# define SIZEOF_BDIGIT (SIZEOF_LONG/2) -# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "h" -# define PRI_BDIGIT_DBL_PREFIX "l" -# endif -#endif - -#ifndef SIZEOF_ACTUAL_BDIGIT -# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT -#endif - -#ifdef PRI_BDIGIT_PREFIX -# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d" -# define PRIiBDIGIT PRI_BDIGIT_PREFIX"i" -# define PRIoBDIGIT PRI_BDIGIT_PREFIX"o" -# define PRIuBDIGIT PRI_BDIGIT_PREFIX"u" -# define PRIxBDIGIT PRI_BDIGIT_PREFIX"x" -# define PRIXBDIGIT PRI_BDIGIT_PREFIX"X" -#endif - -#ifdef PRI_BDIGIT_DBL_PREFIX -# define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" -# define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" -# define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" -# define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" -# define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" -# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" -#endif - -#define RBIGNUM(obj) ((struct RBignum *)(obj)) -#define BIGNUM_SIGN_BIT FL_USER1 -#define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2) -#define BIGNUM_EMBED_LEN_NUMBITS 3 -#define BIGNUM_EMBED_LEN_MASK \ - (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT) -#define BIGNUM_EMBED_LEN_SHIFT \ - (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */ -#ifndef BIGNUM_EMBED_LEN_MAX -# if (SIZEOF_VALUE*RBIMPL_RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1 -# define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*RBIMPL_RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) -# else -# define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1) -# endif -#endif - -enum rb_int_parse_flags { - RB_INT_PARSE_SIGN = 0x01, - RB_INT_PARSE_UNDERSCORE = 0x02, - RB_INT_PARSE_PREFIX = 0x04, - RB_INT_PARSE_ALL = 0x07, - RB_INT_PARSE_DEFAULT = 0x07, -}; - -struct RBignum { - struct RBasic basic; - union { - struct { - size_t len; - BDIGIT *digits; - } heap; - BDIGIT ary[BIGNUM_EMBED_LEN_MAX]; - } as; -}; - -/* bignum.c */ -extern const char ruby_digitmap[]; -double rb_big_fdiv_double(VALUE x, VALUE y); -VALUE rb_big_uminus(VALUE x); -VALUE rb_big_hash(VALUE); -VALUE rb_big_odd_p(VALUE); -VALUE rb_big_even_p(VALUE); -size_t rb_big_size(VALUE); -VALUE rb_integer_float_cmp(VALUE x, VALUE y); -VALUE rb_integer_float_eq(VALUE x, VALUE y); -VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception); -VALUE rb_big_comp(VALUE x); -VALUE rb_big_aref(VALUE x, VALUE y); -VALUE rb_big_abs(VALUE x); -VALUE rb_big_size_m(VALUE big); -VALUE rb_big_bit_length(VALUE big); -VALUE rb_big_remainder(VALUE x, VALUE y); -VALUE rb_big_gt(VALUE x, VALUE y); -VALUE rb_big_ge(VALUE x, VALUE y); -VALUE rb_big_lt(VALUE x, VALUE y); -VALUE rb_big_le(VALUE x, VALUE y); -VALUE rb_int_powm(int const argc, VALUE * const argv, VALUE const num); -VALUE rb_big_isqrt(VALUE n); -static inline bool BIGNUM_SIGN(VALUE b); -static inline bool BIGNUM_POSITIVE_P(VALUE b); -static inline bool BIGNUM_NEGATIVE_P(VALUE b); -static inline void BIGNUM_SET_SIGN(VALUE b, bool sign); -static inline void BIGNUM_NEGATE(VALUE b); -static inline size_t BIGNUM_LEN(VALUE b); -static inline BDIGIT *BIGNUM_DIGITS(VALUE b); -static inline int BIGNUM_LENINT(VALUE b); -static inline bool BIGNUM_EMBED_P(VALUE b); - -RUBY_SYMBOL_EXPORT_BEGIN -/* bignum.c (export) */ -VALUE rb_big_mul_normal(VALUE x, VALUE y); -VALUE rb_big_mul_balance(VALUE x, VALUE y); -VALUE rb_big_mul_karatsuba(VALUE x, VALUE y); -VALUE rb_big_mul_toom3(VALUE x, VALUE y); -VALUE rb_big_sq_fast(VALUE x); -VALUE rb_big_divrem_normal(VALUE x, VALUE y); -VALUE rb_big2str_poweroftwo(VALUE x, int base); -VALUE rb_big2str_generic(VALUE x, int base); -VALUE rb_str2big_poweroftwo(VALUE arg, int base, int badcheck); -VALUE rb_str2big_normal(VALUE arg, int base, int badcheck); -VALUE rb_str2big_karatsuba(VALUE arg, int base, int badcheck); -#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) -VALUE rb_big_mul_gmp(VALUE x, VALUE y); -VALUE rb_big_divrem_gmp(VALUE x, VALUE y); -VALUE rb_big2str_gmp(VALUE x, int base); -VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck); -#endif -VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags); -RUBY_SYMBOL_EXPORT_END - -#if defined(HAVE_INT128_T) -VALUE rb_int128t2big(int128_t n); -#endif - -/* sign: positive:1, negative:0 */ -static inline bool -BIGNUM_SIGN(VALUE b) -{ - return FL_TEST_RAW(b, BIGNUM_SIGN_BIT); -} - -static inline bool -BIGNUM_POSITIVE_P(VALUE b) -{ - return BIGNUM_SIGN(b); -} - -static inline bool -BIGNUM_NEGATIVE_P(VALUE b) -{ - return ! BIGNUM_POSITIVE_P(b); -} - -static inline void -BIGNUM_SET_SIGN(VALUE b, bool sign) -{ - if (sign) { - FL_SET_RAW(b, BIGNUM_SIGN_BIT); - } - else { - FL_UNSET_RAW(b, BIGNUM_SIGN_BIT); - } -} - -static inline void -BIGNUM_NEGATE(VALUE b) -{ - FL_REVERSE_RAW(b, BIGNUM_SIGN_BIT); -} - -static inline size_t -BIGNUM_LEN(VALUE b) -{ - if (! BIGNUM_EMBED_P(b)) { - return RBIGNUM(b)->as.heap.len; - } - else { - size_t ret = RBASIC(b)->flags; - ret &= BIGNUM_EMBED_LEN_MASK; - ret >>= BIGNUM_EMBED_LEN_SHIFT; - return ret; - } -} - -static inline int -BIGNUM_LENINT(VALUE b) -{ - return rb_long2int(BIGNUM_LEN(b)); -} - -/* LSB:BIGNUM_DIGITS(b)[0], MSB:BIGNUM_DIGITS(b)[BIGNUM_LEN(b)-1] */ -static inline BDIGIT * -BIGNUM_DIGITS(VALUE b) -{ - if (BIGNUM_EMBED_P(b)) { - return RBIGNUM(b)->as.ary; - } - else { - return RBIGNUM(b)->as.heap.digits; - } -} - -static inline bool -BIGNUM_EMBED_P(VALUE b) -{ - return FL_TEST_RAW(b, BIGNUM_EMBED_FLAG); -} - -#endif /* INTERNAL_BIGNUM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h deleted file mode 100644 index 1fe98fa..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h +++ /dev/null @@ -1,568 +0,0 @@ -#ifndef INTERNAL_BITS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BITS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for bitwise integer algorithms. - * @see Henry S. Warren Jr., "Hacker's Delight" (2nd ed.), 2013. - * @see SEI CERT C Coding Standard INT32-C. "Ensure that operations on - * signed integers do not result in overflow" - * @see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateleft - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateright - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/byteswap-uint64-byteswap-ulong-byteswap-ushort - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/rotl-rotl64-rotr-rotr64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/lzcnt16-lzcnt-lzcnt64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_tzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotl64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotr64 - * @see https://stackoverflow.com/a/776523 - */ -#include "ruby/internal/config.h" -#include /* for CHAR_BITS */ -#include /* for uintptr_t */ -#include "internal/compilers.h" /* for MSC_VERSION_SINCE */ - -#if MSC_VERSION_SINCE(1310) -# include /* for _byteswap_uint64 */ -#endif - -#if defined(HAVE_X86INTRIN_H) -# include /* for _lzcnt_u64 */ -#elif MSC_VERSION_SINCE(1310) -# include /* for the following intrinsics */ -#endif - -#if defined(_MSC_VER) && defined(__AVX__) -# pragma intrinsic(__popcnt) -# pragma intrinsic(__popcnt64) -#endif - -#if defined(_MSC_VER) && defined(__AVX2__) -# pragma intrinsic(__lzcnt) -# pragma intrinsic(__lzcnt64) -#endif - -#if MSC_VERSION_SINCE(1310) -# pragma intrinsic(_rotl) -# pragma intrinsic(_rotr) -# ifdef _WIN64 -# pragma intrinsic(_rotl64) -# pragma intrinsic(_rotr64) -# endif -#endif - -#if MSC_VERSION_SINCE(1400) -# pragma intrinsic(_BitScanForward) -# pragma intrinsic(_BitScanReverse) -# ifdef _WIN64 -# pragma intrinsic(_BitScanForward64) -# pragma intrinsic(_BitScanReverse64) -# endif -#endif - -#include "ruby/ruby.h" /* for VALUE */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ - -/* The most significant bit of the lower part of half-long integer. - * If sizeof(long) == 4, this is 0x8000. - * If sizeof(long) == 8, this is 0x80000000. - */ -#define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2)) - -#define SIGNED_INTEGER_TYPE_P(T) (0 > ((T)0)-1) - -#define SIGNED_INTEGER_MIN(T) \ - ((sizeof(T) == sizeof(int8_t)) ? ((T)INT8_MIN) : \ - ((sizeof(T) == sizeof(int16_t)) ? ((T)INT16_MIN) : \ - ((sizeof(T) == sizeof(int32_t)) ? ((T)INT32_MIN) : \ - ((sizeof(T) == sizeof(int64_t)) ? ((T)INT64_MIN) : \ - 0)))) - -#define SIGNED_INTEGER_MAX(T) ((T)(SIGNED_INTEGER_MIN(T) ^ ((T)~(T)0))) - -#define UNSIGNED_INTEGER_MAX(T) ((T)~(T)0) - -#if __has_builtin(__builtin_mul_overflow_p) -# define MUL_OVERFLOW_P(a, b) \ - __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0) -#elif __has_builtin(__builtin_mul_overflow) -# define MUL_OVERFLOW_P(a, b) \ - __extension__ ({ __typeof__(a) c; __builtin_mul_overflow((a), (b), &c); }) -#endif - -#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \ - (a) == 0 ? 0 : \ - (a) == -1 ? (b) < -(max) : \ - (a) > 0 ? \ - ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \ - ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b))) - -#if __has_builtin(__builtin_mul_overflow_p) -/* __builtin_mul_overflow_p can take bitfield */ -/* and GCC permits bitfields for integers other than int */ -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - __extension__ ({ \ - struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \ - __builtin_mul_overflow_p((a), (b), c.fixnum); \ - }) -#else -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX) -#endif - -#if defined(MUL_OVERFLOW_P) && defined(USE___BUILTIN_MUL_OVERFLOW_LONG_LONG) -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -#else -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) -#endif - -#ifdef MUL_OVERFLOW_P -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b) -#else -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX) -#endif - -#ifdef HAVE_UINT128_T -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - sizeof(x) <= sizeof(int64_t) ? 64 - nlz_int64((uint64_t)(x)) : \ - 128 - nlz_int128((uint128_t)(x))) -#else -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - 64 - nlz_int64((uint64_t)(x))) -#endif - -#ifndef swap16 -# define swap16 ruby_swap16 -#endif - -#ifndef swap32 -# define swap32 ruby_swap32 -#endif - -#ifndef swap64 -# define swap64 ruby_swap64 -#endif - -static inline uint16_t ruby_swap16(uint16_t); -static inline uint32_t ruby_swap32(uint32_t); -static inline uint64_t ruby_swap64(uint64_t); -static inline unsigned nlz_int(unsigned x); -static inline unsigned nlz_long(unsigned long x); -static inline unsigned nlz_long_long(unsigned long long x); -static inline unsigned nlz_intptr(uintptr_t x); -static inline unsigned nlz_int32(uint32_t x); -static inline unsigned nlz_int64(uint64_t x); -#ifdef HAVE_UINT128_T -static inline unsigned nlz_int128(uint128_t x); -#endif -static inline unsigned rb_popcount32(uint32_t x); -static inline unsigned rb_popcount64(uint64_t x); -static inline unsigned rb_popcount_intptr(uintptr_t x); -static inline int ntz_int32(uint32_t x); -static inline int ntz_int64(uint64_t x); -static inline int ntz_intptr(uintptr_t x); -static inline VALUE RUBY_BIT_ROTL(VALUE, int); -static inline VALUE RUBY_BIT_ROTR(VALUE, int); - -static inline uint16_t -ruby_swap16(uint16_t x) -{ -#if __has_builtin(__builtin_bswap16) - return __builtin_bswap16(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ushort(x); - -#else - return (x << 8) | (x >> 8); - -#endif -} - -static inline uint32_t -ruby_swap32(uint32_t x) -{ -#if __has_builtin(__builtin_bswap32) - return __builtin_bswap32(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ulong(x); - -#else - x = ((x & 0x0000FFFF) << 16) | ((x & 0xFFFF0000) >> 16); - x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >> 8); - return x; - -#endif -} - -static inline uint64_t -ruby_swap64(uint64_t x) -{ -#if __has_builtin(__builtin_bswap64) - return __builtin_bswap64(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_uint64(x); - -#else - x = ((x & 0x00000000FFFFFFFFULL) << 32) | ((x & 0xFFFFFFFF00000000ULL) >> 32); - x = ((x & 0x0000FFFF0000FFFFULL) << 16) | ((x & 0xFFFF0000FFFF0000ULL) >> 16); - x = ((x & 0x00FF00FF00FF00FFULL) << 8) | ((x & 0xFF00FF00FF00FF00ULL) >> 8); - return x; - -#endif -} - -static inline unsigned int -nlz_int32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - /* Note: It seems there is no such thing like __LZCNT__ predefined in MSVC. - * AMD CPUs have had this instruction for decades (since K10) but for - * Intel, Haswell is the oldest one. We need to use __AVX2__ for maximum - * safety. */ - return (unsigned int)__lzcnt(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse(&r, x) ? (31 - (int)r) : 32; - -#elif __has_builtin(__builtin_clz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned int)__builtin_clz(x) : 32; - -#else - uint32_t y; - unsigned n = 32; - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); -#endif -} - -static inline unsigned int -nlz_int64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - return (unsigned int)__lzcnt64(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64; - -#elif __has_builtin(__builtin_clzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - uint64_t y; - unsigned int n = 64; - y = x >> 32; if (y) {n -= 32; x = y;} - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); - -#endif -} - -#ifdef HAVE_UINT128_T -static inline unsigned int -nlz_int128(uint128_t x) -{ - uint64_t y = (uint64_t)(x >> 64); - - if (x == 0) { - return 128; - } - else if (y == 0) { - return (unsigned int)nlz_int64(x) + 64; - } - else { - return (unsigned int)nlz_int64(y); - } -} -#endif - -static inline unsigned int -nlz_int(unsigned int x) -{ - if (sizeof(unsigned int) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned int) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long(unsigned long x) -{ - if (sizeof(unsigned long) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long_long(unsigned long long x) -{ - if (sizeof(unsigned long long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } -#ifdef HAVE_UINT128_T - else if (sizeof(unsigned long long) * CHAR_BIT == 128) { - return nlz_int128((uint128_t)x); - } -#endif - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) == sizeof(unsigned int)) { - return nlz_int((unsigned int)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long)) { - return nlz_long((unsigned long)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long long)) { - return nlz_long_long((unsigned long long)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -rb_popcount32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - /* Note: CPUs since Nehalem and Barcelona have had this instruction so SSE - * 4.2 should suffice, but it seems there is no such thing like __SSE_4_2__ - * predefined macro in MSVC. They do have __AVX__ so use it instead. */ - return (unsigned int)__popcnt(x); - -#elif __has_builtin(__builtin_popcount) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT >= 32); - return (unsigned int)__builtin_popcount(x); - -#else - x = (x & 0x55555555) + (x >> 1 & 0x55555555); - x = (x & 0x33333333) + (x >> 2 & 0x33333333); - x = (x & 0x07070707) + (x >> 4 & 0x07070707); - x = (x & 0x000f000f) + (x >> 8 & 0x000f000f); - x = (x & 0x0000001f) + (x >>16 & 0x0000001f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - return (unsigned int)__popcnt64(x); - -#elif __has_builtin(__builtin_popcount) - if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555); - x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333); - x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707); - x = (x & 0x000f000f000f000f) + (x >> 8 & 0x000f000f000f000f); - x = (x & 0x0000001f0000001f) + (x >>16 & 0x0000001f0000001f); - x = (x & 0x000000000000003f) + (x >>32 & 0x000000000000003f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return rb_popcount64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return rb_popcount32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline int -ntz_int32(uint32_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) - /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using - * assembly? Because issuing LZCNT seems possible (see nlz.h). */ - unsigned long r; - return _BitScanForward(&r, x) ? (int)r : 32; - -#elif __has_builtin(__builtin_ctz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned)__builtin_ctz(x) : 32; - -#else - return rb_popcount32((~x) & (x-1)); - -#endif -} - -static inline int -ntz_int64(uint64_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) - unsigned long r; - return _BitScanForward64(&r, x) ? (int)r : 64; - -#elif __has_builtin(__builtin_ctzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - return rb_popcount64((~x) & (x-1)); - -#endif -} - -static inline int -ntz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return ntz_int64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return ntz_int32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline VALUE -RUBY_BIT_ROTL(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateleft32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateleft32(v, n); - -#elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateleft64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotl(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotl64(v, n); - -#elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotl(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (n & m)) | (v >> (-n & m)); -#endif -} - -static inline VALUE -RUBY_BIT_ROTR(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateright32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateright32(v, n); - -#elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateright64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotr(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotr64(v, n); - -#elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotr(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (-n & m)) | (v >> (n & m)); -#endif -} - -#endif /* INTERNAL_BITS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h deleted file mode 100644 index 8a6c956..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +++ /dev/null @@ -1,283 +0,0 @@ -#ifndef INTERNAL_CLASS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_CLASS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Class. - */ -#include "id.h" -#include "id_table.h" /* for struct rb_id_table */ -#include "internal/serial.h" /* for rb_serial_t */ -#include "internal/static_assert.h" -#include "internal/variable.h" /* for rb_class_ivar_set */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/intern.h" /* for rb_alloc_func_t */ -#include "ruby/ruby.h" /* for struct RBasic */ -#include "shape.h" -#include "ruby_assert.h" -#include "vm_core.h" -#include "vm_sync.h" -#include "method.h" /* for rb_cref_t */ - -#ifdef RCLASS_SUPER -# undef RCLASS_SUPER -#endif - -struct rb_subclass_entry { - VALUE klass; - struct rb_subclass_entry *next; - struct rb_subclass_entry *prev; -}; -typedef struct rb_subclass_entry rb_subclass_entry_t; - -struct rb_cvar_class_tbl_entry { - uint32_t index; - rb_serial_t global_cvar_state; - const rb_cref_t * cref; - VALUE class_value; -}; - -struct rb_classext_struct { - VALUE *iv_ptr; - struct rb_id_table *const_tbl; - struct rb_id_table *callable_m_tbl; - struct rb_id_table *cc_tbl; /* ID -> [[ci1, cc1], [ci2, cc2] ...] */ - struct rb_id_table *cvc_tbl; - size_t superclass_depth; - VALUE *superclasses; - struct rb_subclass_entry *subclasses; - struct rb_subclass_entry *subclass_entry; - /** - * In the case that this is an `ICLASS`, `module_subclasses` points to the link - * in the module's `subclasses` list that indicates that the klass has been - * included. Hopefully that makes sense. - */ - struct rb_subclass_entry *module_subclass_entry; - const VALUE origin_; - const VALUE refined_class; - union { - struct { - rb_alloc_func_t allocator; - } class; - struct { - VALUE attached_object; - } singleton_class; - } as; - const VALUE includer; - attr_index_t max_iv_count; - unsigned char variation_count; - bool permanent_classpath : 1; - bool cloned : 1; - VALUE classpath; -}; -typedef struct rb_classext_struct rb_classext_t; - -STATIC_ASSERT(shape_max_variations, SHAPE_MAX_VARIATIONS < (1 << (sizeof(((rb_classext_t *)0)->variation_count) * CHAR_BIT))); - -struct RClass { - struct RBasic basic; - VALUE super; - struct rb_id_table *m_tbl; -}; - -// Assert that classes can be embedded in size_pools[2] (which has 160B slot size) -STATIC_ASSERT(sizeof_rb_classext_t, sizeof(struct RClass) + sizeof(rb_classext_t) <= 4 * RVALUE_SIZE); - -struct RClass_and_rb_classext_t { - struct RClass rclass; - rb_classext_t classext; -}; - -#define RCLASS_EXT(c) (&((struct RClass_and_rb_classext_t*)(c))->classext) -#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl) -#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl) -#define RCLASS_IVPTR(c) (RCLASS_EXT(c)->iv_ptr) -#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl) -#define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl) -#define RCLASS_CVC_TBL(c) (RCLASS_EXT(c)->cvc_tbl) -#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_) -#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class) -#define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer) -#define RCLASS_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->subclass_entry) -#define RCLASS_MODULE_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->module_subclass_entry) -#define RCLASS_SUBCLASSES(c) (RCLASS_EXT(c)->subclasses) -#define RCLASS_SUPERCLASS_DEPTH(c) (RCLASS_EXT(c)->superclass_depth) -#define RCLASS_SUPERCLASSES(c) (RCLASS_EXT(c)->superclasses) -#define RCLASS_ATTACHED_OBJECT(c) (RCLASS_EXT(c)->as.singleton_class.attached_object) - -#define RCLASS_IS_ROOT FL_USER0 -#define RICLASS_IS_ORIGIN FL_USER0 -#define RCLASS_SUPERCLASSES_INCLUDE_SELF FL_USER2 -#define RICLASS_ORIGIN_SHARED_MTBL FL_USER3 - -static inline st_table * -RCLASS_IV_HASH(VALUE obj) -{ - RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE)); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - return (st_table *)RCLASS_IVPTR(obj); -} - -static inline void -RCLASS_SET_IV_HASH(VALUE obj, const st_table *tbl) -{ - RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE)); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - RCLASS_IVPTR(obj) = (VALUE *)tbl; -} - -static inline uint32_t -RCLASS_IV_COUNT(VALUE obj) -{ - RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE)); - if (rb_shape_obj_too_complex(obj)) { - uint32_t count; - - // "Too complex" classes could have their IV hash mutated in - // parallel, so lets lock around getting the hash size. - RB_VM_LOCK_ENTER(); - { - count = (uint32_t)rb_st_table_size(RCLASS_IV_HASH(obj)); - } - RB_VM_LOCK_LEAVE(); - - return count; - } - else { - return rb_shape_get_shape_by_id(RCLASS_SHAPE_ID(obj))->next_iv_index; - } -} - -static inline void -RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table) -{ - RUBY_ASSERT(!RB_OBJ_PROMOTED(klass)); - RCLASS_M_TBL(klass) = table; -} - -/* class.c */ -void rb_class_subclass_add(VALUE super, VALUE klass); -void rb_class_remove_from_super_subclasses(VALUE); -void rb_class_update_superclasses(VALUE); -size_t rb_class_superclasses_memsize(VALUE); -void rb_class_remove_subclass_head(VALUE); -int rb_singleton_class_internal_p(VALUE sklass); -VALUE rb_class_boot(VALUE); -VALUE rb_class_s_alloc(VALUE klass); -VALUE rb_module_s_alloc(VALUE klass); -void rb_module_set_initialized(VALUE module); -void rb_module_check_initializable(VALUE module); -VALUE rb_make_metaclass(VALUE, VALUE); -VALUE rb_include_class_new(VALUE, VALUE); -void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE); -void rb_class_detach_subclasses(VALUE); -void rb_class_detach_module_subclasses(VALUE); -void rb_class_remove_from_module_subclasses(VALUE); -VALUE rb_define_class_id_under_no_pin(VALUE outer, ID id, VALUE super); -VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_class_undefined_instance_methods(VALUE mod); -VALUE rb_special_singleton_class(VALUE); -VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach); -VALUE rb_singleton_class_get(VALUE obj); -void rb_undef_methods_from(VALUE klass, VALUE super); - -static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin); -static inline void RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass); -static inline VALUE RCLASS_SUPER(VALUE klass); -static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super); -static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass); - -VALUE rb_class_inherited(VALUE, VALUE); -VALUE rb_keyword_error_new(const char *, VALUE); - -static inline bool -RCLASS_SINGLETON_P(VALUE klass) -{ - return RB_TYPE_P(klass, T_CLASS) && FL_TEST_RAW(klass, FL_SINGLETON); -} - -static inline rb_alloc_func_t -RCLASS_ALLOCATOR(VALUE klass) -{ - if (RCLASS_SINGLETON_P(klass)) { - return 0; - } - return RCLASS_EXT(klass)->as.class.allocator; -} - -static inline void -RCLASS_SET_ALLOCATOR(VALUE klass, rb_alloc_func_t allocator) -{ - assert(!RCLASS_SINGLETON_P(klass)); - RCLASS_EXT(klass)->as.class.allocator = allocator; -} - -static inline void -RCLASS_SET_ORIGIN(VALUE klass, VALUE origin) -{ - RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin); - if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN); -} - -static inline void -RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass) -{ - FL_SET(iclass, RICLASS_ORIGIN_SHARED_MTBL); -} - -static inline bool -RICLASS_OWNS_M_TBL_P(VALUE iclass) -{ - return FL_TEST_RAW(iclass, RICLASS_IS_ORIGIN | RICLASS_ORIGIN_SHARED_MTBL) == RICLASS_IS_ORIGIN; -} - -static inline void -RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass) -{ - RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass); -} - -static inline VALUE -RCLASS_SUPER(VALUE klass) -{ - return RCLASS(klass)->super; -} - -static inline VALUE -RCLASS_SET_SUPER(VALUE klass, VALUE super) -{ - if (super) { - rb_class_remove_from_super_subclasses(klass); - rb_class_subclass_add(super, klass); - } - RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super); - rb_class_update_superclasses(klass); - return super; -} - -static inline void -RCLASS_SET_CLASSPATH(VALUE klass, VALUE classpath, bool permanent) -{ - assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE); - assert(classpath == 0 || BUILTIN_TYPE(classpath) == T_STRING); - - RB_OBJ_WRITE(klass, &(RCLASS_EXT(klass)->classpath), classpath); - RCLASS_EXT(klass)->permanent_classpath = permanent; -} - -static inline VALUE -RCLASS_SET_ATTACHED_OBJECT(VALUE klass, VALUE attached_object) -{ - assert(RCLASS_SINGLETON_P(klass)); - - RB_OBJ_WRITE(klass, &RCLASS_EXT(klass)->as.singleton_class.attached_object, attached_object); - return attached_object; -} - -#endif /* INTERNAL_CLASS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h deleted file mode 100644 index e79b993..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_CMDLINEOPT_H - -#include "rjit.h" -#include "yjit.h" - -typedef struct { - unsigned int mask; - unsigned int set; -} ruby_features_t; - -typedef struct ruby_cmdline_options { - const char *script; - VALUE script_name; - VALUE e_script; - struct { - struct { - VALUE name; - int index; - } enc; - } src, ext, intern; - VALUE req_list; - ruby_features_t features; - ruby_features_t warn; - unsigned int dump; - long backtrace_length_limit; -#if USE_RJIT - struct rb_rjit_options rjit; -#endif - - const char *crash_report; - - signed int sflag: 2; - unsigned int xflag: 1; - unsigned int warning: 1; - unsigned int verbose: 1; - unsigned int do_loop: 1; - unsigned int do_print: 1; - unsigned int do_line: 1; - unsigned int do_split: 1; - unsigned int do_search: 1; - unsigned int setids: 2; -#if USE_YJIT - unsigned int yjit: 1; -#endif -} ruby_cmdline_options_t; - -struct ruby_opt_message { - const char *str; - unsigned short namelen, secondlen; -}; - -#define RUBY_OPT_MESSAGE(shortopt, longopt, desc) { \ - shortopt " " longopt " " desc, \ - (unsigned short)sizeof(shortopt), \ - (unsigned short)sizeof(longopt), \ -} - -#define opt_match(s, l, name) \ - ((((l) > rb_strlen_lit(name)) ? (s)[rb_strlen_lit(name)] == '=' : \ - (l) == rb_strlen_lit(name)) && \ - memcmp((s), name, rb_strlen_lit(name)) == 0 && \ - (((s) += rb_strlen_lit(name)), 1)) - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h deleted file mode 100644 index 9115e4b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef INTERNAL_COMPAR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPAR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Comparable. - */ -#include "internal/basic_operators.h" - -#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString) - -#define CMP_OPTIMIZABLE(type) BASIC_OP_UNREDEFINED_P(BOP_CMP, type##_REDEFINED_OP_FLAG) - -#define OPTIMIZED_CMP(a, b) \ - ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(INTEGER)) ? \ - (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \ - (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(STRING)) ? \ - rb_str_cmp(a, b) : \ - (RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(FLOAT)) ? \ - rb_float_cmp(a, b) : \ - rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b)) - -/* compar.c */ -VALUE rb_invcmp(VALUE, VALUE); - -#endif /* INTERNAL_COMPAR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h deleted file mode 100644 index 2ece539..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef INTERNAL_COMPILE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPILE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the compiler. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/ruby.h" /* for rb_event_flag_t */ - -struct rb_iseq_struct; /* in vm_core.h */ - -/* compile.c */ -int rb_dvar_defined(ID, const struct rb_iseq_struct *); -int rb_local_defined(ID, const struct rb_iseq_struct *); -int rb_insn_len(VALUE insn); -const char *rb_insns_name(int i); -VALUE rb_insns_name_array(void); -int rb_iseq_cdhash_cmp(VALUE val, VALUE lit); -st_index_t rb_iseq_cdhash_hash(VALUE a); - -/* iseq.c */ -int rb_vm_insn_addr2insn(const void *); -int rb_vm_insn_decode(const VALUE encoded); -extern bool ruby_vm_keep_script_lines; - -/* iseq.c (export) */ -rb_event_flag_t rb_iseq_event_flags(const struct rb_iseq_struct *iseq, size_t pos); - -#endif /* INTERNAL_COMPILE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h deleted file mode 100644 index 26c2f05..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef INTERNAL_COMPILERS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPILERS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header absorbing C compiler differences. - */ -#include "ruby/internal/compiler_since.h" -#include "ruby/internal/has/attribute.h" -#include "ruby/internal/has/builtin.h" -#include "ruby/internal/has/c_attribute.h" -#include "ruby/internal/has/declspec_attribute.h" -#include "ruby/internal/has/extension.h" -#include "ruby/internal/has/feature.h" -#include "ruby/internal/has/warning.h" -#include "ruby/backward/2/gcc_version_since.h" - -#define MSC_VERSION_SINCE(_) RBIMPL_COMPILER_SINCE(MSVC, (_) / 100, (_) % 100, 0) -#define MSC_VERSION_BEFORE(_) RBIMPL_COMPILER_BEFORE(MSVC, (_) / 100, (_) % 100, 0) - -#ifndef __has_attribute -# define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__) -#endif - -#ifndef __has_c_attribute -# /* As of writing everything that lacks __has_c_attribute also completely -# * lacks C2x attributes as well. Might change in future? */ -# define __has_c_attribute(...) 0 -#endif - -#ifndef __has_declspec_attribute -# define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__) -#endif - -#ifndef __has_builtin -# define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__) -#endif - -#ifndef __has_feature -# define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__) -#endif - -#ifndef __has_extension -# define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__) -#endif - -#ifndef __has_warning -# define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__) -#endif - -#ifndef __GNUC__ -# define __extension__ /* void */ -#endif - -#ifndef MAYBE_UNUSED -# define MAYBE_UNUSED(x) x -#endif - -#ifndef WARN_UNUSED_RESULT -# define WARN_UNUSED_RESULT(x) x -#endif - -#define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj) -#define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj) -#ifdef __GNUC__ -#define rb_obj_builtin_type(obj) \ -__extension__({ \ - VALUE arg_obj = (obj); \ - RB_SPECIAL_CONST_P(arg_obj) ? -1 : \ - (int)RB_BUILTIN_TYPE(arg_obj); \ - }) -#else -# include "ruby/ruby.h" -static inline int -rb_obj_builtin_type(VALUE obj) -{ - return RB_SPECIAL_CONST_P(obj) ? -1 : - (int)RB_BUILTIN_TYPE(obj); -} -#endif - -/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define FLEX_ARY_LEN /* VALUE ary[]; */ -#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) -# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */ -#else -# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */ -#endif - -/* - * For declaring bitfields out of non-unsigned int types: - * struct date { - * BITFIELD(enum months, month, 4); - * ... - * }; - */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define BITFIELD(type, name, size) type name : size -#else -# define BITFIELD(type, name, size) unsigned int name : size -#endif - -#endif /* INTERNAL_COMPILERS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h deleted file mode 100644 index 4215165..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPLEX_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Complex. - */ -#include "ruby/internal/value.h" /* for struct RBasic */ - -struct RComplex { - struct RBasic basic; - VALUE real; - VALUE imag; -}; - -#define RCOMPLEX(obj) ((struct RComplex *)(obj)) - -/* shortcut macro for internal only */ -#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r)) -#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i)) - -/* complex.c */ -VALUE rb_dbl_complex_new_polar_pi(double abs, double ang); -st_index_t rb_complex_hash(VALUE comp); - -#endif /* INTERNAL_COMPLEX_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h deleted file mode 100644 index 3c2528a..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef INTERNAL_CONT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_CONT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Fiber. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "iseq.h" - -struct rb_thread_struct; /* in vm_core.h */ -struct rb_fiber_struct; /* in cont.c */ -struct rb_execution_context_struct; /* in vm_core.c */ - -/* cont.c */ -void rb_fiber_reset_root_local_storage(struct rb_thread_struct *); -void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE)); -void rb_jit_cont_init(void); -void rb_jit_cont_each_iseq(rb_iseq_callback callback, void *data); -void rb_jit_cont_finish(void); - -/* vm.c */ -void rb_free_shared_fiber_pool(void); - -// Copy locals from the current execution to the specified fiber. -VALUE rb_fiber_inherit_storage(struct rb_execution_context_struct *ec, struct rb_fiber_struct *fiber); - -VALUE rb_fiberptr_self(struct rb_fiber_struct *fiber); -unsigned int rb_fiberptr_blocking(struct rb_fiber_struct *fiber); -struct rb_execution_context_struct * rb_fiberptr_get_ec(struct rb_fiber_struct *fiber); - -#endif /* INTERNAL_CONT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h deleted file mode 100644 index 0a4dc90..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_DIR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_DIR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Dir. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* dir.c */ -VALUE rb_dir_getwd_ospath(void); - -#endif /* INTERNAL_DIR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h deleted file mode 100644 index a005dc8..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef INTERNAL_ENC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Encoding. - */ -#include "ruby/encoding.h" /* for rb_encoding */ - -/* us_ascii.c */ -extern rb_encoding OnigEncodingUS_ASCII; - -/* utf_8.c */ -extern rb_encoding OnigEncodingUTF_8; - -#endif /* INTERNAL_ENC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h deleted file mode 100644 index fe9ea10..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef INTERNAL_ENCODING_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENCODING_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Encoding. - */ -#include "ruby/ruby.h" /* for ID */ -#include "ruby/encoding.h" /* for rb_encoding */ - -#define rb_enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc)) -#define rb_is_usascii_enc(enc) ((enc) == rb_usascii_encoding()) -#define rb_is_ascii8bit_enc(enc) ((enc) == rb_ascii8bit_encoding()) -#define rb_is_locale_enc(enc) ((enc) == rb_locale_encoding()) - -/* encoding.c */ -ID rb_id_encoding(void); -const char * rb_enc_inspect_name(rb_encoding *enc); -rb_encoding *rb_enc_get_from_index(int index); -rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2); -int rb_encdb_replicate(const char *alias, const char *orig); -int rb_encdb_alias(const char *alias, const char *orig); -int rb_enc_autoload(rb_encoding *enc); -int rb_encdb_dummy(const char *name); -void rb_encdb_declare(const char *name); -void rb_enc_set_base(const char *name, const char *orig); -int rb_enc_set_dummy(int index); -PUREFUNC(int rb_data_is_encoding(VALUE obj)); - -/* vm.c */ -void rb_free_global_enc_table(void); - -#endif /* INTERNAL_ENCODING_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h deleted file mode 100644 index 2824644..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef INTERNAL_ENUM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENUM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Enumerable. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* enum.c */ -extern VALUE rb_cArithSeq; -VALUE rb_f_send(int argc, VALUE *argv, VALUE recv); -VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary); - -#endif /* INTERNAL_ENUM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h deleted file mode 100644 index e11a684..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef INTERNAL_ENUMERATOR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENUMERATOR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Enumerator. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/intern.h" /* for rb_enumerator_size_func */ - -RUBY_SYMBOL_EXPORT_BEGIN -/* enumerator.c (export) */ -VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv, - rb_enumerator_size_func *size_fn, - VALUE beg, VALUE end, VALUE step, int excl); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_ENUMERATOR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h deleted file mode 100644 index 7e41f13..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h +++ /dev/null @@ -1,216 +0,0 @@ -#ifndef INTERNAL_ERROR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ERROR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Exception. - */ -#include "ruby/internal/config.h" -#include /* for va_list */ -#include "internal/string.h" /* for rb_fstring_cstr */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/encoding.h" /* for rb_encoding */ -#include "ruby/intern.h" /* for rb_exc_raise */ -#include "ruby/ruby.h" /* for enum ruby_value_type */ - -#ifdef Check_Type -# undef Check_Type /* in ruby/ruby.h */ -#endif - -#ifdef rb_raise_static -# undef rb_raise_static -# undef rb_sys_fail_path -# undef rb_syserr_fail_path -#endif - -#define rb_raise_static(e, m) \ - rb_raise_cstr_i((e), rb_str_new_static((m), rb_strlen_lit(m))) -#ifdef RUBY_FUNCTION_NAME_STRING -# define rb_syserr_fail_path(err, path) rb_syserr_fail_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path)) -# define rb_syserr_new_path(err, path) rb_syserr_new_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path)) -#else -# define rb_syserr_fail_path(err, path) rb_syserr_fail_str((err), (path)) -# define rb_syserr_new_path(err, path) rb_syserr_new_str((err), (path)) -#endif - -#define rb_sys_fail(mesg) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail(errno_to_fail, (mesg)); \ -} while (0) - -#define rb_sys_fail_str(mesg) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail_str(errno_to_fail, (mesg)); \ -} while (0) - -#define rb_sys_fail_path(path) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail_path(errno_to_fail, (path)); \ -} while (0) - -#define rb_sys_fail_sprintf(...) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail_str(errno_to_fail, rb_sprintf("" __VA_ARGS__)); \ -} while (0) - -/* error.c */ -extern long rb_backtrace_length_limit; -extern VALUE rb_eEAGAIN; -extern VALUE rb_eEWOULDBLOCK; -extern VALUE rb_eEINPROGRESS; -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 0) -void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args); -NORETURN(void rb_async_bug_errno(const char *,int)); -const char *rb_builtin_type_name(int t); -const char *rb_builtin_class_name(VALUE x); -PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3); -PRINTF_ARGS(void rb_warn_deprecated_to_remove(const char *removal, const char *fmt, const char *suggest, ...), 2, 4); -#if RUBY_DEBUG -# include "ruby/version.h" -# define RUBY_VERSION_SINCE(major, minor) (RUBY_API_VERSION_CODE >= (major * 10000) + (minor) * 100) -# define RUBY_VERSION_BEFORE(major, minor) (RUBY_API_VERSION_CODE < (major * 10000) + (minor) * 100) -# if defined(RBIMPL_WARNING_PRAGMA0) -# define RBIMPL_TODO0(x) RBIMPL_WARNING_PRAGMA0(message(x)) -# elif RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0) -# define RBIMPL_TODO0(x) __pragma(message(x)) -# endif - -# if RBIMPL_HAS_ATTRIBUTE(diagnose_if) || defined(__OPTIMIZE__) - -#define RUBY_VERSION_isdigit(c) ('0'<=(c)&&(c)<='9') -// upto 99 -#define RUBY_VERSION__number_len(v, ofs) \ - (!RUBY_VERSION_isdigit((v)[ofs]) ? \ - 0 : !RUBY_VERSION_isdigit((v)[(ofs) + 1]) ? 1 : 2) -#define RUBY_VERSION__to_number(v, ofs) \ - (!RUBY_VERSION_isdigit((v)[ofs]) ? \ - 0 : !RUBY_VERSION_isdigit((v)[(ofs) + 1]) ? \ - ((v)[ofs]-'0') : \ - (((v)[ofs]-'0')*10+(v)[(ofs)+1]-'0')) - -#define RUBY_VERSION_CODE_FROM_MAJOR_MINOR_STRING(v) \ - (RUBY_VERSION__to_number(v, 0) * 10000 + \ - ((v)[RUBY_VERSION__number_len(v, 0)] == '.' ? \ - RUBY_VERSION__to_number(v, RUBY_VERSION__number_len(v, 0)+1) * 100 : 0)) -#define RUBY_VERSION_STRING_SINCE(v) (RUBY_API_VERSION_CODE >= RUBY_VERSION_CODE_FROM_MAJOR_MINOR_STRING(v)) -#define RUBY_VERSION_STRING_BEFORE(v) (RUBY_API_VERSION_CODE < RUBY_VERSION_CODE_FROM_MAJOR_MINOR_STRING(v)) - -# if RBIMPL_HAS_ATTRIBUTE(diagnose_if) -RBIMPL_ATTR_FORCEINLINE() -static void -rb_deprecated_method_to_be_removed(const char *removal) - RBIMPL_ATTR_DIAGNOSE_IF(!RUBY_VERSION_isdigit(removal[0]), "malformed version number", "error") - RBIMPL_ATTR_DIAGNOSE_IF(RUBY_VERSION_STRING_SINCE(removal), "deprecated method to be removed", "error") -{ -} -# else -RBIMPL_ATTR_ERROR(("deprecated")) -void rb_deprecated_method_to_be_removed(const char *); -# define rb_deprecated_method_to_be_removed(removal) \ - (sizeof(char[1-2*(!RUBY_VERSION_isdigit(removal[0]) || RUBY_VERSION_STRING_SINCE(removal))])!=1 ? \ - rb_deprecated_method_to_be_removed(removal) : \ - RBIMPL_ASSERT_NOTHING) -# endif -# define rb_warn_deprecated_to_remove_at(removal, ...) \ - (rb_deprecated_method_to_be_removed(#removal), \ - rb_warn_deprecated_to_remove(#removal, __VA_ARGS__)) -# endif -#endif -#ifndef rb_warn_deprecated_to_remove_at -# define rb_warn_deprecated_to_remove_at(removal, ...) \ - rb_warn_deprecated_to_remove(#removal, __VA_ARGS__) -#endif -#ifndef RUBY_VERSION_SINCE -# define RUBY_VERSION_SINCE(major, minor) 0 -#endif -#ifndef RUBY_VERSION_BEFORE -# define RUBY_VERSION_BEFORE(major, minor) 0 -#endif -#ifndef RBIMPL_TODO0 -# define RBIMPL_TODO0(x) -#endif -#define RBIMPL_TODO(message) RBIMPL_TODO0("TODO: " message) -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 6, 0) -VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list); -PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3); -PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3); -PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4); -rb_warning_category_t rb_warning_category_from_name(VALUE category); -bool rb_warning_category_enabled_p(rb_warning_category_t category); -VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method); -VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv); -VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name); -PRINTF_ARGS(VALUE rb_warning_string(const char *fmt, ...), 1, 2); -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 2, 0) -NORETURN(void rb_vraise(VALUE, const char *, va_list)); -NORETURN(static inline void rb_raise_cstr(VALUE etype, const char *mesg)); -NORETURN(static inline void rb_raise_cstr_i(VALUE etype, VALUE mesg)); -NORETURN(static inline void rb_name_err_raise_str(VALUE mesg, VALUE recv, VALUE name)); -NORETURN(static inline void rb_name_err_raise(const char *mesg, VALUE recv, VALUE name)); -NORETURN(static inline void rb_key_err_raise(VALUE mesg, VALUE recv, VALUE name)); -static inline void Check_Type(VALUE v, enum ruby_value_type t); -static inline bool rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type); -#define rb_typeddata_is_instance_of rb_typeddata_is_instance_of_inline - -RUBY_SYMBOL_EXPORT_BEGIN -/* error.c (export) */ -int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data); -#ifdef RUBY_FUNCTION_NAME_STRING -NORETURN(void rb_sys_fail_path_in(const char *func_name, VALUE path)); -NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path)); -VALUE rb_syserr_new_path_in(const char *func_name, int n, VALUE path); -#endif -RUBY_SYMBOL_EXPORT_END - -/* vm.c */ -void rb_free_warning(void); - -static inline void -rb_raise_cstr_i(VALUE etype, VALUE mesg) -{ - VALUE exc = rb_exc_new_str(etype, mesg); - rb_exc_raise(exc); -} - -static inline void -rb_raise_cstr(VALUE etype, const char *mesg) -{ - VALUE str = rb_str_new_cstr(mesg); - rb_raise_cstr_i(etype, str); -} - -static inline void -rb_name_err_raise_str(VALUE mesg, VALUE recv, VALUE name) -{ - VALUE exc = rb_name_err_new(mesg, recv, name); - rb_exc_raise(exc); -} - -static inline void -rb_name_err_raise(const char *mesg, VALUE recv, VALUE name) -{ - VALUE str = rb_fstring_cstr(mesg); - rb_name_err_raise_str(str, recv, name); -} - -static inline void -rb_key_err_raise(VALUE mesg, VALUE recv, VALUE name) -{ - VALUE exc = rb_key_err_new(mesg, recv, name); - rb_exc_raise(exc); -} - -static inline bool -rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type) -{ - return RB_TYPE_P(obj, T_DATA) && RTYPEDDATA_P(obj) && (RTYPEDDATA_TYPE(obj) == data_type); -} - -#endif /* INTERNAL_ERROR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h deleted file mode 100644 index e594d85..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef INTERNAL_EVAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_EVAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the evaluator. - * @note There also is eval_intern.h, which is evaluator's internal - * header (related to this file, but not the same role). - */ -#include "ruby/ruby.h" /* for ID */ - -#define id_signo ruby_static_id_signo -#define id_status ruby_static_id_status - -/* eval.c */ -extern ID ruby_static_id_signo; -extern ID ruby_static_id_status; -VALUE rb_refinement_module_get_refined_class(VALUE module); -void rb_class_modify_check(VALUE); -NORETURN(VALUE rb_f_raise(int argc, VALUE *argv)); -VALUE rb_top_main_class(const char *method); - -/* eval_error.c */ -VALUE rb_get_backtrace(VALUE info); - -/* eval_jump.c */ -void rb_call_end_proc(VALUE data); -void rb_mark_end_proc(void); - -#endif /* INTERNAL_EVAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h deleted file mode 100644 index 9c192ff..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef INTERNAL_FILE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_FILE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for File. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/encoding.h" /* for rb_encodinng */ - -/* file.c */ -extern const char ruby_null_device[]; -VALUE rb_home_dir_of(VALUE user, VALUE result); -VALUE rb_default_home_dir(VALUE result); -VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict); -VALUE rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *origenc); -void rb_file_const(const char*, VALUE); -int rb_file_load_ok(const char *); -VALUE rb_file_expand_path_fast(VALUE, VALUE); -VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE); -VALUE rb_get_path_check_to_string(VALUE); -VALUE rb_get_path_check_convert(VALUE); -int ruby_is_fd_loadable(int fd); - -RUBY_SYMBOL_EXPORT_BEGIN -/* file.c (export) */ -#ifdef HAVE_READLINK -VALUE rb_readlink(VALUE path, rb_encoding *enc); -#endif -#ifdef __APPLE__ -VALUE rb_str_normalize_ospath(const char *ptr, long len); -#endif -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_FILE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h deleted file mode 100644 index 8c251ad..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h +++ /dev/null @@ -1,184 +0,0 @@ -#ifndef INTERNAL_FIXNUM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_FIXNUM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Fixnums. - */ -#include "ruby/internal/config.h" /* for HAVE_LONG_LONG */ -#include /* for CHAR_BIT */ -#include "internal/compilers.h" /* for __has_builtin */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/intern.h" /* for rb_big_mul */ -#include "ruby/ruby.h" /* for RB_FIXABLE */ - -#if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG -# define DLONG LONG_LONG -# define DL2NUM(x) LL2NUM(x) -#elif defined(HAVE_INT128_T) && !(defined(__OpenBSD__) && defined(__mips64__)) -# define DLONG int128_t -# define DL2NUM(x) (RB_FIXABLE(x) ? LONG2FIX(x) : rb_int128t2big(x)) -VALUE rb_int128t2big(int128_t n); /* in bignum.c */ -#endif - -static inline long rb_overflowed_fix_to_int(long x); -static inline VALUE rb_fix_plus_fix(VALUE x, VALUE y); -static inline VALUE rb_fix_minus_fix(VALUE x, VALUE y); -static inline VALUE rb_fix_mul_fix(VALUE x, VALUE y); -static inline void rb_fix_divmod_fix(VALUE x, VALUE y, VALUE *divp, VALUE *modp); -static inline VALUE rb_fix_div_fix(VALUE x, VALUE y); -static inline VALUE rb_fix_mod_fix(VALUE x, VALUE y); -static inline bool FIXNUM_POSITIVE_P(VALUE num); -static inline bool FIXNUM_NEGATIVE_P(VALUE num); -static inline bool FIXNUM_ZERO_P(VALUE num); - -static inline long -rb_overflowed_fix_to_int(long x) -{ - return (long)((unsigned long)(x >> 1) ^ (1LU << (SIZEOF_LONG * CHAR_BIT - 1))); -} - -static inline VALUE -rb_fix_plus_fix(VALUE x, VALUE y) -{ -#if !__has_builtin(__builtin_add_overflow) - long lz = FIX2LONG(x) + FIX2LONG(y); - return LONG2NUM(lz); -#else - long lz; - /* NOTE - * (1) `LONG2FIX(FIX2LONG(x)+FIX2LONG(y))` - + = `((lx*2+1)/2 + (ly*2+1)/2)*2+1` - + = `lx*2 + ly*2 + 1` - + = `(lx*2+1) + (ly*2+1) - 1` - + = `x + y - 1` - * (2) Fixnum's LSB is always 1. - * It means you can always run `x - 1` without overflow. - * (3) Of course `z = x + (y-1)` may overflow. - * At that time true value is - * * positive: 0b0 1xxx...1, and z = 0b1xxx...1 - * * negative: 0b1 0xxx...1, and z = 0b0xxx...1 - * To convert this true value to long, - * (a) Use arithmetic shift - * * positive: 0b11xxx... - * * negative: 0b00xxx... - * (b) invert MSB - * * positive: 0b01xxx... - * * negative: 0b10xxx... - */ - if (__builtin_add_overflow((long)x, (long)y-1, &lz)) { - return rb_int2big(rb_overflowed_fix_to_int(lz)); - } - else { - return (VALUE)lz; - } -#endif -} - -static inline VALUE -rb_fix_minus_fix(VALUE x, VALUE y) -{ -#if !__has_builtin(__builtin_sub_overflow) - long lz = FIX2LONG(x) - FIX2LONG(y); - return LONG2NUM(lz); -#else - long lz; - if (__builtin_sub_overflow((long)x, (long)y-1, &lz)) { - return rb_int2big(rb_overflowed_fix_to_int(lz)); - } - else { - return (VALUE)lz; - } -#endif -} - -/* arguments must be Fixnum */ -static inline VALUE -rb_fix_mul_fix(VALUE x, VALUE y) -{ - long lx = FIX2LONG(x); - long ly = FIX2LONG(y); -#ifdef DLONG - return DL2NUM((DLONG)lx * (DLONG)ly); -#else - if (MUL_OVERFLOW_FIXNUM_P(lx, ly)) { - return rb_big_mul(rb_int2big(lx), rb_int2big(ly)); - } - else { - return LONG2FIX(lx * ly); - } -#endif -} - -/* - * This behaves different from C99 for negative arguments. - * Note that div may overflow fixnum. - */ -static inline void -rb_fix_divmod_fix(VALUE a, VALUE b, VALUE *divp, VALUE *modp) -{ - /* assume / and % comply C99. - * ldiv(3) won't be inlined by GCC and clang. - * I expect / and % are compiled as single idiv. - */ - long x = FIX2LONG(a); - long y = FIX2LONG(b); - long div, mod; - if (x == FIXNUM_MIN && y == -1) { - if (divp) *divp = LONG2NUM(-FIXNUM_MIN); - if (modp) *modp = LONG2FIX(0); - return; - } - div = x / y; - mod = x % y; - if (y > 0 ? mod < 0 : mod > 0) { - mod += y; - div -= 1; - } - if (divp) *divp = LONG2FIX(div); - if (modp) *modp = LONG2FIX(mod); -} - -/* div() for Ruby - * This behaves different from C99 for negative arguments. - */ -static inline VALUE -rb_fix_div_fix(VALUE x, VALUE y) -{ - VALUE div; - rb_fix_divmod_fix(x, y, &div, NULL); - return div; -} - -/* mod() for Ruby - * This behaves different from C99 for negative arguments. - */ -static inline VALUE -rb_fix_mod_fix(VALUE x, VALUE y) -{ - VALUE mod; - rb_fix_divmod_fix(x, y, NULL, &mod); - return mod; -} - -static inline bool -FIXNUM_POSITIVE_P(VALUE num) -{ - return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0); -} - -static inline bool -FIXNUM_NEGATIVE_P(VALUE num) -{ - return (SIGNED_VALUE)num < 0; -} - -static inline bool -FIXNUM_ZERO_P(VALUE num) -{ - return num == INT2FIX(0); -} -#endif /* INTERNAL_FIXNUM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h deleted file mode 100644 index ecc3f11..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h +++ /dev/null @@ -1,334 +0,0 @@ -#ifndef INTERNAL_GC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_GC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for GC. - */ -#include "ruby/internal/config.h" - -#include /* for size_t */ - -#include "internal/compilers.h" /* for __has_attribute */ -#include "ruby/ruby.h" /* for rb_event_flag_t */ -#include "vm_core.h" /* for GET_EC() */ - -#ifndef USE_SHARED_GC -# define USE_SHARED_GC 0 -#endif - -#if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p))) -#elif defined(__i386) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p))) -#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && !defined(_AIX) && !defined(__APPLE__) // Not Apple is NEEDED to unbreak ppc64 build on Darwin. Don't ask. -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p))) -#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && defined(_AIX) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr %0,1" : "=r" (*(p))) -#elif defined(__POWERPC__) && defined(__APPLE__) // Darwin ppc and ppc64 -#define SET_MACHINE_STACK_END(p) __asm__ volatile("mr %0, r1" : "=r" (*(p))) -#elif defined(__aarch64__) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mov\t%0, sp" : "=r" (*(p))) -#else -NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p)); -#define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p) -#define USE_CONSERVATIVE_STACK_END -#endif - -/* for GC debug */ - -#ifndef RUBY_MARK_FREE_DEBUG -#define RUBY_MARK_FREE_DEBUG 0 -#endif - -#if RUBY_MARK_FREE_DEBUG -extern int ruby_gc_debug_indent; - -static inline void -rb_gc_debug_indent(void) -{ - ruby_debug_printf("%*s", ruby_gc_debug_indent, ""); -} - -static inline void -rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr) -{ - if (st == 0) { - ruby_gc_debug_indent--; - } - rb_gc_debug_indent(); - ruby_debug_printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr); - - if (st) { - ruby_gc_debug_indent++; - } - - fflush(stdout); -} - -#define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", (msg), 1, ptr) -#define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", (msg), 0, ptr) -#define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", (msg), 1, ptr) -#define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", (msg), 0, ptr) -#define RUBY_GC_INFO rb_gc_debug_indent(), ruby_debug_printf - -#else -#define RUBY_MARK_ENTER(msg) -#define RUBY_MARK_LEAVE(msg) -#define RUBY_FREE_ENTER(msg) -#define RUBY_FREE_LEAVE(msg) -#define RUBY_GC_INFO if(0)printf -#endif - -#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;} - -#if STACK_GROW_DIRECTION > 0 -# define STACK_UPPER(x, a, b) (a) -#elif STACK_GROW_DIRECTION < 0 -# define STACK_UPPER(x, a, b) (b) -#else -RUBY_EXTERN int ruby_stack_grow_direction; -int ruby_get_stack_grow_direction(volatile VALUE *addr); -# define stack_growup_p(x) ( \ - (ruby_stack_grow_direction ? \ - ruby_stack_grow_direction : \ - ruby_get_stack_grow_direction(x)) > 0) -# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b)) -#endif - -/* - STACK_GROW_DIR_DETECTION is used with STACK_DIR_UPPER. - - On most normal systems, stacks grow from high address to lower address. In - this case, STACK_DIR_UPPER(a, b) will return (b), but on exotic systems where - the stack grows UP (from low address to high address), it will return (a). -*/ - -#if STACK_GROW_DIRECTION -#define STACK_GROW_DIR_DETECTION -#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, (a), (b)) -#else -#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection -#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b)) -#endif -#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0) - -const char *rb_obj_info(VALUE obj); -const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj); - -struct rb_execution_context_struct; /* in vm_core.h */ -struct rb_objspace; /* in vm_core.h */ - -#define NEWOBJ_OF(var, T, c, f, s, ec) \ - T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \ - rb_wb_protected_newobj_of((ec ? ec : GET_EC()), (c), (f) & ~FL_WB_PROTECTED, s) : \ - rb_wb_unprotected_newobj_of((c), (f), s)) - -#define RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */ - -#ifndef USE_UNALIGNED_MEMBER_ACCESS -# define UNALIGNED_MEMBER_ACCESS(expr) (expr) -#elif ! USE_UNALIGNED_MEMBER_ACCESS -# define UNALIGNED_MEMBER_ACCESS(expr) (expr) -#elif ! (__has_warning("-Waddress-of-packed-member") || GCC_VERSION_SINCE(9, 0, 0)) -# define UNALIGNED_MEMBER_ACCESS(expr) (expr) -#else -# include "internal/warnings.h" -# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \ - __typeof__(expr) unaligned_member_access_result = (expr); \ - COMPILER_WARNING_POP; \ - unaligned_member_access_result; \ -}) - -# define UNALIGNED_MEMBER_PTR(ptr, mem) __extension__({ \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \ - const volatile void *unaligned_member_ptr_result = &(ptr)->mem; \ - COMPILER_WARNING_POP; \ - (__typeof__((ptr)->mem) *)unaligned_member_ptr_result; \ -}) -#endif - -#ifndef UNALIGNED_MEMBER_PTR -# define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) -#endif - -#define RB_OBJ_WRITE_UNALIGNED(old, slot, young) do { \ - VALUE *_slot = UNALIGNED_MEMBER_ACCESS(slot); \ - RB_OBJ_WRITE(old, _slot, young); \ -} while (0) - -// We use SIZE_POOL_COUNT number of shape IDs for transitions out of different size pools -// The next available shape ID will be the SPECIAL_CONST_SHAPE_ID -#ifndef SIZE_POOL_COUNT -# define SIZE_POOL_COUNT 5 -#endif - -/* Used in places that could malloc during, which can cause the GC to run. We - * need to temporarily disable the GC to allow the malloc to happen. - * Allocating memory during GC is a bad idea, so use this only when absolutely - * necessary. */ -#define DURING_GC_COULD_MALLOC_REGION_START() \ - assert(rb_during_gc()); \ - VALUE _already_disabled = rb_gc_disable_no_rest() - -#define DURING_GC_COULD_MALLOC_REGION_END() \ - if (_already_disabled == Qfalse) rb_gc_enable() - -typedef struct ractor_newobj_size_pool_cache { - struct RVALUE *freelist; - struct heap_page *using_page; -} rb_ractor_newobj_size_pool_cache_t; - -typedef struct ractor_newobj_cache { - size_t incremental_mark_step_allocated_slots; - rb_ractor_newobj_size_pool_cache_t size_pool_caches[SIZE_POOL_COUNT]; -} rb_ractor_newobj_cache_t; - -/* gc.c */ -extern int ruby_disable_gc; -RUBY_ATTR_MALLOC void *ruby_mimmalloc(size_t size); -RUBY_ATTR_MALLOC void *ruby_mimcalloc(size_t num, size_t size); -void ruby_mimfree(void *ptr); -void rb_gc_prepare_heap(void); -void rb_objspace_set_event_hook(const rb_event_flag_t event); -VALUE rb_objspace_gc_enable(struct rb_objspace *); -VALUE rb_objspace_gc_disable(struct rb_objspace *); -void ruby_gc_set_params(void); -void rb_gc_copy_attributes(VALUE dest, VALUE obj); -size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */ -size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */ -size_t rb_malloc_grow_capa(size_t current_capacity, size_t type_size); -RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add(size_t, size_t, size_t); -RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add(size_t, size_t, size_t); -void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t); -RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t); -RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t); -static inline void *ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2)); -static inline void *ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3)); -static inline void ruby_sized_xfree_inlined(void *ptr, size_t size); -void rb_gc_ractor_newobj_cache_clear(rb_ractor_newobj_cache_t *newobj_cache); -bool rb_gc_size_allocatable_p(size_t size); -size_t *rb_gc_size_pool_sizes(void); -size_t rb_gc_size_pool_id_for_size(size_t size); -int rb_objspace_garbage_object_p(VALUE obj); -bool rb_gc_is_ptr_to_obj(const void *ptr); - -void rb_gc_mark_and_move(VALUE *ptr); - -void rb_gc_mark_weak(VALUE *ptr); -void rb_gc_remove_weak(VALUE parent_obj, VALUE *ptr); - -void rb_gc_ref_update_table_values_only(st_table *tbl); - -void rb_gc_initial_stress_set(VALUE flag); - -#define rb_gc_mark_and_move_ptr(ptr) do { \ - VALUE _obj = (VALUE)*(ptr); \ - rb_gc_mark_and_move(&_obj); \ - if (_obj != (VALUE)*(ptr)) *(ptr) = (void *)_obj; \ -} while (0) - -RUBY_SYMBOL_EXPORT_BEGIN -/* exports for objspace module */ -void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data); -void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data); -int rb_objspace_markable_object_p(VALUE obj); -int rb_objspace_internal_object_p(VALUE obj); - -void rb_objspace_each_objects( - int (*callback)(void *start, void *end, size_t stride, void *data), - void *data); - -size_t rb_gc_obj_slot_size(VALUE obj); - -VALUE rb_gc_disable_no_rest(void); - - -/* gc.c (export) */ -const char *rb_objspace_data_type_name(VALUE obj); -VALUE rb_wb_protected_newobj_of(struct rb_execution_context_struct *, VALUE, VALUE, size_t); -VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE, size_t); -size_t rb_obj_memsize_of(VALUE); -void rb_gc_verify_internal_consistency(void); -size_t rb_obj_gc_flags(VALUE, ID[], size_t); -void rb_gc_mark_values(long n, const VALUE *values); -void rb_gc_mark_vm_stack_values(long n, const VALUE *values); -void rb_gc_update_values(long n, VALUE *values); -void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2)); -void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3)); -void ruby_sized_xfree(void *x, size_t size); -RUBY_SYMBOL_EXPORT_END - -int rb_ec_stack_check(struct rb_execution_context_struct *ec); -void rb_gc_writebarrier_remember(VALUE obj); -const char *rb_obj_info(VALUE obj); - -#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32) - -static inline void * -ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) -{ - return ruby_xrealloc(ptr, new_size); -} - -static inline void * -ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) -{ - return ruby_xrealloc2(ptr, new_count, elemsiz); -} - -static inline void -ruby_sized_xfree_inlined(void *ptr, size_t size) -{ - ruby_xfree(ptr); -} - -# define SIZED_REALLOC_N(x, y, z, w) REALLOC_N(x, y, z) - -static inline void * -ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count) -{ - return ruby_xrealloc2(ptr, new_count, element_size); -} - -#else - -static inline void * -ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) -{ - return ruby_sized_xrealloc(ptr, new_size, old_size); -} - -static inline void * -ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) -{ - return ruby_sized_xrealloc2(ptr, new_count, elemsiz, old_count); -} - -static inline void -ruby_sized_xfree_inlined(void *ptr, size_t size) -{ - ruby_sized_xfree(ptr, size); -} - -# define SIZED_REALLOC_N(v, T, m, n) \ - ((v) = (T *)ruby_sized_xrealloc2((void *)(v), (m), sizeof(T), (n))) - -static inline void * -ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count) -{ - return ruby_sized_xrealloc2(ptr, new_count, element_size, old_count); -} - -#endif /* HAVE_MALLOC_USABLE_SIZE */ - -#define ruby_sized_xrealloc ruby_sized_xrealloc_inlined -#define ruby_sized_xrealloc2 ruby_sized_xrealloc2_inlined -#define ruby_sized_xfree ruby_sized_xfree_inlined -#endif /* INTERNAL_GC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h deleted file mode 100644 index fe859cb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef INTERNAL_HASH_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_HASH_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Hash. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for struct RBasic */ -#include "ruby/st.h" /* for struct st_table */ - -#define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE - -struct ar_table_struct; -typedef unsigned char ar_hint_t; - -enum ruby_rhash_flags { - RHASH_PASS_AS_KEYWORDS = FL_USER1, /* FL 1 */ - RHASH_PROC_DEFAULT = FL_USER2, /* FL 2 */ - RHASH_ST_TABLE_FLAG = FL_USER3, /* FL 3 */ - RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7), /* FL 4..7 */ - RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4), - RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */ - RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8), - - // we can not put it in "enum" because it can exceed "int" range. -#define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \ - FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19) - - RHASH_LEV_SHIFT = (FL_USHIFT + 13), - RHASH_LEV_MAX = 127, /* 7 bits */ -}; - -typedef struct ar_table_pair_struct { - VALUE key; - VALUE val; -} ar_table_pair; - -typedef struct ar_table_struct { - union { - ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE]; - VALUE word; - } ar_hint; - /* 64bit CPU: 8B * 2 * 8 = 128B */ - ar_table_pair pairs[RHASH_AR_TABLE_MAX_SIZE]; -} ar_table; - -struct RHash { - struct RBasic basic; - const VALUE ifnone; -}; - -#define RHASH(obj) ((struct RHash *)(obj)) - -#ifdef RHASH_IFNONE -# undef RHASH_IFNONE -#endif - -#ifdef RHASH_SIZE -# undef RHASH_SIZE -#endif - -#ifdef RHASH_EMPTY_P -# undef RHASH_EMPTY_P -#endif - -/* hash.c */ -void rb_hash_st_table_set(VALUE hash, st_table *st); -VALUE rb_hash_default_value(VALUE hash, VALUE key); -VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc); -long rb_dbl_long_hash(double d); -st_table *rb_init_identtable(void); -st_index_t rb_any_hash(VALUE a); -int rb_any_cmp(VALUE a, VALUE b); -VALUE rb_to_hash_type(VALUE obj); -VALUE rb_hash_key_str(VALUE); -VALUE rb_hash_values(VALUE hash); -VALUE rb_hash_rehash(VALUE hash); -int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val); -VALUE rb_hash_set_pair(VALUE hash, VALUE pair); -int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval); -int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg); -int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg); -VALUE rb_ident_hash_new_with_size(st_index_t size); -void rb_hash_free(VALUE hash); - -static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h); -static inline VALUE RHASH_IFNONE(VALUE h); -static inline size_t RHASH_SIZE(VALUE h); -static inline bool RHASH_EMPTY_P(VALUE h); -static inline bool RHASH_AR_TABLE_P(VALUE h); -static inline bool RHASH_ST_TABLE_P(VALUE h); -static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h); -static inline st_table *RHASH_ST_TABLE(VALUE h); -static inline size_t RHASH_ST_SIZE(VALUE h); -static inline void RHASH_ST_CLEAR(VALUE h); - -RUBY_SYMBOL_EXPORT_BEGIN -/* hash.c (export) */ -VALUE rb_hash_delete_entry(VALUE hash, VALUE key); -VALUE rb_ident_hash_new(void); -int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_hash_new_with_size(st_index_t size); -VALUE rb_hash_resurrect(VALUE hash); -int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval); -VALUE rb_hash_keys(VALUE hash); -VALUE rb_hash_has_key(VALUE hash, VALUE key); -VALUE rb_hash_compare_by_id_p(VALUE hash); - -st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line); -#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__) - -VALUE rb_hash_compare_by_id(VALUE hash); - -static inline bool -RHASH_AR_TABLE_P(VALUE h) -{ - return ! FL_TEST_RAW(h, RHASH_ST_TABLE_FLAG); -} - -RBIMPL_ATTR_RETURNS_NONNULL() -static inline struct ar_table_struct * -RHASH_AR_TABLE(VALUE h) -{ - return (struct ar_table_struct *)((uintptr_t)h + sizeof(struct RHash)); -} - -RBIMPL_ATTR_RETURNS_NONNULL() -static inline st_table * -RHASH_ST_TABLE(VALUE h) -{ - return (st_table *)((uintptr_t)h + sizeof(struct RHash)); -} - -static inline VALUE -RHASH_IFNONE(VALUE h) -{ - return RHASH(h)->ifnone; -} - -static inline size_t -RHASH_SIZE(VALUE h) -{ - if (RHASH_AR_TABLE_P(h)) { - return RHASH_AR_TABLE_SIZE_RAW(h); - } - else { - return RHASH_ST_SIZE(h); - } -} - -static inline bool -RHASH_EMPTY_P(VALUE h) -{ - return RHASH_SIZE(h) == 0; -} - -static inline bool -RHASH_ST_TABLE_P(VALUE h) -{ - return ! RHASH_AR_TABLE_P(h); -} - -static inline size_t -RHASH_ST_SIZE(VALUE h) -{ - return RHASH_ST_TABLE(h)->num_entries; -} - -static inline void -RHASH_ST_CLEAR(VALUE h) -{ - memset(RHASH_ST_TABLE(h), 0, sizeof(st_table)); -} - -static inline unsigned -RHASH_AR_TABLE_SIZE_RAW(VALUE h) -{ - VALUE ret = FL_TEST_RAW(h, RHASH_AR_TABLE_SIZE_MASK); - ret >>= RHASH_AR_TABLE_SIZE_SHIFT; - return (unsigned)ret; -} - -#endif /* INTERNAL_HASH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h deleted file mode 100644 index 36c0776..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h +++ /dev/null @@ -1,260 +0,0 @@ -#ifndef INTERNAL_IMEMO_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_IMEMO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief IMEMO: Internal memo object. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "internal/array.h" /* for rb_ary_hidden_new_fill */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for rb_block_call_func_t */ - -#ifndef IMEMO_DEBUG -# define IMEMO_DEBUG 0 -#endif - -#define IMEMO_MASK 0x0f - -/* FL_USER0 to FL_USER3 is for type */ -#define IMEMO_FL_USHIFT (FL_USHIFT + 4) -#define IMEMO_FL_USER0 FL_USER4 -#define IMEMO_FL_USER1 FL_USER5 -#define IMEMO_FL_USER2 FL_USER6 -#define IMEMO_FL_USER3 FL_USER7 -#define IMEMO_FL_USER4 FL_USER8 -#define IMEMO_FL_USER5 FL_USER9 - -enum imemo_type { - imemo_env = 0, - imemo_cref = 1, /*!< class reference */ - imemo_svar = 2, /*!< special variable */ - imemo_throw_data = 3, - imemo_ifunc = 4, /*!< iterator function */ - imemo_memo = 5, - imemo_ment = 6, - imemo_iseq = 7, - imemo_tmpbuf = 8, - imemo_ast = 9, // Obsolete due to the universal parser - imemo_parser_strterm = 10, - imemo_callinfo = 11, - imemo_callcache = 12, - imemo_constcache = 13, -}; - -/* CREF (Class REFerence) is defined in method.h */ - -/*! SVAR (Special VARiable) */ -struct vm_svar { - VALUE flags; - const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */ - const VALUE lastline; - const VALUE backref; - const VALUE others; -}; - -/*! THROW_DATA */ -struct vm_throw_data { - VALUE flags; - VALUE reserved; - const VALUE throw_obj; - const struct rb_control_frame_struct *catch_frame; - int throw_state; -}; - -#define THROW_DATA_CONSUMED IMEMO_FL_USER0 - -/* IFUNC (Internal FUNCtion) */ - -struct vm_ifunc_argc { -#if SIZEOF_INT * 2 > SIZEOF_VALUE - signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2; - signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2; -#else - int min, max; -#endif -}; - -/*! IFUNC (Internal FUNCtion) */ -struct vm_ifunc { - VALUE flags; - VALUE *svar_lep; - rb_block_call_func_t func; - const void *data; - struct vm_ifunc_argc argc; -}; - -struct rb_imemo_tmpbuf_struct { - VALUE flags; - VALUE reserved; - VALUE *ptr; /* malloc'ed buffer */ - struct rb_imemo_tmpbuf_struct *next; /* next imemo */ - size_t cnt; /* buffer size in VALUE */ -}; - -/*! MEMO - * - * @see imemo_type - * */ -struct MEMO { - VALUE flags; - VALUE reserved; - const VALUE v1; - const VALUE v2; - union { - long cnt; - long state; - const VALUE value; - void (*func)(void); - } u3; -}; - -#define IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0))) - -/* ment is in method.h */ - -#define THROW_DATA_P(err) imemo_throw_data_p((VALUE)err) -#define MEMO_CAST(m) ((struct MEMO *)(m)) -#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value)) -#define NEW_MEMO_FOR(type, value) \ - ((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value)) -#define NEW_PARTIAL_MEMO_FOR(type, value, member) \ - ((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), \ - rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \ - MEMO_FOR(type, value)) - -#ifndef RUBY_RUBYPARSER_H -typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t; -#endif -rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt); -struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc); -static inline enum imemo_type imemo_type(VALUE imemo); -static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type); -static inline bool imemo_throw_data_p(VALUE imemo); -static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data); -static inline VALUE rb_imemo_tmpbuf_auto_free_pointer(void); -static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v); -static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr); -static inline VALUE rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str); -static inline void MEMO_V1_SET(struct MEMO *m, VALUE v); -static inline void MEMO_V2_SET(struct MEMO *m, VALUE v); - -size_t rb_imemo_memsize(VALUE obj); -void rb_cc_table_mark(VALUE klass); -void rb_imemo_mark_and_move(VALUE obj, bool reference_updating); -void rb_cc_table_free(VALUE klass); -void rb_imemo_free(VALUE obj); - -RUBY_SYMBOL_EXPORT_BEGIN -#if IMEMO_DEBUG -VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v0, const char *file, int line); -#define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__) -#else -VALUE rb_imemo_new(enum imemo_type type, VALUE v0); -#endif -const char *rb_imemo_name(enum imemo_type type); -RUBY_SYMBOL_EXPORT_END - -static inline struct MEMO * -MEMO_NEW(VALUE a, VALUE b, VALUE c) -{ - struct MEMO *memo = IMEMO_NEW(struct MEMO, imemo_memo, 0); - *((VALUE *)&memo->v1) = a; - *((VALUE *)&memo->v2) = b; - *((VALUE *)&memo->u3.value) = c; - - return memo; -} - -static inline enum imemo_type -imemo_type(VALUE imemo) -{ - return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK; -} - -static inline int -imemo_type_p(VALUE imemo, enum imemo_type imemo_type) -{ - if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) { - /* fixed at compile time if imemo_type is given. */ - const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK; - const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO; - /* fixed at runtime. */ - return expected_type == (RBASIC(imemo)->flags & mask); - } - else { - return 0; - } -} - -#define IMEMO_TYPE_P(v, t) imemo_type_p((VALUE)(v), t) - -static inline bool -imemo_throw_data_p(VALUE imemo) -{ - return RB_TYPE_P(imemo, T_IMEMO); -} - -static inline struct vm_ifunc * -rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data) -{ - return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS); -} - -static inline VALUE -rb_imemo_tmpbuf_auto_free_pointer(void) -{ - return rb_imemo_new(imemo_tmpbuf, 0); -} - -static inline void * -RB_IMEMO_TMPBUF_PTR(VALUE v) -{ - const struct rb_imemo_tmpbuf_struct *p = (const void *)v; - return p->ptr; -} - -static inline void * -rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr) -{ - return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr; -} - -static inline VALUE -rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str) -{ - const void *src; - VALUE imemo; - rb_imemo_tmpbuf_t *tmpbuf; - void *dst; - size_t len; - - StringValue(str); - /* create tmpbuf to keep the pointer before xmalloc */ - imemo = rb_imemo_tmpbuf_auto_free_pointer(); - tmpbuf = (rb_imemo_tmpbuf_t *)imemo; - len = RSTRING_LEN(str); - src = RSTRING_PTR(str); - dst = ruby_xmalloc(len); - memcpy(dst, src, len); - tmpbuf->ptr = dst; - return imemo; -} - -static inline void -MEMO_V1_SET(struct MEMO *m, VALUE v) -{ - RB_OBJ_WRITE(m, &m->v1, v); -} - -static inline void -MEMO_V2_SET(struct MEMO *m, VALUE v) -{ - RB_OBJ_WRITE(m, &m->v2, v); -} - -#endif /* INTERNAL_IMEMO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h deleted file mode 100644 index 03de289..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef INTERNAL_INITS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_INITS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header aggregating init functions. - */ - -/* class.c */ -void Init_class_hierarchy(void); - -/* dmyext.c */ -void Init_enc(void); -void Init_ext(void); - -/* file.c */ -void Init_File(void); - -/* localeinit.c */ -int Init_enc_set_filesystem_encoding(void); - -/* newline.c */ -void Init_newline(void); - -/* vm.c */ -void Init_BareVM(void); -void Init_vm_objects(void); - -/* vm_backtrace.c */ -void Init_vm_backtrace(void); - -/* vm_eval.c */ -void Init_vm_eval(void); - -/* vm_insnhelper.c */ -void Init_vm_stack_canary(void); - -/* vm_method.c */ -void Init_eval_method(void); - -/* inits.c */ -void rb_call_inits(void); - -#endif /* INTERNAL_INITS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h deleted file mode 100644 index 1891248..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h +++ /dev/null @@ -1,140 +0,0 @@ -#ifndef INTERNAL_IO_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_IO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for IO. - */ -#include "ruby/ruby.h" /* for VALUE */ - -#define HAVE_RB_IO_T -struct rb_io; - -#include "ruby/io.h" /* for rb_io_t */ - -#define IO_WITHOUT_GVL(func, arg) rb_thread_call_without_gvl(func, arg, RUBY_UBF_IO, 0) -#define IO_WITHOUT_GVL_INT(func, arg) (int)(VALUE)IO_WITHOUT_GVL(func, arg) - -/** Ruby's IO, metadata and buffers. */ -struct rb_io { - - /** The IO's Ruby level counterpart. */ - VALUE self; - - /** stdio ptr for read/write, if available. */ - FILE *stdio_file; - - /** file descriptor. */ - int fd; - - /** mode flags: FMODE_XXXs */ - int mode; - - /** child's pid (for pipes) */ - rb_pid_t pid; - - /** number of lines read */ - int lineno; - - /** pathname for file */ - VALUE pathv; - - /** finalize proc */ - void (*finalize)(struct rb_io*,int); - - /** Write buffer. */ - rb_io_buffer_t wbuf; - - /** - * (Byte) read buffer. Note also that there is a field called - * ::rb_io_t::cbuf, which also concerns read IO. - */ - rb_io_buffer_t rbuf; - - /** - * Duplex IO object, if set. - * - * @see rb_io_set_write_io() - */ - VALUE tied_io_for_writing; - - struct rb_io_encoding encs; /**< Decomposed encoding flags. */ - - /** Encoding converter used when reading from this IO. */ - rb_econv_t *readconv; - - /** - * rb_io_ungetc() destination. This buffer is read before checking - * ::rb_io_t::rbuf - */ - rb_io_buffer_t cbuf; - - /** Encoding converter used when writing to this IO. */ - rb_econv_t *writeconv; - - /** - * This is, when set, an instance of ::rb_cString which holds the "common" - * encoding. Write conversion can convert strings twice... In case - * conversion from encoding X to encoding Y does not exist, Ruby finds an - * encoding Z that bridges the two, so that X to Z to Y conversion happens. - */ - VALUE writeconv_asciicompat; - - /** Whether ::rb_io_t::writeconv is already set up. */ - int writeconv_initialized; - - /** - * Value of ::rb_io_t::rb_io_enc_t::ecflags stored right before - * initialising ::rb_io_t::writeconv. - */ - int writeconv_pre_ecflags; - - /** - * Value of ::rb_io_t::rb_io_enc_t::ecopts stored right before initialising - * ::rb_io_t::writeconv. - */ - VALUE writeconv_pre_ecopts; - - /** - * This is a Ruby level mutex. It avoids multiple threads to write to an - * IO at once; helps for instance rb_io_puts() to ensure newlines right - * next to its arguments. - * - * This of course doesn't help inter-process IO interleaves, though. - */ - VALUE write_lock; - - /** - * The timeout associated with this IO when performing blocking operations. - */ - VALUE timeout; -}; - -/* io.c */ -void ruby_set_inplace_mode(const char *); -void rb_stdio_set_default_encoding(void); -VALUE rb_io_flush_raw(VALUE, int); -size_t rb_io_memsize(const rb_io_t *); -int rb_stderr_tty_p(void); -void rb_io_fptr_finalize_internal(void *ptr); -#ifdef rb_io_fptr_finalize -# undef rb_io_fptr_finalize -#endif -#define rb_io_fptr_finalize rb_io_fptr_finalize_internal -VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt); - -VALUE rb_io_prep_stdin(void); -VALUE rb_io_prep_stdout(void); -VALUE rb_io_prep_stderr(void); - -RUBY_SYMBOL_EXPORT_BEGIN -/* io.c (export) */ -void rb_maygvl_fd_fix_cloexec(int fd); -int rb_gc_for_fd(int err); -void rb_write_error_str(VALUE mesg); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_IO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h deleted file mode 100644 index d4c0bb9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef INTERNAL_LOAD_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_LOAD_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for require. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* load.c */ -VALUE rb_get_expanded_load_path(void); -int rb_require_internal(VALUE fname); -NORETURN(void rb_load_fail(VALUE, const char*)); - -#endif /* INTERNAL_LOAD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h deleted file mode 100644 index b3a85e7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_LOADPATH_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_LOADPATH_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for $LOAD_PATH. - */ - -/* loadpath.c */ -extern const char ruby_exec_prefix[]; -extern const char ruby_initial_load_paths[]; - -#endif /* INTERNAL_LOADPATH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h deleted file mode 100644 index 08f852f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERNAL_MATH_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_MATH_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Math. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* math.c */ -VALUE rb_math_atan2(VALUE, VALUE); -VALUE rb_math_cos(VALUE); -VALUE rb_math_cosh(VALUE); -VALUE rb_math_exp(VALUE); -VALUE rb_math_hypot(VALUE, VALUE); -VALUE rb_math_log(int argc, const VALUE *argv); -VALUE rb_math_sin(VALUE); -VALUE rb_math_sinh(VALUE); - -#endif /* INTERNAL_MATH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h deleted file mode 100644 index 6ca508c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef INTERNAL_MISSING_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_MISSING_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header corresponding missing. - */ -#include "ruby/internal/config.h" /* for HAVE_SETPROCTITLE */ - -/* missing/setproctitle.c */ -#ifndef HAVE_SETPROCTITLE -extern void ruby_init_setproctitle(int argc, char *argv[]); -extern void ruby_free_proctitle(void); -#endif - -#endif /* INTERNAL_MISSING_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h deleted file mode 100644 index 6406cfc..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h +++ /dev/null @@ -1,274 +0,0 @@ -#ifndef INTERNAL_NUMERIC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_NUMERIC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Numeric. - */ -#include "internal/bignum.h" /* for BIGNUM_POSITIVE_P */ -#include "internal/bits.h" /* for RUBY_BIT_ROTL */ -#include "internal/fixnum.h" /* for FIXNUM_POSITIVE_P */ -#include "internal/vm.h" /* for rb_method_basic_definition_p */ -#include "ruby/intern.h" /* for rb_cmperr */ -#include "ruby/ruby.h" /* for USE_FLONUM */ - -#define ROUND_TO(mode, even, up, down) \ - ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \ - (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down) -#define ROUND_FUNC(mode, name) \ - ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down) -#define ROUND_CALL(mode, name, args) \ - ROUND_TO(mode, name##_half_even args, \ - name##_half_up args, name##_half_down args) - -#ifndef ROUND_DEFAULT -# define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP -#endif - -enum ruby_num_rounding_mode { - RUBY_NUM_ROUND_HALF_UP, - RUBY_NUM_ROUND_HALF_EVEN, - RUBY_NUM_ROUND_HALF_DOWN, - RUBY_NUM_ROUND_DEFAULT = ROUND_DEFAULT, -}; - -/* same as internal.h */ -#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#define roomof(x, y) (((x) + (y) - 1) / (y)) -#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) - -#if SIZEOF_DOUBLE <= SIZEOF_VALUE -typedef double rb_float_value_type; -#else -typedef struct { - VALUE values[roomof(SIZEOF_DOUBLE, SIZEOF_VALUE)]; -} rb_float_value_type; -#endif - -struct RFloat { - struct RBasic basic; - rb_float_value_type float_value; -}; - -#define RFLOAT(obj) ((struct RFloat *)(obj)) - -/* numeric.c */ -int rb_num_to_uint(VALUE val, unsigned int *ret); -VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl); -double ruby_float_step_size(double beg, double end, double unit, int excl); -int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless); -int rb_num_negative_p(VALUE); -VALUE rb_int_succ(VALUE num); -VALUE rb_float_uminus(VALUE num); -VALUE rb_int_plus(VALUE x, VALUE y); -VALUE rb_float_plus(VALUE x, VALUE y); -VALUE rb_int_minus(VALUE x, VALUE y); -VALUE rb_float_minus(VALUE x, VALUE y); -VALUE rb_int_mul(VALUE x, VALUE y); -VALUE rb_float_mul(VALUE x, VALUE y); -VALUE rb_float_div(VALUE x, VALUE y); -VALUE rb_int_idiv(VALUE x, VALUE y); -VALUE rb_int_modulo(VALUE x, VALUE y); -VALUE rb_int2str(VALUE num, int base); -VALUE rb_fix_plus(VALUE x, VALUE y); -VALUE rb_int_gt(VALUE x, VALUE y); -VALUE rb_float_gt(VALUE x, VALUE y); -VALUE rb_int_ge(VALUE x, VALUE y); -enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts); -double rb_int_fdiv_double(VALUE x, VALUE y); -VALUE rb_int_pow(VALUE x, VALUE y); -VALUE rb_float_pow(VALUE x, VALUE y); -VALUE rb_int_cmp(VALUE x, VALUE y); -VALUE rb_int_equal(VALUE x, VALUE y); -VALUE rb_int_divmod(VALUE x, VALUE y); -VALUE rb_int_and(VALUE x, VALUE y); -VALUE rb_int_lshift(VALUE x, VALUE y); -VALUE rb_int_rshift(VALUE x, VALUE y); -VALUE rb_int_div(VALUE x, VALUE y); -int rb_int_positive_p(VALUE num); -int rb_int_negative_p(VALUE num); -VALUE rb_check_integer_type(VALUE); -VALUE rb_num_pow(VALUE x, VALUE y); -VALUE rb_float_ceil(VALUE num, int ndigits); -VALUE rb_float_floor(VALUE x, int ndigits); -VALUE rb_float_abs(VALUE flt); -static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid); -static inline int rb_num_positive_int_p(VALUE num); -static inline int rb_num_negative_int_p(VALUE num); -static inline double rb_float_flonum_value(VALUE v); -static inline double rb_float_noflonum_value(VALUE v); -static inline double rb_float_value_inline(VALUE v); -static inline VALUE rb_float_new_inline(double d); -static inline bool INT_POSITIVE_P(VALUE num); -static inline bool INT_NEGATIVE_P(VALUE num); -static inline bool FLOAT_ZERO_P(VALUE num); -#define rb_float_value rb_float_value_inline -#define rb_float_new rb_float_new_inline - -RUBY_SYMBOL_EXPORT_BEGIN -/* numeric.c (export) */ -RUBY_SYMBOL_EXPORT_END - -VALUE rb_flo_div_flo(VALUE x, VALUE y); -double ruby_float_mod(double x, double y); -VALUE rb_float_equal(VALUE x, VALUE y); -int rb_float_cmp(VALUE x, VALUE y); -VALUE rb_float_eql(VALUE x, VALUE y); -VALUE rb_fix_aref(VALUE fix, VALUE idx); -VALUE rb_int_zero_p(VALUE num); -VALUE rb_int_even_p(VALUE num); -VALUE rb_int_odd_p(VALUE num); -VALUE rb_int_abs(VALUE num); -VALUE rb_int_bit_length(VALUE num); -VALUE rb_int_uminus(VALUE num); -VALUE rb_int_comp(VALUE num); - -static inline bool -INT_POSITIVE_P(VALUE num) -{ - if (FIXNUM_P(num)) { - return FIXNUM_POSITIVE_P(num); - } - else { - return BIGNUM_POSITIVE_P(num); - } -} - -static inline bool -INT_NEGATIVE_P(VALUE num) -{ - if (FIXNUM_P(num)) { - return FIXNUM_NEGATIVE_P(num); - } - else { - return BIGNUM_NEGATIVE_P(num); - } -} - -static inline bool -FLOAT_ZERO_P(VALUE num) -{ - return RFLOAT_VALUE(num) == 0.0; -} - -static inline VALUE -rb_num_compare_with_zero(VALUE num, ID mid) -{ - VALUE zero = INT2FIX(0); - VALUE r = rb_check_funcall(num, mid, 1, &zero); - if (RB_UNDEF_P(r)) { - rb_cmperr(num, zero); - } - return r; -} - -static inline int -rb_num_positive_int_p(VALUE num) -{ - const ID mid = '>'; - - if (FIXNUM_P(num)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return FIXNUM_POSITIVE_P(num); - } - else if (RB_TYPE_P(num, T_BIGNUM)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return BIGNUM_POSITIVE_P(num); - } - return RTEST(rb_num_compare_with_zero(num, mid)); -} - -static inline int -rb_num_negative_int_p(VALUE num) -{ - const ID mid = '<'; - - if (FIXNUM_P(num)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return FIXNUM_NEGATIVE_P(num); - } - else if (RB_TYPE_P(num, T_BIGNUM)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return BIGNUM_NEGATIVE_P(num); - } - return RTEST(rb_num_compare_with_zero(num, mid)); -} - -static inline double -rb_float_flonum_value(VALUE v) -{ -#if USE_FLONUM - if (v != (VALUE)0x8000000000000002) { /* LIKELY */ - union { - double d; - VALUE v; - } t; - - VALUE b63 = (v >> 63); - /* e: xx1... -> 011... */ - /* xx0... -> 100... */ - /* ^b63 */ - t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~(VALUE)0x03), 3); - return t.d; - } -#endif - return 0.0; -} - -static inline double -rb_float_noflonum_value(VALUE v) -{ -#if SIZEOF_DOUBLE <= SIZEOF_VALUE - return RFLOAT(v)->float_value; -#else - union { - rb_float_value_type v; - double d; - } u = {RFLOAT(v)->float_value}; - return u.d; -#endif -} - -static inline double -rb_float_value_inline(VALUE v) -{ - if (FLONUM_P(v)) { - return rb_float_flonum_value(v); - } - return rb_float_noflonum_value(v); -} - -static inline VALUE -rb_float_new_inline(double d) -{ -#if USE_FLONUM - union { - double d; - VALUE v; - } t; - int bits; - - t.d = d; - bits = (int)((VALUE)(t.v >> 60) & 0x7); - /* bits contains 3 bits of b62..b60. */ - /* bits - 3 = */ - /* b011 -> b000 */ - /* b100 -> b001 */ - - if (t.v != 0x3000000000000000 /* 1.72723e-77 */ && - !((bits-3) & ~0x01)) { - return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02; - } - else if (t.v == (VALUE)0) { - /* +0.0 */ - return 0x8000000000000002; - } - /* out of range */ -#endif - return rb_float_new_in_heap(d); -} - -#endif /* INTERNAL_NUMERIC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h deleted file mode 100644 index 92ad37f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef INTERNAL_OBJECT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_OBJECT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Object. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* object.c */ -size_t rb_obj_embedded_size(uint32_t numiv); -VALUE rb_class_allocate_instance(VALUE klass); -VALUE rb_class_search_ancestor(VALUE klass, VALUE super); -NORETURN(void rb_undefined_alloc(VALUE klass)); -double rb_num_to_dbl(VALUE val); -VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound); -VALUE rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze); -VALUE rb_obj_dup_setup(VALUE obj, VALUE dup); -VALUE rb_immutable_obj_clone(int, VALUE *, VALUE); -VALUE rb_check_convert_type_with_id(VALUE,int,const char*,ID); -int rb_bool_expected(VALUE, const char *, int raise); -static inline void RBASIC_CLEAR_CLASS(VALUE obj); -static inline void RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass); -static inline void RBASIC_SET_CLASS(VALUE obj, VALUE klass); - -RUBY_SYMBOL_EXPORT_BEGIN -/* object.c (export) */ -int rb_opts_exception_p(VALUE opts, int default_value); -RUBY_SYMBOL_EXPORT_END - -CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2)); -CONSTFUNC(VALUE rb_obj_not(VALUE obj)); -VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2); -void rb_obj_copy_ivar(VALUE dest, VALUE obj); -VALUE rb_false(VALUE obj); -VALUE rb_convert_type_with_id(VALUE v, int t, const char* nam, ID mid); -VALUE rb_obj_size(VALUE self, VALUE args, VALUE obj); -VALUE rb_get_freeze_opt(int argc, VALUE *argv); - -static inline void -RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass) -{ - const VALUE *ptr = &RBASIC(obj)->klass; - *(VALUE *)ptr = klass; -} - -static inline void -RBASIC_CLEAR_CLASS(VALUE obj) -{ - RBASIC_SET_CLASS_RAW(obj, 0); -} - -static inline void -RBASIC_SET_CLASS(VALUE obj, VALUE klass) -{ - VALUE oldv = RBASIC_CLASS(obj); - RBASIC_SET_CLASS_RAW(obj, klass); - RB_OBJ_WRITTEN(obj, oldv, klass); -} -#endif /* INTERNAL_OBJECT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h deleted file mode 100644 index 5f52e8a..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef INTERNAL_PARSE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PARSE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the parser. - */ -#include -#include "rubyparser.h" -#include "internal/static_assert.h" - -#ifdef UNIVERSAL_PARSER -#define rb_encoding const void -#endif - -struct rb_iseq_struct; /* in vm_core.h */ - -/* structs for managing terminator of string literal and heredocment */ -typedef struct rb_strterm_literal_struct { - long nest; - int func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */ - int paren; /* '(' of `%q(...)` */ - int term; /* ')' of `%q(...)` */ -} rb_strterm_literal_t; - -typedef struct rb_strterm_heredoc_struct { - rb_parser_string_t *lastline; /* the string of line that contains `<<"END"` */ - long offset; /* the column of END in `<<"END"` */ - int sourceline; /* lineno of the line that contains `<<"END"` */ - unsigned length; /* the length of END in `<<"END"` */ - uint8_t quote; - uint8_t func; -} rb_strterm_heredoc_t; - -#define HERETERM_LENGTH_MAX UINT_MAX - -typedef struct rb_strterm_struct { - bool heredoc; - union { - rb_strterm_literal_t literal; - rb_strterm_heredoc_t heredoc; - } u; -} rb_strterm_t; - -/* parse.y */ -void rb_ruby_parser_mark(void *ptr); -size_t rb_ruby_parser_memsize(const void *ptr); - -void rb_ruby_parser_set_options(rb_parser_t *p, int print, int loop, int chomp, int split); -rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main); -void rb_ruby_parser_set_script_lines(rb_parser_t *p); -void rb_ruby_parser_error_tolerant(rb_parser_t *p); -void rb_ruby_parser_keep_tokens(rb_parser_t *p); -typedef rb_parser_string_t*(rb_parser_lex_gets_func)(struct parser_params*, rb_parser_input_data, int); -rb_ast_t *rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, const char *fname_ptr, long fname_len, rb_encoding *fname_enc, rb_parser_input_data input, int line); - -RUBY_SYMBOL_EXPORT_BEGIN - -rb_encoding *rb_ruby_parser_encoding(rb_parser_t *p); -int rb_ruby_parser_end_seen_p(rb_parser_t *p); -int rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag); -rb_parser_string_t *rb_str_to_parser_string(rb_parser_t *p, VALUE str); - -int rb_parser_dvar_defined_ref(struct parser_params*, ID, ID**); -ID rb_parser_internal_id(struct parser_params*); -int rb_parser_reg_fragment_check(struct parser_params*, rb_parser_string_t*, int); -int rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len, rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc); -int rb_parser_local_defined(struct parser_params *p, ID id, const struct rb_iseq_struct *iseq); - -RUBY_SYMBOL_EXPORT_END - -#ifndef UNIVERSAL_PARSER -rb_parser_t *rb_ruby_parser_allocate(void); -rb_parser_t *rb_ruby_parser_new(void); -#endif - -#ifdef RIPPER -void ripper_parser_mark(void *ptr); -void ripper_parser_free(void *ptr); -size_t ripper_parser_memsize(const void *ptr); -void ripper_error(struct parser_params *p); -VALUE ripper_value(struct parser_params *p); -int rb_ruby_parser_get_yydebug(rb_parser_t *p); -void rb_ruby_parser_set_value(rb_parser_t *p, VALUE value); -int rb_ruby_parser_error_p(rb_parser_t *p); -VALUE rb_ruby_parser_debug_output(rb_parser_t *p); -void rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output); -VALUE rb_ruby_parser_parsing_thread(rb_parser_t *p); -void rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread); -void rb_ruby_parser_ripper_initialize(rb_parser_t *p, rb_parser_lex_gets_func *gets, rb_parser_input_data input, VALUE sourcefile_string, const char *sourcefile, int sourceline); -VALUE rb_ruby_parser_result(rb_parser_t *p); -rb_encoding *rb_ruby_parser_enc(rb_parser_t *p); -VALUE rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p); -int rb_ruby_parser_ruby_sourceline(rb_parser_t *p); -int rb_ruby_parser_lex_state(rb_parser_t *p); -void rb_ruby_ripper_parse0(rb_parser_t *p); -int rb_ruby_ripper_dedent_string(rb_parser_t *p, VALUE string, int width); -int rb_ruby_ripper_initialized_p(rb_parser_t *p); -void rb_ruby_ripper_parser_initialize(rb_parser_t *p); -long rb_ruby_ripper_column(rb_parser_t *p); -long rb_ruby_ripper_token_len(rb_parser_t *p); -rb_parser_string_t *rb_ruby_ripper_lex_lastline(rb_parser_t *p); -VALUE rb_ruby_ripper_lex_state_name(struct parser_params *p, int state); -#ifdef UNIVERSAL_PARSER -rb_parser_t *rb_ripper_parser_params_allocate(const rb_parser_config_t *config); -#endif -struct parser_params *rb_ruby_ripper_parser_allocate(void); -#endif - -#ifdef UNIVERSAL_PARSER -#undef rb_encoding -#endif - -#endif /* INTERNAL_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h deleted file mode 100644 index c75f15b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef INTERNAL_PROC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PROC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Proc. - */ -#include "ruby/ruby.h" /* for rb_block_call_func_t */ -#include "ruby/st.h" /* for st_index_t */ -struct rb_block; /* in vm_core.h */ -struct rb_iseq_struct; /* in vm_core.h */ - -/* proc.c */ -VALUE rb_proc_location(VALUE self); -st_index_t rb_hash_proc(st_index_t hash, VALUE proc); -int rb_block_pair_yield_optimizable(void); -int rb_block_arity(void); -int rb_block_min_max_arity(int *max); -VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info); -VALUE rb_callable_receiver(VALUE); - -VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val); -VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc); -VALUE rb_iseq_location(const struct rb_iseq_struct *iseq); -VALUE rb_sym_to_proc(VALUE sym); - -#endif /* INTERNAL_PROC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h deleted file mode 100644 index fd4994c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef INTERNAL_PROCESS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PROCESS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Process. - */ -#include "ruby/internal/config.h" /* for rb_pid_t */ -#include /* for size_t */ - -#ifdef HAVE_SYS_TYPES_H -# include /* for mode_t */ -#endif - -#ifdef _WIN32 -# include "ruby/win32.h" /* for mode_t */ -#endif - -#include "ruby/ruby.h" /* for VALUE */ -#include "internal/compilers.h" /* for __has_warning */ -#include "internal/imemo.h" /* for RB_IMEMO_TMPBUF_PTR */ - -#define RB_MAX_GROUPS (65536) - -struct waitpid_state; -struct rb_process_status; -struct rb_execarg { - union { - struct { - VALUE shell_script; - } sh; - struct { - VALUE command_name; - VALUE command_abspath; /* full path string or nil */ - VALUE argv_str; - VALUE argv_buf; - } cmd; - } invoke; - VALUE redirect_fds; - VALUE envp_str; - VALUE envp_buf; - VALUE dup2_tmpbuf; - unsigned use_shell : 1; - unsigned pgroup_given : 1; - unsigned umask_given : 1; - unsigned unsetenv_others_given : 1; - unsigned unsetenv_others_do : 1; - unsigned close_others_given : 1; - unsigned close_others_do : 1; - unsigned chdir_given : 1; - unsigned new_pgroup_given : 1; - unsigned new_pgroup_flag : 1; - unsigned uid_given : 1; - unsigned gid_given : 1; - unsigned exception : 1; - unsigned exception_given : 1; - struct rb_process_status *status; - struct waitpid_state *waitpid_state; /* for async process management */ - rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0 - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Random. - */ -#include /* for size_t */ - -/* random.c */ -int ruby_fill_random_bytes(void *, size_t, int); -void rb_free_default_rand_key(void); - -#endif /* INTERNAL_RANDOM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h deleted file mode 100644 index 2394937..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_RANGE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Range. - */ -#include "internal/struct.h" /* for RSTRUCT */ - -/* range.c */ -static inline VALUE RANGE_BEG(VALUE r); -static inline VALUE RANGE_END(VALUE r); -static inline VALUE RANGE_EXCL(VALUE r); - -static inline VALUE -RANGE_BEG(VALUE r) -{ - return RSTRUCT(r)->as.ary[0]; -} - -static inline VALUE -RANGE_END(VALUE r) -{ - return RSTRUCT_GET(r, 1); -} - -static inline VALUE -RANGE_EXCL(VALUE r) -{ - return RSTRUCT_GET(r, 2); -} - -VALUE -rb_range_component_beg_len(VALUE b, VALUE e, int excl, - long *begp, long *lenp, long len, int err); - -#endif /* INTERNAL_RANGE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h deleted file mode 100644 index f11fab4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef INTERNAL_RATIONAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_RATIONAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Rational. - */ -#include "ruby/internal/config.h" /* for HAVE_LIBGMP */ -#include "ruby/ruby.h" /* for struct RBasic */ -#include "internal/numeric.h" /* for INT_POSITIVE_P */ -#include "ruby_assert.h" /* for assert */ - -struct RRational { - struct RBasic basic; - VALUE num; - VALUE den; -}; - -#define RRATIONAL(obj) ((struct RRational *)(obj)) - -/* rational.c */ -VALUE rb_rational_canonicalize(VALUE x); -VALUE rb_rational_uminus(VALUE self); -VALUE rb_rational_plus(VALUE self, VALUE other); -VALUE rb_rational_minus(VALUE self, VALUE other); -VALUE rb_rational_mul(VALUE self, VALUE other); -VALUE rb_rational_div(VALUE self, VALUE other); -VALUE rb_lcm(VALUE x, VALUE y); -VALUE rb_rational_reciprocal(VALUE x); -VALUE rb_cstr_to_rat(const char *, int); -VALUE rb_rational_hash(VALUE self); -VALUE rb_rational_abs(VALUE self); -VALUE rb_rational_cmp(VALUE self, VALUE other); -VALUE rb_rational_pow(VALUE self, VALUE other); -VALUE rb_rational_floor(VALUE self, int ndigits); -VALUE rb_numeric_quo(VALUE x, VALUE y); -VALUE rb_flo_round_by_rational(int argc, VALUE *argv, VALUE num); -VALUE rb_float_numerator(VALUE x); -VALUE rb_float_denominator(VALUE x); - -static inline void RATIONAL_SET_NUM(VALUE r, VALUE n); -static inline void RATIONAL_SET_DEN(VALUE r, VALUE d); - -RUBY_SYMBOL_EXPORT_BEGIN -/* rational.c (export) */ -VALUE rb_gcd(VALUE x, VALUE y); -VALUE rb_gcd_normal(VALUE self, VALUE other); -#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) -VALUE rb_gcd_gmp(VALUE x, VALUE y); -#endif -RUBY_SYMBOL_EXPORT_END - -static inline void -RATIONAL_SET_NUM(VALUE r, VALUE n) -{ - assert(RB_INTEGER_TYPE_P(n)); - RB_OBJ_WRITE(r, &RRATIONAL(r)->num, n); -} - -static inline void -RATIONAL_SET_DEN(VALUE r, VALUE d) -{ - assert(RB_INTEGER_TYPE_P(d)); - assert(INT_POSITIVE_P(d)); - RB_OBJ_WRITE(r, &RRATIONAL(r)->den, d); -} - -#endif /* INTERNAL_RATIONAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h deleted file mode 100644 index 3e20114..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef INTERNAL_RE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_RE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Regexp. - */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for VALUE */ - -/* re.c */ -VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline); -VALUE rb_reg_check_preprocess(VALUE); -long rb_reg_search0(VALUE, VALUE, long, int, int); -VALUE rb_reg_match_p(VALUE re, VALUE str, long pos); -bool rb_reg_start_with_p(VALUE re, VALUE str); -VALUE rb_reg_hash(VALUE re); -VALUE rb_reg_equal(VALUE re1, VALUE re2); -void rb_backref_set_string(VALUE string, long pos, long len); -void rb_match_unbusy(VALUE); -int rb_match_count(VALUE match); -VALUE rb_reg_new_ary(VALUE ary, int options); -VALUE rb_reg_last_defined(VALUE match); - -#endif /* INTERNAL_RE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h deleted file mode 100644 index 8e306d1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef INTERNAL_RUBY_PARSE_H -#define INTERNAL_RUBY_PARSE_H - -#include "internal.h" -#include "internal/bignum.h" -#include "internal/compilers.h" -#include "internal/complex.h" -#include "internal/parse.h" -#include "internal/rational.h" -#include "rubyparser.h" -#include "vm.h" - -struct lex_pointer_string { - VALUE str; - long ptr; -}; - -RUBY_SYMBOL_EXPORT_BEGIN -#ifdef UNIVERSAL_PARSER -const rb_parser_config_t *rb_ruby_parser_config(void); -rb_parser_t *rb_parser_params_new(void); -#endif -VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int); -VALUE rb_parser_new(void); -VALUE rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line); -VALUE rb_str_new_parser_string(rb_parser_string_t *str); -VALUE rb_str_new_mutable_parser_string(rb_parser_string_t *str); -rb_parser_string_t *rb_parser_lex_get_str(struct parser_params *p, struct lex_pointer_string *ptr_str); - -VALUE rb_node_str_string_val(const NODE *); -VALUE rb_node_sym_string_val(const NODE *); -VALUE rb_node_dstr_string_val(const NODE *); -VALUE rb_node_regx_string_val(const NODE *); -VALUE rb_node_dregx_string_val(const NODE *); -VALUE rb_node_line_lineno_val(const NODE *); -VALUE rb_node_file_path_val(const NODE *); -VALUE rb_node_encoding_val(const NODE *); - -VALUE rb_node_integer_literal_val(const NODE *); -VALUE rb_node_float_literal_val(const NODE *); -VALUE rb_node_rational_literal_val(const NODE *); -VALUE rb_node_imaginary_literal_val(const NODE *); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_parser_end_seen_p(VALUE); -VALUE rb_parser_encoding(VALUE); -VALUE rb_parser_set_yydebug(VALUE, VALUE); -VALUE rb_parser_build_script_lines_from(rb_parser_ary_t *script_lines); -void rb_parser_set_options(VALUE, int, int, int, int); -VALUE rb_parser_load_file(VALUE parser, VALUE name); -void rb_parser_set_script_lines(VALUE vparser); -void rb_parser_error_tolerant(VALUE vparser); -void rb_parser_keep_tokens(VALUE vparser); - -VALUE rb_parser_compile_string(VALUE, const char*, VALUE, int); -VALUE rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line); -VALUE rb_parser_compile_generic(VALUE vparser, rb_parser_lex_gets_func *lex_gets, VALUE fname, VALUE input, int line); -VALUE rb_parser_compile_array(VALUE vparser, VALUE fname, VALUE array, int start); - -enum lex_state_bits { - EXPR_BEG_bit, /* ignore newline, +/- is a sign. */ - EXPR_END_bit, /* newline significant, +/- is an operator. */ - EXPR_ENDARG_bit, /* ditto, and unbound braces. */ - EXPR_ENDFN_bit, /* ditto, and unbound braces. */ - EXPR_ARG_bit, /* newline significant, +/- is an operator. */ - EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */ - EXPR_MID_bit, /* newline significant, +/- is an operator. */ - EXPR_FNAME_bit, /* ignore newline, no reserved words. */ - EXPR_DOT_bit, /* right after `.', `&.' or `::', no reserved words. */ - EXPR_CLASS_bit, /* immediate after `class', no here document. */ - EXPR_LABEL_bit, /* flag bit, label is allowed. */ - EXPR_LABELED_bit, /* flag bit, just after a label. */ - EXPR_FITEM_bit, /* symbol literal as FNAME. */ - EXPR_MAX_STATE -}; -/* examine combinations */ -enum lex_state_e { -#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit) - DEF_EXPR(BEG), - DEF_EXPR(END), - DEF_EXPR(ENDARG), - DEF_EXPR(ENDFN), - DEF_EXPR(ARG), - DEF_EXPR(CMDARG), - DEF_EXPR(MID), - DEF_EXPR(FNAME), - DEF_EXPR(DOT), - DEF_EXPR(CLASS), - DEF_EXPR(LABEL), - DEF_EXPR(LABELED), - DEF_EXPR(FITEM), - EXPR_VALUE = EXPR_BEG, - EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS), - EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG), - EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN), - EXPR_NONE = 0 -}; - -VALUE rb_ruby_ast_new(const NODE *const root); -rb_ast_t *rb_ruby_ast_data_get(VALUE ast_value); - -#endif /* INTERNAL_RUBY_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h deleted file mode 100644 index b0eb1fc..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h +++ /dev/null @@ -1,297 +0,0 @@ -#ifndef INTERNAL_SANITIZERS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SANITIZERS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for ASAN / MSAN / etc. - */ -#include "ruby/internal/config.h" -#include "internal/compilers.h" /* for __has_feature */ - -#ifdef HAVE_VALGRIND_MEMCHECK_H -# include -#endif - -#ifdef HAVE_SANITIZER_ASAN_INTERFACE_H -# if __has_feature(address_sanitizer) -# define RUBY_ASAN_ENABLED -# include -# endif -#endif - -#ifdef HAVE_SANITIZER_MSAN_INTERFACE_H -# if __has_feature(memory_sanitizer) -# define RUBY_MSAN_ENABLED -# include -# endif -#endif - -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for VALUE */ - -#if 0 -#elif defined(RUBY_ASAN_ENABLED) && defined(RUBY_MSAN_ENABLED) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - __attribute__((__no_sanitize__("memory, address"), __noinline__)) x -#elif defined(RUBY_ASAN_ENABLED) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - __attribute__((__no_sanitize__("address"), __noinline__)) x -#elif defined(NO_SANITIZE_ADDRESS) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - NO_SANITIZE_ADDRESS(NOINLINE(x)) -#elif defined(NO_ADDRESS_SAFETY_ANALYSIS) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x)) -#else -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x -#endif - -#if defined(NO_SANITIZE) && RBIMPL_COMPILER_IS(GCC) -/* GCC warns about unknown sanitizer, which is annoying. */ -# include "internal/warnings.h" -# undef NO_SANITIZE -# define NO_SANITIZE(x, y) \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Wattributes); \ - __attribute__((__no_sanitize__(x))) y; \ - COMPILER_WARNING_POP -#endif - -#ifndef NO_SANITIZE -# define NO_SANITIZE(x, y) y -#endif - -#ifndef RUBY_ASAN_ENABLED -# define __asan_poison_memory_region(x, y) -# define __asan_unpoison_memory_region(x, y) -# define __asan_region_is_poisoned(x, y) 0 -# define __asan_get_current_fake_stack() NULL -# define __asan_addr_is_in_fake_stack(fake_stack, slot, start, end) NULL -#endif - -#ifndef RUBY_MSAN_ENABLED -# define __msan_allocated_memory(x, y) ((void)(x), (void)(y)) -# define __msan_poison(x, y) ((void)(x), (void)(y)) -# define __msan_unpoison(x, y) ((void)(x), (void)(y)) -# define __msan_unpoison_string(x) ((void)(x)) -#endif - -#ifdef VALGRIND_MAKE_READABLE -# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n)) -#endif - -#ifdef VALGRIND_MAKE_WRITABLE -# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n)) -#endif - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0 -#endif - -#ifndef VALGRIND_MAKE_MEM_UNDEFINED -# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0 -#endif - -/** - * This function asserts that a (continuous) memory region from ptr to size - * being "poisoned". Both read / write access to such memory region are - * prohibited until properly unpoisoned. The region must be previously - * allocated (do not pass a freed pointer here), but not necessarily be an - * entire object that the malloc returns. You can punch hole a part of a - * gigantic heap arena. This is handy when you do not free an allocated memory - * region to reuse later: poison when you keep it unused, and unpoison when you - * reuse. - * - * @param[in] ptr pointer to the beginning of the memory region to poison. - * @param[in] size the length of the memory region to poison. - */ -static inline void -asan_poison_memory_region(const volatile void *ptr, size_t size) -{ - __msan_poison(ptr, size); - __asan_poison_memory_region(ptr, size); -} - -/** - * This is a variant of asan_poison_memory_region that takes a VALUE. - * - * @param[in] obj target object. - */ -static inline void -asan_poison_object(VALUE obj) -{ - MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj; - asan_poison_memory_region(ptr, SIZEOF_VALUE); -} - -#ifdef RUBY_ASAN_ENABLED -#define asan_poison_object_if(ptr, obj) do { \ - if (ptr) asan_poison_object(obj); \ - } while (0) -#else -#define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj)) -#endif - -/** - * This function predicates if the given object is fully addressable or not. - * - * @param[in] obj target object. - * @retval 0 the given object is fully addressable. - * @retval otherwise pointer to first such byte who is poisoned. - */ -static inline void * -asan_poisoned_object_p(VALUE obj) -{ - MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj; - return __asan_region_is_poisoned(ptr, SIZEOF_VALUE); -} - -/** - * This function asserts that a (formally poisoned) memory region from ptr to - * size is now addressable. Write access to such memory region gets allowed. - * However read access might or might not be possible depending on situations, - * because the region can have contents of previous usages. That information - * should be passed by the malloc_p flag. If that is true, the contents of the - * region is _not_ fully defined (like the return value of malloc behaves). - * Reading from there is NG; write something first. If malloc_p is false on - * the other hand, that memory region is fully defined and can be read - * immediately. - * - * @param[in] ptr pointer to the beginning of the memory region to unpoison. - * @param[in] size the length of the memory region. - * @param[in] malloc_p if the memory region is like a malloc's return value or not. - */ -static inline void -asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p) -{ - __asan_unpoison_memory_region(ptr, size); - if (malloc_p) { - __msan_allocated_memory(ptr, size); - } - else { - __msan_unpoison(ptr, size); - } -} - -/** - * This is a variant of asan_unpoison_memory_region that takes a VALUE. - * - * @param[in] obj target object. - * @param[in] malloc_p if the memory region is like a malloc's return value or not. - */ -static inline void -asan_unpoison_object(VALUE obj, bool newobj_p) -{ - MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj; - asan_unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p); -} - -static inline void * -asan_unpoison_object_temporary(VALUE obj) -{ - void *ptr = asan_poisoned_object_p(obj); - asan_unpoison_object(obj, false); - return ptr; -} - -static inline void * -asan_poison_object_restore(VALUE obj, void *ptr) -{ - if (ptr) { - asan_poison_object(obj); - } - return NULL; -} - - -/** - * Checks if the given pointer is on an ASAN fake stack. If so, it returns the - * address this variable has on the real frame; if not, it returns the origin - * address unmodified. - * - * n.b. - _dereferencing_ the returned address is meaningless and should not - * be done; even though ASAN reserves space for the variable in both the real and - * fake stacks, the _value_ of that variable is only in the fake stack. - * - * n.b. - this only works for addresses passed in from local variables on the same - * thread, because the ASAN fake stacks are threadlocal. - * - * @param[in] slot the address of some local variable - * @retval a pointer to something from that frame on the _real_ machine stack - */ -static inline void * -asan_get_real_stack_addr(void* slot) -{ - VALUE *addr; - addr = __asan_addr_is_in_fake_stack(__asan_get_current_fake_stack(), slot, NULL, NULL); - return addr ? addr : slot; -} - -/** - * Gets the current thread's fake stack handle, which can be passed into get_fake_stack_extents - * - * @retval An opaque value which can be passed to asan_get_fake_stack_extents - */ -static inline void * -asan_get_thread_fake_stack_handle(void) -{ - return __asan_get_current_fake_stack(); -} - -/** - * Checks if the given VALUE _actually_ represents a pointer to an ASAN fake stack. - * - * If the given slot _is_ actually a reference to an ASAN fake stack, and that fake stack - * contains the real values for the passed-in range of machine stack addresses, returns true - * and the range of the fake stack through the outparams. - * - * Otherwise, returns false, and sets the outparams to NULL. - * - * Note that this function expects "start" to be > "end" on downward-growing stack architectures; - * - * @param[in] thread_fake_stack_handle The asan fake stack reference for the thread we're scanning - * @param[in] slot The value on the machine stack we want to inspect - * @param[in] machine_stack_start The extents of the real machine stack on which slot lives - * @param[in] machine_stack_end The extents of the real machine stack on which slot lives - * @param[out] fake_stack_start_out The extents of the fake stack which contains real VALUEs - * @param[out] fake_stack_end_out The extents of the fake stack which contains real VALUEs - * @return Whether slot is a pointer to a fake stack for the given machine stack range -*/ - -static inline bool -asan_get_fake_stack_extents(void *thread_fake_stack_handle, VALUE slot, - void *machine_stack_start, void *machine_stack_end, - void **fake_stack_start_out, void **fake_stack_end_out) -{ - /* the ifdef is needed here to suppress a warning about fake_frame_{start/end} being - uninitialized if __asan_addr_is_in_fake_stack is an empty macro */ -#ifdef RUBY_ASAN_ENABLED - void *fake_frame_start; - void *fake_frame_end; - void *real_stack_frame = __asan_addr_is_in_fake_stack( - thread_fake_stack_handle, (void *)slot, &fake_frame_start, &fake_frame_end - ); - if (real_stack_frame) { - bool in_range; -#if STACK_GROW_DIRECTION < 0 - in_range = machine_stack_start >= real_stack_frame && real_stack_frame >= machine_stack_end; -#else - in_range = machine_stack_start <= real_stack_frame && real_stack_frame <= machine_stack_end; -#endif - if (in_range) { - *fake_stack_start_out = fake_frame_start; - *fake_stack_end_out = fake_frame_end; - return true; - } - } -#endif - *fake_stack_start_out = 0; - *fake_stack_end_out = 0; - return false; -} - - -#endif /* INTERNAL_SANITIZERS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h deleted file mode 100644 index df9e9a4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERNAL_SERIAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SERIAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for rb_serial_t. - */ -#include "ruby/internal/config.h" /* for HAVE_LONG_LONG */ -#include "ruby/defines.h" /* for LONG_LONG */ - -#ifndef HAVE_LONG_LONG -# error need C99+ -#endif - -typedef unsigned LONG_LONG rb_serial_t; -#define SERIALT2NUM ULL2NUM -#define PRI_SERIALT_PREFIX PRI_LL_PREFIX -#define SIZEOF_SERIAL_T SIZEOF_LONG_LONG - -#endif /* INTERNAL_SERIAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h deleted file mode 100644 index 2363bf4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef INTERNAL_SIGNAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SIGNAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for SignalException. - */ - -/* signal.c */ -extern int ruby_enable_coredump; -int rb_get_next_signal(void); - -#ifdef POSIX_SIGNAL -void (*ruby_posix_signal(int, void (*)(int)))(int); -#endif - -RUBY_SYMBOL_EXPORT_BEGIN -/* signal.c (export) */ -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_SIGNAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h deleted file mode 100644 index a26b224..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef INTERNAL_ST_H -#define INTERNAL_ST_H - -#include "include/ruby/st.h" - -st_table *rb_st_replace(st_table *new_tab, st_table *old_tab); -#define st_replace rb_st_replace -st_table *rb_st_init_existing_table_with_size(st_table *tab, const struct st_hash_type *type, st_index_t size); -#define st_init_existing_table_with_size rb_st_init_existing_table_with_size - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h deleted file mode 100644 index 70dd0b7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_STATIC_ASSERT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_STATIC_ASSERT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief C11 shim for _Static_assert. - */ -#include "ruby/internal/static_assert.h" -#ifndef STATIC_ASSERT -# define STATIC_ASSERT RBIMPL_STATIC_ASSERT -#endif - -#endif /* INTERNAL_STATIC_ASSERT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h deleted file mode 100644 index fb37f73..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef INTERNAL_STRING_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_STRING_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for String. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "internal/compilers.h" /* for __has_builtin */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/encoding.h" /* for rb_encoding */ -#include "ruby/ruby.h" /* for VALUE */ - -#define STR_NOEMBED FL_USER1 -#define STR_SHARED FL_USER2 /* = ELTS_SHARED */ -#define STR_CHILLED FL_USER3 - -#ifdef rb_fstring_cstr -# undef rb_fstring_cstr -#endif - -/* string.c */ -VALUE rb_fstring(VALUE); -VALUE rb_fstring_cstr(const char *str); -VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc); -int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p); -int rb_str_symname_p(VALUE); -VALUE rb_str_quote_unprintable(VALUE); -char *rb_str_fill_terminator(VALUE str, const int termlen); -void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen); -VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg); -VALUE rb_str_chomp_string(VALUE str, VALUE chomp); -VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc); -VALUE rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len, - rb_encoding *from, int ecflags, VALUE ecopts); -VALUE rb_enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl); -VALUE rb_str_escape(VALUE str); -size_t rb_str_memsize(VALUE); -char *rb_str_to_cstr(VALUE str); -const char *ruby_escaped_char(int c); -void rb_str_make_independent(VALUE str); -int rb_enc_str_coderange_scan(VALUE str, rb_encoding *enc); -int rb_ascii8bit_appendable_encoding_index(rb_encoding *enc, unsigned int code); -VALUE rb_str_include(VALUE str, VALUE arg); -VALUE rb_str_byte_substr(VALUE str, VALUE beg, VALUE len); - -static inline bool STR_EMBED_P(VALUE str); -static inline bool STR_SHARED_P(VALUE str); -static inline VALUE QUOTE(VALUE v); -static inline VALUE QUOTE_ID(ID v); -static inline bool is_ascii_string(VALUE str); -static inline bool is_broken_string(VALUE str); -static inline VALUE rb_str_eql_internal(const VALUE str1, const VALUE str2); - -RUBY_SYMBOL_EXPORT_BEGIN -/* string.c (export) */ -VALUE rb_str_tmp_frozen_acquire(VALUE str); -VALUE rb_str_tmp_frozen_no_embed_acquire(VALUE str); -void rb_str_tmp_frozen_release(VALUE str, VALUE tmp); -VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc); -VALUE rb_str_upto_each(VALUE, VALUE, int, int (*each)(VALUE, VALUE), VALUE); -VALUE rb_str_upto_endless_each(VALUE, int (*each)(VALUE, VALUE), VALUE); -void rb_str_make_embedded(VALUE); -size_t rb_str_size_as_embedded(VALUE); -bool rb_str_reembeddable_p(VALUE); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_fstring_new(const char *ptr, long len); -VALUE rb_obj_as_string_result(VALUE str, VALUE obj); -VALUE rb_str_opt_plus(VALUE x, VALUE y); -VALUE rb_str_concat_literals(size_t num, const VALUE *strary); -VALUE rb_str_eql(VALUE str1, VALUE str2); -VALUE rb_id_quote_unprintable(ID); -VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc); - -struct rb_execution_context_struct; -VALUE rb_ec_str_resurrect(struct rb_execution_context_struct *ec, VALUE str, bool chilled); - -#define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str)) -#define rb_fstring_literal(str) rb_fstring_lit(str) -#define rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc)) -#define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc) - -static inline VALUE -QUOTE(VALUE v) -{ - return rb_str_quote_unprintable(v); -} - -static inline VALUE -QUOTE_ID(ID i) -{ - return rb_id_quote_unprintable(i); -} - -static inline bool -STR_EMBED_P(VALUE str) -{ - return ! FL_TEST_RAW(str, STR_NOEMBED); -} - -static inline bool -STR_SHARED_P(VALUE str) -{ - return FL_ALL_RAW(str, STR_NOEMBED | STR_SHARED); -} - -static inline bool -CHILLED_STRING_P(VALUE obj) -{ - return RB_TYPE_P(obj, T_STRING) && FL_TEST_RAW(obj, STR_CHILLED); -} - -static inline void -CHILLED_STRING_MUTATED(VALUE str) -{ - rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "literal string will be frozen in the future"); - FL_UNSET_RAW(str, STR_CHILLED | FL_FREEZE); -} - -static inline void -STR_CHILL_RAW(VALUE str) -{ - // Chilled strings are always also frozen - FL_SET_RAW(str, STR_CHILLED | RUBY_FL_FREEZE); -} - -static inline bool -is_ascii_string(VALUE str) -{ - return rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT; -} - -static inline bool -is_broken_string(VALUE str) -{ - return rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN; -} - -static inline bool -at_char_boundary(const char *s, const char *p, const char *e, rb_encoding *enc) -{ - return rb_enc_left_char_head(s, p, e, enc) == p; -} - -static inline bool -at_char_right_boundary(const char *s, const char *p, const char *e, rb_encoding *enc) -{ - RUBY_ASSERT(s <= p); - RUBY_ASSERT(p <= e); - - return rb_enc_right_char_head(s, p, e, enc) == p; -} - -/* expect tail call optimization */ -// YJIT needs this function to never allocate and never raise -static inline VALUE -rb_str_eql_internal(const VALUE str1, const VALUE str2) -{ - const long len = RSTRING_LEN(str1); - const char *ptr1, *ptr2; - - if (len != RSTRING_LEN(str2)) return Qfalse; - if (!rb_str_comparable(str1, str2)) return Qfalse; - if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2))) - return Qtrue; - if (memcmp(ptr1, ptr2, len) == 0) - return Qtrue; - return Qfalse; -} - -#if __has_builtin(__builtin_constant_p) -# define rb_fstring_cstr(str) \ - (__builtin_constant_p(str) ? \ - rb_fstring_new((str), (long)strlen(str)) : \ - (rb_fstring_cstr)(str)) -#endif -#endif /* INTERNAL_STRING_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h deleted file mode 100644 index 6da5bad..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef INTERNAL_STRUCT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_STRUCT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Struct. - */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for struct RBasic */ - -enum { - RSTRUCT_EMBED_LEN_MASK = RUBY_FL_USER7 | RUBY_FL_USER6 | RUBY_FL_USER5 | RUBY_FL_USER4 | - RUBY_FL_USER3 | RUBY_FL_USER2 | RUBY_FL_USER1, - RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1), -}; - -struct RStruct { - struct RBasic basic; - union { - struct { - long len; - const VALUE *ptr; - } heap; - /* This is a length 1 array because: - * 1. GCC has a bug that does not optimize C flexible array members - * (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102452) - * 2. Zero length arrays are not supported by all compilers - */ - const VALUE ary[1]; - } as; -}; - -#define RSTRUCT(obj) ((struct RStruct *)(obj)) - -#ifdef RSTRUCT_LEN -# undef RSTRUCT_LEN -#endif - -#ifdef RSTRUCT_PTR -# undef RSTRUCT_PTR -#endif - -#ifdef RSTRUCT_SET -# undef RSTRUCT_SET -#endif - -#ifdef RSTRUCT_GET -# undef RSTRUCT_GET -#endif - -#define RSTRUCT_LEN internal_RSTRUCT_LEN -#define RSTRUCT_SET internal_RSTRUCT_SET -#define RSTRUCT_GET internal_RSTRUCT_GET - -/* struct.c */ -VALUE rb_struct_init_copy(VALUE copy, VALUE s); -VALUE rb_struct_lookup(VALUE s, VALUE idx); -VALUE rb_struct_s_keyword_init(VALUE klass); -static inline const VALUE *rb_struct_const_heap_ptr(VALUE st); -static inline long RSTRUCT_EMBED_LEN(VALUE st); -static inline long RSTRUCT_LEN(VALUE st); -static inline int RSTRUCT_LENINT(VALUE st); -static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st); -static inline void RSTRUCT_SET(VALUE st, long k, VALUE v); -static inline VALUE RSTRUCT_GET(VALUE st, long k); - -static inline long -RSTRUCT_EMBED_LEN(VALUE st) -{ - long ret = FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK); - ret >>= RSTRUCT_EMBED_LEN_SHIFT; - return ret; -} - -static inline long -RSTRUCT_LEN(VALUE st) -{ - if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) { - return RSTRUCT_EMBED_LEN(st); - } - else { - return RSTRUCT(st)->as.heap.len; - } -} - -static inline int -RSTRUCT_LENINT(VALUE st) -{ - return rb_long2int(RSTRUCT_LEN(st)); -} - -static inline const VALUE * -RSTRUCT_CONST_PTR(VALUE st) -{ - const struct RStruct *p = RSTRUCT(st); - - if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) { - return p->as.ary; - } - else { - return p->as.heap.ptr; - } -} - -static inline void -RSTRUCT_SET(VALUE st, long k, VALUE v) -{ - RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[k], v); -} - -static inline VALUE -RSTRUCT_GET(VALUE st, long k) -{ - return RSTRUCT_CONST_PTR(st)[k]; -} - -static inline const VALUE * -rb_struct_const_heap_ptr(VALUE st) -{ - assert(!FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)); - return RSTRUCT(st)->as.heap.ptr; -} - -#endif /* INTERNAL_STRUCT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h deleted file mode 100644 index e7730cb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef INTERNAL_SYMBOL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SYMBOL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Symbol. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/encoding.h" /* for rb_encoding */ -#include "internal/compilers.h" /* for __has_builtin */ - -#ifdef rb_sym_intern_ascii_cstr -# undef rb_sym_intern_ascii_cstr -#endif - -/* symbol.c */ -VALUE rb_to_symbol_type(VALUE obj); -VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc); -VALUE rb_sym_intern_ascii(const char *ptr, long len); -VALUE rb_sym_intern_ascii_cstr(const char *ptr); -int rb_is_const_name(VALUE name); -int rb_is_class_name(VALUE name); -int rb_is_instance_name(VALUE name); -int rb_is_local_name(VALUE name); -PUREFUNC(int rb_is_const_sym(VALUE sym)); -PUREFUNC(int rb_is_attrset_sym(VALUE sym)); -ID rb_make_internal_id(void); -ID rb_make_temporary_id(size_t n); -void rb_gc_free_dsymbol(VALUE); -int rb_static_id_valid_p(ID id); - -/* vm.c */ -void rb_free_static_symid_str(void); - -#if __has_builtin(__builtin_constant_p) -#define rb_sym_intern_ascii_cstr(ptr) \ - (__builtin_constant_p(ptr) ? \ - rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \ - rb_sym_intern_ascii_cstr(ptr)) -#endif - -#endif /* INTERNAL_SYMBOL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h deleted file mode 100644 index 4727343..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_THREAD_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Thread. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/intern.h" /* for rb_blocking_function_t */ -#include "ccan/list/list.h" /* for list in rb_io_close_wait_list */ - -struct rb_thread_struct; /* in vm_core.h */ - -#define RB_VM_SAVE_MACHINE_CONTEXT(th) \ - do { \ - FLUSH_REGISTER_WINDOWS; \ - setjmp((th)->ec->machine.regs); \ - SET_MACHINE_STACK_END(&(th)->ec->machine.stack_end); \ - } while (0) - -/* thread.c */ -#define COVERAGE_INDEX_LINES 0 -#define COVERAGE_INDEX_BRANCHES 1 -#define COVERAGE_TARGET_LINES 1 -#define COVERAGE_TARGET_BRANCHES 2 -#define COVERAGE_TARGET_METHODS 4 -#define COVERAGE_TARGET_ONESHOT_LINES 8 -#define COVERAGE_TARGET_EVAL 16 - -#define RUBY_FATAL_THREAD_KILLED INT2FIX(0) -#define RUBY_FATAL_THREAD_TERMINATED INT2FIX(1) -#define RUBY_FATAL_FIBER_KILLED RB_INT2FIX(2) - -VALUE rb_obj_is_mutex(VALUE obj); -VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg); -void rb_thread_execute_interrupts(VALUE th); -VALUE rb_get_coverages(void); -int rb_get_coverage_mode(void); -VALUE rb_default_coverage(int); -VALUE rb_thread_shield_new(void); -bool rb_thread_shield_owned(VALUE self); -VALUE rb_thread_shield_wait(VALUE self); -VALUE rb_thread_shield_release(VALUE self); -VALUE rb_thread_shield_destroy(VALUE self); -int rb_thread_to_be_killed(VALUE thread); -void rb_mutex_allow_trap(VALUE self, int val); -VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data); -VALUE rb_mutex_owned_p(VALUE self); -VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid); -void ruby_mn_threads_params(void); - -int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout); - -struct rb_io_close_wait_list { - struct ccan_list_head pending_fd_users; - VALUE closing_thread; - VALUE wakeup_mutex; -}; -int rb_notify_fd_close(int fd, struct rb_io_close_wait_list *busy); -void rb_notify_fd_close_wait(struct rb_io_close_wait_list *busy); - -RUBY_SYMBOL_EXPORT_BEGIN - -/* Temporary. This API will be removed (renamed). */ -VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd); -VALUE rb_thread_io_blocking_call(rb_blocking_function_t *func, void *data1, int fd, int events); - -/* thread.c (export) */ -int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */ - -RUBY_SYMBOL_EXPORT_END - -int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing); -bool rb_thread_mn_schedulable(VALUE thread); - -#endif /* INTERNAL_THREAD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h deleted file mode 100644 index a3bf058..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef INTERNAL_TIME_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_TIME_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Time. - */ -#include "ruby/internal/config.h" /* for SIGNEDNESS_OF_TIME_T */ -#include "internal/bits.h" /* for SIGNED_INTEGER_MAX */ -#include "ruby/ruby.h" /* for VALUE */ - -#if SIGNEDNESS_OF_TIME_T < 0 /* signed */ -# define TIMET_MAX SIGNED_INTEGER_MAX(time_t) -# define TIMET_MIN SIGNED_INTEGER_MIN(time_t) -#elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */ -# define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t) -# define TIMET_MIN ((time_t)0) -#endif - -struct timeval; /* <- in or */ - -/* time.c */ -struct timeval rb_time_timeval(VALUE); - -RUBY_SYMBOL_EXPORT_BEGIN -/* time.c (export) */ -void ruby_reset_leap_second_info(void); -void ruby_reset_timezone(void); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_TIME_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h deleted file mode 100644 index ce4f234..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERNAL_TRANSCODE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_TRANSCODE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Encoding::Converter. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/encoding.h" /* for rb_econv_t */ - -/* transcode.c */ -extern VALUE rb_cEncodingConverter; -size_t rb_econv_memsize(rb_econv_t *); - -/* vm.c */ -void rb_free_transcoder_table(void); - -#endif /* INTERNAL_TRANSCODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h deleted file mode 100644 index 6eadbb9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef INTERNAL_UTIL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_UTIL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header corresponding util.c. - * @warning DO NOT ADD RANDOM GARBAGE HERE THIS FILE IS FOR util.c - */ -#include "ruby/internal/config.h" -#include /* for size_t */ - -#ifdef HAVE_SYS_TYPES_H -# include /* for ssize_t (note: on Windows ssize_t is */ -#endif /* `#define`d in ruby/config.h) */ - -/* util.c */ -char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve); -char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve); - -RUBY_SYMBOL_EXPORT_BEGIN -/* util.c (export) */ -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_UTIL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h deleted file mode 100644 index b2a30c7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef INTERNAL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_VARIABLE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for variables. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "constant.h" /* for rb_const_entry_t */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for VALUE */ -#include "shape.h" /* for rb_shape_t */ - -/* variable.c */ -void rb_gc_mark_global_tbl(void); -void rb_gc_update_global_tbl(void); -size_t rb_generic_ivar_memsize(VALUE); -VALUE rb_search_class_path(VALUE); -VALUE rb_attr_delete(VALUE, ID); -void rb_autoload_str(VALUE mod, ID id, VALUE file); -VALUE rb_autoload_at_p(VALUE, ID, int); -NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE)); -rb_gvar_getter_t *rb_gvar_getter_function_of(ID); -rb_gvar_setter_t *rb_gvar_setter_function_of(ID); -void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_); -void rb_gvar_ractor_local(const char *name); - -/** - * Sets the name of a module. - * - * Non-permanently named classes can have a temporary name assigned (or - * cleared). In that case the name will be used for `#inspect` and `#to_s`, and - * nested classes/modules will be named with the temporary name as a prefix. - * - * After the module is assigned to a constant, the temporary name will be - * discarded, and the name will be computed based on the nesting. - * - * @param[in] mod An instance of ::rb_cModule. - * @param[in] name An instance of ::rb_cString. - * @retval mod - */ -VALUE rb_mod_set_temporary_name(VALUE, VALUE); - -struct gen_ivtbl; -int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl); -void rb_obj_copy_ivs_to_hash_table(VALUE obj, st_table *table); -void rb_obj_convert_to_too_complex(VALUE obj, st_table *table); -void rb_evict_ivars_to_hash(VALUE obj); - -RUBY_SYMBOL_EXPORT_BEGIN -/* variable.c (export) */ -void rb_mark_generic_ivar(VALUE obj); -void rb_ref_update_generic_ivar(VALUE); -void rb_mv_generic_ivar(VALUE src, VALUE dst); -VALUE rb_const_missing(VALUE klass, VALUE name); -int rb_class_ivar_set(VALUE klass, ID vid, VALUE value); -void rb_iv_tbl_copy(VALUE dst, VALUE src); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef); -VALUE rb_gvar_get(ID); -VALUE rb_gvar_set(ID, VALUE); -VALUE rb_gvar_defined(ID); -void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID); -void rb_ensure_iv_list_size(VALUE obj, uint32_t len, uint32_t newsize); -attr_index_t rb_obj_ivar_set(VALUE obj, ID id, VALUE val); - -#endif /* INTERNAL_VARIABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h deleted file mode 100644 index 74635e6..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef INTERNAL_VM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_VM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for RubyVM. - */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "internal/serial.h" /* for rb_serial_t */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ -#include "ruby/ruby.h" /* for ID */ -#include "ruby/st.h" /* for st_table */ - -#ifdef rb_funcallv -# undef rb_funcallv -#endif - -#ifdef rb_method_basic_definition_p -# undef rb_method_basic_definition_p -#endif - -struct rb_callable_method_entry_struct; /* in method.h */ -struct rb_method_definition_struct; /* in method.h */ -struct rb_execution_context_struct; /* in vm_core.h */ -struct rb_control_frame_struct; /* in vm_core.h */ -struct rb_callinfo; /* in vm_core.h */ - -enum method_missing_reason { - MISSING_NOENTRY = 0x00, - MISSING_PRIVATE = 0x01, - MISSING_PROTECTED = 0x02, - MISSING_FCALL = 0x04, - MISSING_VCALL = 0x08, - MISSING_SUPER = 0x10, - MISSING_MISSING = 0x20, - MISSING_NONE = 0x40 -}; - -/* vm_insnhelper.h */ -VALUE rb_vm_push_frame_fname(struct rb_execution_context_struct *ec, VALUE fname); - -/* vm.c */ -VALUE rb_obj_is_thread(VALUE obj); -void rb_vm_mark(void *ptr); -void rb_vm_register_global_object(VALUE obj); -void rb_vm_each_stack_value(void *ptr, void (*cb)(VALUE, void*), void *ctx); -PUREFUNC(VALUE rb_vm_top_self(void)); -const void **rb_vm_get_insns_address_table(void); -VALUE rb_source_location(int *pline); -const char *rb_source_location_cstr(int *pline); -void rb_vm_pop_cfunc_frame(void); -void rb_vm_check_redefinition_by_prepend(VALUE klass); -int rb_vm_check_optimizable_mid(VALUE mid); -VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements); -VALUE ruby_vm_special_exception_copy(VALUE); -PUREFUNC(st_table *rb_vm_fstring_table(void)); - -void rb_lastline_set_up(VALUE val, unsigned int up); - -/* vm_eval.c */ -VALUE rb_current_realfilepath(void); -VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE); -typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE); -VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv, - rb_check_funcall_hook *hook, VALUE arg); -VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv, - rb_check_funcall_hook *hook, VALUE arg, int kw_splat); -const char *rb_type_str(enum ruby_value_type type); -VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE); -VALUE rb_check_funcall_basic_kw(VALUE, ID, VALUE, int, const VALUE*, int); -VALUE rb_yield_1(VALUE val); -VALUE rb_yield_force_blockarg(VALUE values); -VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv, - rb_block_call_func_t bl_proc, int min_argc, int max_argc, - VALUE data2); -void rb_check_stack_overflow(void); - -#if USE_YJIT -/* vm_exec.c */ -extern uint64_t rb_vm_insns_count; -#endif - -extern bool rb_free_at_exit; - -/* miniinit.c and builtin.c */ -void rb_free_loaded_builtin_table(void); - -/* vm_insnhelper.c */ -VALUE rb_equal_opt(VALUE obj1, VALUE obj2); -VALUE rb_eql_opt(VALUE obj1, VALUE obj2); - -struct rb_iseq_struct; -const struct rb_callcache *rb_vm_search_method_slowpath(const struct rb_callinfo *ci, VALUE klass); - -/* vm_method.c */ -struct rb_execution_context_struct; -int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE obj, ID id, int priv); - -void rb_clear_constant_cache(void); - -/* vm_dump.c */ -void rb_print_backtrace(FILE *); - -/* vm_backtrace.c */ -VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval); -VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval); -VALUE rb_vm_backtrace(int argc, const VALUE * argv, struct rb_execution_context_struct * ec); -VALUE rb_vm_backtrace_locations(int argc, const VALUE * argv, struct rb_execution_context_struct * ec); -VALUE rb_make_backtrace(void); -void rb_backtrace_print_as_bugreport(FILE*); -int rb_backtrace_p(VALUE obj); -VALUE rb_backtrace_to_str_ary(VALUE obj); -VALUE rb_backtrace_to_location_ary(VALUE obj); -VALUE rb_location_ary_to_backtrace(VALUE ary); -void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output); -int rb_frame_info_p(VALUE obj); -int rb_get_node_id_from_frame_info(VALUE obj); -const struct rb_iseq_struct *rb_get_iseq_from_frame_info(VALUE obj); - -VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec); -void rb_backtrace_use_iseq_first_lineno_for_last_location(VALUE self); - -#define RUBY_DTRACE_CREATE_HOOK(name, arg) \ - RUBY_DTRACE_HOOK(name##_CREATE, arg) -#define RUBY_DTRACE_HOOK(name, arg) \ -do { \ - if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \ - int dtrace_line; \ - const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \ - if (!dtrace_file) dtrace_file = ""; \ - RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \ - } \ -} while (0) -#endif /* INTERNAL_VM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h deleted file mode 100644 index 020212e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_WARNINGS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_WARNINGS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header to suppress / mandate warnings. - */ -#include "ruby/internal/warning_push.h" -#define COMPILER_WARNING_PUSH RBIMPL_WARNING_PUSH() -#define COMPILER_WARNING_POP RBIMPL_WARNING_POP() -#define COMPILER_WARNING_ERROR(flag) RBIMPL_WARNING_ERROR(flag) -#define COMPILER_WARNING_IGNORED(flag) RBIMPL_WARNING_IGNORED(flag) -#endif /* INTERNAL_WARNINGS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h deleted file mode 100644 index a0b59c4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef RUBY_ISEQ_H -#define RUBY_ISEQ_H 1 -/********************************************************************** - - iseq.h - - - $Author$ - created at: 04/01/01 23:36:57 JST - - Copyright (C) 2004-2008 Koichi Sasada - -**********************************************************************/ -#include "internal/gc.h" -#include "shape.h" -#include "vm_core.h" -#include "prism_compile.h" - -RUBY_EXTERN const int ruby_api_version[]; -#define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0]) -#define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1]) - -#define ISEQ_MBITS_SIZE sizeof(iseq_bits_t) -#define ISEQ_MBITS_BITLENGTH (ISEQ_MBITS_SIZE * CHAR_BIT) -#define ISEQ_MBITS_SET(buf, i) (buf[(i) / ISEQ_MBITS_BITLENGTH] |= ((iseq_bits_t)1 << ((i) % ISEQ_MBITS_BITLENGTH))) -#define ISEQ_MBITS_SET_P(buf, i) ((buf[(i) / ISEQ_MBITS_BITLENGTH] >> ((i) % ISEQ_MBITS_BITLENGTH)) & 0x1) -#define ISEQ_MBITS_BUFLEN(size) roomof(size, ISEQ_MBITS_BITLENGTH) - -#ifndef USE_ISEQ_NODE_ID -#define USE_ISEQ_NODE_ID 1 -#endif - -#ifndef rb_iseq_t -typedef struct rb_iseq_struct rb_iseq_t; -#define rb_iseq_t rb_iseq_t -#endif -typedef void (*rb_iseq_callback)(const rb_iseq_t *, void *); - -extern const ID rb_iseq_shared_exc_local_tbl[]; - -#define ISEQ_COVERAGE(iseq) ISEQ_BODY(iseq)->variable.coverage -#define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.coverage, cov) -#define ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES) -#define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES) - -#define ISEQ_PC2BRANCHINDEX(iseq) ISEQ_BODY(iseq)->variable.pc2branchindex -#define ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.pc2branchindex, h) - -#define ISEQ_FLIP_CNT(iseq) ISEQ_BODY(iseq)->variable.flip_count - -#define ISEQ_FROZEN_STRING_LITERAL_ENABLED 1 -#define ISEQ_FROZEN_STRING_LITERAL_DISABLED 0 -#define ISEQ_FROZEN_STRING_LITERAL_UNSET -1 - -static inline rb_snum_t -ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq) -{ - rb_snum_t cnt = ISEQ_BODY(iseq)->variable.flip_count; - ISEQ_BODY(iseq)->variable.flip_count += 1; - return cnt; -} - -static inline VALUE * -ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq) -{ - return ISEQ_BODY(iseq)->variable.original_iseq; -} - -static inline void -ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq) -{ - void *ptr = ISEQ_BODY(iseq)->variable.original_iseq; - ISEQ_BODY(iseq)->variable.original_iseq = NULL; - ruby_xfree(ptr); -} - -static inline VALUE * -ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size) -{ - return ISEQ_BODY(iseq)->variable.original_iseq = - ALLOC_N(VALUE, size); -} - -#define ISEQ_TRACE_EVENTS (RUBY_EVENT_LINE | \ - RUBY_EVENT_CLASS | \ - RUBY_EVENT_END | \ - RUBY_EVENT_CALL | \ - RUBY_EVENT_RETURN| \ - RUBY_EVENT_C_CALL| \ - RUBY_EVENT_C_RETURN | \ - RUBY_EVENT_B_CALL | \ - RUBY_EVENT_B_RETURN | \ - RUBY_EVENT_RESCUE | \ - RUBY_EVENT_COVERAGE_LINE| \ - RUBY_EVENT_COVERAGE_BRANCH) - -#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1 -#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2 -#define ISEQ_TRANSLATED IMEMO_FL_USER3 - -#define ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW(((VALUE)iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0) - -struct iseq_compile_data { - /* GC is needed */ - const VALUE err_info; - const VALUE catch_table_ary; /* Array */ - - /* GC is not needed */ - struct iseq_label_data *start_label; - struct iseq_label_data *end_label; - struct iseq_label_data *redo_label; - const rb_iseq_t *current_block; - struct iseq_compile_data_ensure_node_stack *ensure_node_stack; - struct { - struct iseq_compile_data_storage *storage_head; - struct iseq_compile_data_storage *storage_current; - } node; - struct { - struct iseq_compile_data_storage *storage_head; - struct iseq_compile_data_storage *storage_current; - } insn; - bool in_rescue; - int loopval_popped; /* used by NODE_BREAK */ - int last_line; - int label_no; - int node_level; - int isolated_depth; - unsigned int ci_index; - unsigned int ic_index; - const rb_compile_option_t *option; - struct rb_id_table *ivar_cache_table; - const struct rb_builtin_function *builtin_function_table; - const NODE *root_node; - bool catch_except_p; // If a frame of this ISeq may catch exception, set true. -#if OPT_SUPPORT_JOKE - st_table *labels_table; -#endif -}; - -static inline struct iseq_compile_data * -ISEQ_COMPILE_DATA(const rb_iseq_t *iseq) -{ - if (iseq->flags & ISEQ_USE_COMPILE_DATA) { - return iseq->aux.compile_data; - } - else { - return NULL; - } -} - -static inline void -ISEQ_COMPILE_DATA_ALLOC(rb_iseq_t *iseq) -{ - iseq->aux.compile_data = ZALLOC(struct iseq_compile_data); - iseq->flags |= ISEQ_USE_COMPILE_DATA; -} - -static inline void -ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq) -{ - iseq->flags &= ~ISEQ_USE_COMPILE_DATA; - iseq->aux.compile_data = NULL; -} - -static inline rb_iseq_t * -iseq_imemo_alloc(void) -{ - return IMEMO_NEW(rb_iseq_t, imemo_iseq, 0); -} - -VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt); -void rb_ibf_load_iseq_complete(rb_iseq_t *iseq); -const rb_iseq_t *rb_iseq_ibf_load(VALUE str); -const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t); -VALUE rb_iseq_ibf_load_extra_data(VALUE str); -void rb_iseq_init_trace(rb_iseq_t *iseq); -int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line, bool target_bmethod); -int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval); -const rb_iseq_t *rb_iseq_load_iseq(VALUE fname); -int rb_iseq_opt_frozen_string_literal(void); - -#if VM_INSN_INFO_TABLE_IMPL == 2 -unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body); -#endif - -int rb_vm_insn_addr2opcode(const void *addr); - -RUBY_SYMBOL_EXPORT_BEGIN - -/* compile.c */ -VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node); -VALUE rb_iseq_compile_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc); -VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq); -void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, - VALUE locals, VALUE args, - VALUE exception, VALUE body); -void rb_iseq_mark_and_pin_insn_storage(struct iseq_compile_data_storage *arena); - -VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt); -VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc); -unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos); -#ifdef USE_ISEQ_NODE_ID -int rb_iseq_node_id(const rb_iseq_t *iseq, size_t pos); -#endif -void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events); -void rb_iseq_trace_set_all(rb_event_flag_t turnon_events); -void rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq); - -struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(void); -VALUE rb_iseqw_new(const rb_iseq_t *iseq); -const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw); - -VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */ -int rb_iseq_from_eval_p(const rb_iseq_t *iseq); -VALUE rb_iseq_type(const rb_iseq_t *iseq); -VALUE rb_iseq_label(const rb_iseq_t *iseq); -VALUE rb_iseq_base_label(const rb_iseq_t *iseq); -VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq); -VALUE rb_iseq_method_name(const rb_iseq_t *iseq); -void rb_iseq_code_location(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column); - -void rb_iseq_remove_coverage_all(void); - -/* proc.c */ -const rb_iseq_t *rb_method_iseq(VALUE body); -const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc); - -struct rb_compile_option_struct { - unsigned int inline_const_cache: 1; - unsigned int peephole_optimization: 1; - unsigned int tailcall_optimization: 1; - unsigned int specialized_instruction: 1; - unsigned int operands_unification: 1; - unsigned int instructions_unification: 1; - signed int frozen_string_literal: 2; /* -1: not specified, 0: false, 1: true */ - unsigned int debug_frozen_string_literal: 1; - unsigned int coverage_enabled: 1; - int debug_level; -}; - -struct iseq_insn_info_entry { - int line_no; -#ifdef USE_ISEQ_NODE_ID - int node_id; -#endif - rb_event_flag_t events; -}; - -/* - * iseq type: - * CATCH_TYPE_RESCUE, CATCH_TYPE_ENSURE: - * use iseq as continuation. - * - * CATCH_TYPE_BREAK (iter): - * use iseq as key. - * - * CATCH_TYPE_BREAK (while), CATCH_TYPE_RETRY, - * CATCH_TYPE_REDO, CATCH_TYPE_NEXT: - * NULL. - */ -enum rb_catch_type { - CATCH_TYPE_RESCUE = INT2FIX(1), - CATCH_TYPE_ENSURE = INT2FIX(2), - CATCH_TYPE_RETRY = INT2FIX(3), - CATCH_TYPE_BREAK = INT2FIX(4), - CATCH_TYPE_REDO = INT2FIX(5), - CATCH_TYPE_NEXT = INT2FIX(6) -}; - -struct iseq_catch_table_entry { - enum rb_catch_type type; - rb_iseq_t *iseq; - - unsigned int start; - unsigned int end; - unsigned int cont; - unsigned int sp; -}; - -RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN() -struct iseq_catch_table { - unsigned int size; - struct iseq_catch_table_entry entries[FLEX_ARY_LEN]; -} RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END(); - -static inline int -iseq_catch_table_bytes(int n) -{ - enum { - catch_table_entry_size = sizeof(struct iseq_catch_table_entry), - catch_table_entries_max = (INT_MAX - offsetof(struct iseq_catch_table, entries)) / catch_table_entry_size - }; - if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n); - return (int)(offsetof(struct iseq_catch_table, entries) + - n * catch_table_entry_size); -} - -#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512) - -struct iseq_compile_data_storage { - struct iseq_compile_data_storage *next; - unsigned int pos; - unsigned int size; - char buff[FLEX_ARY_LEN]; -}; - -/* defined? */ - -enum defined_type { - DEFINED_NOT_DEFINED, - DEFINED_NIL = 1, - DEFINED_IVAR, - DEFINED_LVAR, - DEFINED_GVAR, - DEFINED_CVAR, - DEFINED_CONST, - DEFINED_METHOD, - DEFINED_YIELD, - DEFINED_ZSUPER, - DEFINED_SELF, - DEFINED_TRUE, - DEFINED_FALSE, - DEFINED_ASGN, - DEFINED_EXPR, - DEFINED_REF, - DEFINED_FUNC, - DEFINED_CONST_FROM -}; - -VALUE rb_iseq_defined_string(enum defined_type type); - -/* vm.c */ -VALUE rb_iseq_local_variables(const rb_iseq_t *iseq); - -attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq); - -void rb_free_encoded_insn_data(void); - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_ISEQ_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc deleted file mode 100644 index 75bb17f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc +++ /dev/null @@ -1,1419 +0,0 @@ -/** -*-c-*- - * DO NOT EDIT - * This file is automatically generated by tool/generic_erb.rb from - * template/known_errors.inc.tmpl and defs/known_errors.def. - */ - -#if 0 - /* "Argument list too long" error */ - rb_define_const(rb_mErrno, "E2BIG", eE2BIG); -#endif -#ifdef E2BIG - defined_error("E2BIG", E2BIG) -#else - undefined_error("E2BIG") -#endif -#if 0 - /* "Permission denied" error */ - rb_define_const(rb_mErrno, "EACCES", eEACCES); -#endif -#ifdef EACCES - defined_error("EACCES", EACCES) -#else - undefined_error("EACCES") -#endif -#if 0 - /* "Address in use" error */ - rb_define_const(rb_mErrno, "EADDRINUSE", eEADDRINUSE); -#endif -#ifdef EADDRINUSE - defined_error("EADDRINUSE", EADDRINUSE) -#else - undefined_error("EADDRINUSE") -#endif -#if 0 - /* "Address not available" error */ - rb_define_const(rb_mErrno, "EADDRNOTAVAIL", eEADDRNOTAVAIL); -#endif -#ifdef EADDRNOTAVAIL - defined_error("EADDRNOTAVAIL", EADDRNOTAVAIL) -#else - undefined_error("EADDRNOTAVAIL") -#endif -#if 0 - /* \EADV error */ - rb_define_const(rb_mErrno, "EADV", eEADV); -#endif -#ifdef EADV - defined_error("EADV", EADV) -#else - undefined_error("EADV") -#endif -#if 0 - /* "Address family not supported" error */ - rb_define_const(rb_mErrno, "EAFNOSUPPORT", eEAFNOSUPPORT); -#endif -#ifdef EAFNOSUPPORT - defined_error("EAFNOSUPPORT", EAFNOSUPPORT) -#else - undefined_error("EAFNOSUPPORT") -#endif -#if 0 - /* "Resource unavailable, try again (may be the same value as [EWOULDBLOCK])" error */ - rb_define_const(rb_mErrno, "EAGAIN", eEAGAIN); -#endif -#ifdef EAGAIN - defined_error("EAGAIN", EAGAIN) -#else - undefined_error("EAGAIN") -#endif -#if 0 - /* "Connection already in progress" error */ - rb_define_const(rb_mErrno, "EALREADY", eEALREADY); -#endif -#ifdef EALREADY - defined_error("EALREADY", EALREADY) -#else - undefined_error("EALREADY") -#endif -#if 0 - /* \EAUTH error */ - rb_define_const(rb_mErrno, "EAUTH", eEAUTH); -#endif -#ifdef EAUTH - defined_error("EAUTH", EAUTH) -#else - undefined_error("EAUTH") -#endif -#if 0 - /* \EBADARCH error */ - rb_define_const(rb_mErrno, "EBADARCH", eEBADARCH); -#endif -#ifdef EBADARCH - defined_error("EBADARCH", EBADARCH) -#else - undefined_error("EBADARCH") -#endif -#if 0 - /* \EBADE error */ - rb_define_const(rb_mErrno, "EBADE", eEBADE); -#endif -#ifdef EBADE - defined_error("EBADE", EBADE) -#else - undefined_error("EBADE") -#endif -#if 0 - /* \EBADEXEC error */ - rb_define_const(rb_mErrno, "EBADEXEC", eEBADEXEC); -#endif -#ifdef EBADEXEC - defined_error("EBADEXEC", EBADEXEC) -#else - undefined_error("EBADEXEC") -#endif -#if 0 - /* "Bad file descriptor" error */ - rb_define_const(rb_mErrno, "EBADF", eEBADF); -#endif -#ifdef EBADF - defined_error("EBADF", EBADF) -#else - undefined_error("EBADF") -#endif -#if 0 - /* \EBADFD error */ - rb_define_const(rb_mErrno, "EBADFD", eEBADFD); -#endif -#ifdef EBADFD - defined_error("EBADFD", EBADFD) -#else - undefined_error("EBADFD") -#endif -#if 0 - /* \EBADMACHO error */ - rb_define_const(rb_mErrno, "EBADMACHO", eEBADMACHO); -#endif -#ifdef EBADMACHO - defined_error("EBADMACHO", EBADMACHO) -#else - undefined_error("EBADMACHO") -#endif -#if 0 - /* "Bad message" error */ - rb_define_const(rb_mErrno, "EBADMSG", eEBADMSG); -#endif -#ifdef EBADMSG - defined_error("EBADMSG", EBADMSG) -#else - undefined_error("EBADMSG") -#endif -#if 0 - /* \EBADR error */ - rb_define_const(rb_mErrno, "EBADR", eEBADR); -#endif -#ifdef EBADR - defined_error("EBADR", EBADR) -#else - undefined_error("EBADR") -#endif -#if 0 - /* \EBADRPC error */ - rb_define_const(rb_mErrno, "EBADRPC", eEBADRPC); -#endif -#ifdef EBADRPC - defined_error("EBADRPC", EBADRPC) -#else - undefined_error("EBADRPC") -#endif -#if 0 - /* \EBADRQC error */ - rb_define_const(rb_mErrno, "EBADRQC", eEBADRQC); -#endif -#ifdef EBADRQC - defined_error("EBADRQC", EBADRQC) -#else - undefined_error("EBADRQC") -#endif -#if 0 - /* \EBADSLT error */ - rb_define_const(rb_mErrno, "EBADSLT", eEBADSLT); -#endif -#ifdef EBADSLT - defined_error("EBADSLT", EBADSLT) -#else - undefined_error("EBADSLT") -#endif -#if 0 - /* \EBFONT error */ - rb_define_const(rb_mErrno, "EBFONT", eEBFONT); -#endif -#ifdef EBFONT - defined_error("EBFONT", EBFONT) -#else - undefined_error("EBFONT") -#endif -#if 0 - /* "Device or resource busy" error */ - rb_define_const(rb_mErrno, "EBUSY", eEBUSY); -#endif -#ifdef EBUSY - defined_error("EBUSY", EBUSY) -#else - undefined_error("EBUSY") -#endif -#if 0 - /* "Operation canceled" error */ - rb_define_const(rb_mErrno, "ECANCELED", eECANCELED); -#endif -#ifdef ECANCELED - defined_error("ECANCELED", ECANCELED) -#else - undefined_error("ECANCELED") -#endif -#if 0 - /* \ECAPMODE error */ - rb_define_const(rb_mErrno, "ECAPMODE", eECAPMODE); -#endif -#ifdef ECAPMODE - defined_error("ECAPMODE", ECAPMODE) -#else - undefined_error("ECAPMODE") -#endif -#if 0 - /* "No child processes" error */ - rb_define_const(rb_mErrno, "ECHILD", eECHILD); -#endif -#ifdef ECHILD - defined_error("ECHILD", ECHILD) -#else - undefined_error("ECHILD") -#endif -#if 0 - /* \ECHRNG error */ - rb_define_const(rb_mErrno, "ECHRNG", eECHRNG); -#endif -#ifdef ECHRNG - defined_error("ECHRNG", ECHRNG) -#else - undefined_error("ECHRNG") -#endif -#if 0 - /* \ECOMM error */ - rb_define_const(rb_mErrno, "ECOMM", eECOMM); -#endif -#ifdef ECOMM - defined_error("ECOMM", ECOMM) -#else - undefined_error("ECOMM") -#endif -#if 0 - /* "Connection aborted" error */ - rb_define_const(rb_mErrno, "ECONNABORTED", eECONNABORTED); -#endif -#ifdef ECONNABORTED - defined_error("ECONNABORTED", ECONNABORTED) -#else - undefined_error("ECONNABORTED") -#endif -#if 0 - /* "Connection refused" error */ - rb_define_const(rb_mErrno, "ECONNREFUSED", eECONNREFUSED); -#endif -#ifdef ECONNREFUSED - defined_error("ECONNREFUSED", ECONNREFUSED) -#else - undefined_error("ECONNREFUSED") -#endif -#if 0 - /* "Connection reset" error */ - rb_define_const(rb_mErrno, "ECONNRESET", eECONNRESET); -#endif -#ifdef ECONNRESET - defined_error("ECONNRESET", ECONNRESET) -#else - undefined_error("ECONNRESET") -#endif -#if 0 - /* "Resource deadlock would occur" error */ - rb_define_const(rb_mErrno, "EDEADLK", eEDEADLK); -#endif -#ifdef EDEADLK - defined_error("EDEADLK", EDEADLK) -#else - undefined_error("EDEADLK") -#endif -#if 0 - /* \EDEADLOCK error */ - rb_define_const(rb_mErrno, "EDEADLOCK", eEDEADLOCK); -#endif -#ifdef EDEADLOCK - defined_error("EDEADLOCK", EDEADLOCK) -#else - undefined_error("EDEADLOCK") -#endif -#if 0 - /* "Destination address required" error */ - rb_define_const(rb_mErrno, "EDESTADDRREQ", eEDESTADDRREQ); -#endif -#ifdef EDESTADDRREQ - defined_error("EDESTADDRREQ", EDESTADDRREQ) -#else - undefined_error("EDESTADDRREQ") -#endif -#if 0 - /* \EDEVERR error */ - rb_define_const(rb_mErrno, "EDEVERR", eEDEVERR); -#endif -#ifdef EDEVERR - defined_error("EDEVERR", EDEVERR) -#else - undefined_error("EDEVERR") -#endif -#if 0 - /* "Mathematics argument out of domain of function" error */ - rb_define_const(rb_mErrno, "EDOM", eEDOM); -#endif -#ifdef EDOM - defined_error("EDOM", EDOM) -#else - undefined_error("EDOM") -#endif -#if 0 - /* \EDOOFUS error */ - rb_define_const(rb_mErrno, "EDOOFUS", eEDOOFUS); -#endif -#ifdef EDOOFUS - defined_error("EDOOFUS", EDOOFUS) -#else - undefined_error("EDOOFUS") -#endif -#if 0 - /* \EDOTDOT error */ - rb_define_const(rb_mErrno, "EDOTDOT", eEDOTDOT); -#endif -#ifdef EDOTDOT - defined_error("EDOTDOT", EDOTDOT) -#else - undefined_error("EDOTDOT") -#endif -#if 0 - /* "Reserved" error */ - rb_define_const(rb_mErrno, "EDQUOT", eEDQUOT); -#endif -#ifdef EDQUOT - defined_error("EDQUOT", EDQUOT) -#else - undefined_error("EDQUOT") -#endif -#if 0 - /* "File exists" error */ - rb_define_const(rb_mErrno, "EEXIST", eEEXIST); -#endif -#ifdef EEXIST - defined_error("EEXIST", EEXIST) -#else - undefined_error("EEXIST") -#endif -#if 0 - /* "Bad address" error */ - rb_define_const(rb_mErrno, "EFAULT", eEFAULT); -#endif -#ifdef EFAULT - defined_error("EFAULT", EFAULT) -#else - undefined_error("EFAULT") -#endif -#if 0 - /* "File too large" error */ - rb_define_const(rb_mErrno, "EFBIG", eEFBIG); -#endif -#ifdef EFBIG - defined_error("EFBIG", EFBIG) -#else - undefined_error("EFBIG") -#endif -#if 0 - /* \EFTYPE error */ - rb_define_const(rb_mErrno, "EFTYPE", eEFTYPE); -#endif -#ifdef EFTYPE - defined_error("EFTYPE", EFTYPE) -#else - undefined_error("EFTYPE") -#endif -#if 0 - /* \EHOSTDOWN error */ - rb_define_const(rb_mErrno, "EHOSTDOWN", eEHOSTDOWN); -#endif -#ifdef EHOSTDOWN - defined_error("EHOSTDOWN", EHOSTDOWN) -#else - undefined_error("EHOSTDOWN") -#endif -#if 0 - /* "Host is unreachable" error */ - rb_define_const(rb_mErrno, "EHOSTUNREACH", eEHOSTUNREACH); -#endif -#ifdef EHOSTUNREACH - defined_error("EHOSTUNREACH", EHOSTUNREACH) -#else - undefined_error("EHOSTUNREACH") -#endif -#if 0 - /* \EHWPOISON error */ - rb_define_const(rb_mErrno, "EHWPOISON", eEHWPOISON); -#endif -#ifdef EHWPOISON - defined_error("EHWPOISON", EHWPOISON) -#else - undefined_error("EHWPOISON") -#endif -#if 0 - /* "Identifier removed" error */ - rb_define_const(rb_mErrno, "EIDRM", eEIDRM); -#endif -#ifdef EIDRM - defined_error("EIDRM", EIDRM) -#else - undefined_error("EIDRM") -#endif -#if 0 - /* "Illegal byte sequence" error */ - rb_define_const(rb_mErrno, "EILSEQ", eEILSEQ); -#endif -#ifdef EILSEQ - defined_error("EILSEQ", EILSEQ) -#else - undefined_error("EILSEQ") -#endif -#if 0 - /* "Operation in progress" error */ - rb_define_const(rb_mErrno, "EINPROGRESS", eEINPROGRESS); -#endif -#ifdef EINPROGRESS - defined_error("EINPROGRESS", EINPROGRESS) -#else - undefined_error("EINPROGRESS") -#endif -#if 0 - /* "Interrupted function" error */ - rb_define_const(rb_mErrno, "EINTR", eEINTR); -#endif -#ifdef EINTR - defined_error("EINTR", EINTR) -#else - undefined_error("EINTR") -#endif -#if 0 - /* "Invalid argument" error */ - rb_define_const(rb_mErrno, "EINVAL", eEINVAL); -#endif -#ifdef EINVAL - defined_error("EINVAL", EINVAL) -#else - undefined_error("EINVAL") -#endif -#if 0 - /* "I/O error" error */ - rb_define_const(rb_mErrno, "EIO", eEIO); -#endif -#ifdef EIO - defined_error("EIO", EIO) -#else - undefined_error("EIO") -#endif -#if 0 - /* \EIPSEC error */ - rb_define_const(rb_mErrno, "EIPSEC", eEIPSEC); -#endif -#ifdef EIPSEC - defined_error("EIPSEC", EIPSEC) -#else - undefined_error("EIPSEC") -#endif -#if 0 - /* "Socket is connected" error */ - rb_define_const(rb_mErrno, "EISCONN", eEISCONN); -#endif -#ifdef EISCONN - defined_error("EISCONN", EISCONN) -#else - undefined_error("EISCONN") -#endif -#if 0 - /* "Is a directory" error */ - rb_define_const(rb_mErrno, "EISDIR", eEISDIR); -#endif -#ifdef EISDIR - defined_error("EISDIR", EISDIR) -#else - undefined_error("EISDIR") -#endif -#if 0 - /* \EISNAM error */ - rb_define_const(rb_mErrno, "EISNAM", eEISNAM); -#endif -#ifdef EISNAM - defined_error("EISNAM", EISNAM) -#else - undefined_error("EISNAM") -#endif -#if 0 - /* \EKEYEXPIRED error */ - rb_define_const(rb_mErrno, "EKEYEXPIRED", eEKEYEXPIRED); -#endif -#ifdef EKEYEXPIRED - defined_error("EKEYEXPIRED", EKEYEXPIRED) -#else - undefined_error("EKEYEXPIRED") -#endif -#if 0 - /* \EKEYREJECTED error */ - rb_define_const(rb_mErrno, "EKEYREJECTED", eEKEYREJECTED); -#endif -#ifdef EKEYREJECTED - defined_error("EKEYREJECTED", EKEYREJECTED) -#else - undefined_error("EKEYREJECTED") -#endif -#if 0 - /* \EKEYREVOKED error */ - rb_define_const(rb_mErrno, "EKEYREVOKED", eEKEYREVOKED); -#endif -#ifdef EKEYREVOKED - defined_error("EKEYREVOKED", EKEYREVOKED) -#else - undefined_error("EKEYREVOKED") -#endif -#if 0 - /* \EL2HLT error */ - rb_define_const(rb_mErrno, "EL2HLT", eEL2HLT); -#endif -#ifdef EL2HLT - defined_error("EL2HLT", EL2HLT) -#else - undefined_error("EL2HLT") -#endif -#if 0 - /* \EL2NSYNC error */ - rb_define_const(rb_mErrno, "EL2NSYNC", eEL2NSYNC); -#endif -#ifdef EL2NSYNC - defined_error("EL2NSYNC", EL2NSYNC) -#else - undefined_error("EL2NSYNC") -#endif -#if 0 - /* \EL3HLT error */ - rb_define_const(rb_mErrno, "EL3HLT", eEL3HLT); -#endif -#ifdef EL3HLT - defined_error("EL3HLT", EL3HLT) -#else - undefined_error("EL3HLT") -#endif -#if 0 - /* \EL3RST error */ - rb_define_const(rb_mErrno, "EL3RST", eEL3RST); -#endif -#ifdef EL3RST - defined_error("EL3RST", EL3RST) -#else - undefined_error("EL3RST") -#endif -#if 0 - /* \ELIBACC error */ - rb_define_const(rb_mErrno, "ELIBACC", eELIBACC); -#endif -#ifdef ELIBACC - defined_error("ELIBACC", ELIBACC) -#else - undefined_error("ELIBACC") -#endif -#if 0 - /* \ELIBBAD error */ - rb_define_const(rb_mErrno, "ELIBBAD", eELIBBAD); -#endif -#ifdef ELIBBAD - defined_error("ELIBBAD", ELIBBAD) -#else - undefined_error("ELIBBAD") -#endif -#if 0 - /* \ELIBEXEC error */ - rb_define_const(rb_mErrno, "ELIBEXEC", eELIBEXEC); -#endif -#ifdef ELIBEXEC - defined_error("ELIBEXEC", ELIBEXEC) -#else - undefined_error("ELIBEXEC") -#endif -#if 0 - /* \ELIBMAX error */ - rb_define_const(rb_mErrno, "ELIBMAX", eELIBMAX); -#endif -#ifdef ELIBMAX - defined_error("ELIBMAX", ELIBMAX) -#else - undefined_error("ELIBMAX") -#endif -#if 0 - /* \ELIBSCN error */ - rb_define_const(rb_mErrno, "ELIBSCN", eELIBSCN); -#endif -#ifdef ELIBSCN - defined_error("ELIBSCN", ELIBSCN) -#else - undefined_error("ELIBSCN") -#endif -#if 0 - /* \ELNRNG error */ - rb_define_const(rb_mErrno, "ELNRNG", eELNRNG); -#endif -#ifdef ELNRNG - defined_error("ELNRNG", ELNRNG) -#else - undefined_error("ELNRNG") -#endif -#if 0 - /* "Too many levels of symbolic links" error */ - rb_define_const(rb_mErrno, "ELOOP", eELOOP); -#endif -#ifdef ELOOP - defined_error("ELOOP", ELOOP) -#else - undefined_error("ELOOP") -#endif -#if 0 - /* \EMEDIUMTYPE error */ - rb_define_const(rb_mErrno, "EMEDIUMTYPE", eEMEDIUMTYPE); -#endif -#ifdef EMEDIUMTYPE - defined_error("EMEDIUMTYPE", EMEDIUMTYPE) -#else - undefined_error("EMEDIUMTYPE") -#endif -#if 0 - /* "File descriptor value too large" error */ - rb_define_const(rb_mErrno, "EMFILE", eEMFILE); -#endif -#ifdef EMFILE - defined_error("EMFILE", EMFILE) -#else - undefined_error("EMFILE") -#endif -#if 0 - /* "Too many links" error */ - rb_define_const(rb_mErrno, "EMLINK", eEMLINK); -#endif -#ifdef EMLINK - defined_error("EMLINK", EMLINK) -#else - undefined_error("EMLINK") -#endif -#if 0 - /* "Message too large" error */ - rb_define_const(rb_mErrno, "EMSGSIZE", eEMSGSIZE); -#endif -#ifdef EMSGSIZE - defined_error("EMSGSIZE", EMSGSIZE) -#else - undefined_error("EMSGSIZE") -#endif -#if 0 - /* "Reserved" error */ - rb_define_const(rb_mErrno, "EMULTIHOP", eEMULTIHOP); -#endif -#ifdef EMULTIHOP - defined_error("EMULTIHOP", EMULTIHOP) -#else - undefined_error("EMULTIHOP") -#endif -#if 0 - /* "Filename too long" error */ - rb_define_const(rb_mErrno, "ENAMETOOLONG", eENAMETOOLONG); -#endif -#ifdef ENAMETOOLONG - defined_error("ENAMETOOLONG", ENAMETOOLONG) -#else - undefined_error("ENAMETOOLONG") -#endif -#if 0 - /* \ENAVAIL error */ - rb_define_const(rb_mErrno, "ENAVAIL", eENAVAIL); -#endif -#ifdef ENAVAIL - defined_error("ENAVAIL", ENAVAIL) -#else - undefined_error("ENAVAIL") -#endif -#if 0 - /* \ENEEDAUTH error */ - rb_define_const(rb_mErrno, "ENEEDAUTH", eENEEDAUTH); -#endif -#ifdef ENEEDAUTH - defined_error("ENEEDAUTH", ENEEDAUTH) -#else - undefined_error("ENEEDAUTH") -#endif -#if 0 - /* "Network is down" error */ - rb_define_const(rb_mErrno, "ENETDOWN", eENETDOWN); -#endif -#ifdef ENETDOWN - defined_error("ENETDOWN", ENETDOWN) -#else - undefined_error("ENETDOWN") -#endif -#if 0 - /* "Connection aborted by network" error */ - rb_define_const(rb_mErrno, "ENETRESET", eENETRESET); -#endif -#ifdef ENETRESET - defined_error("ENETRESET", ENETRESET) -#else - undefined_error("ENETRESET") -#endif -#if 0 - /* "Network unreachable" error */ - rb_define_const(rb_mErrno, "ENETUNREACH", eENETUNREACH); -#endif -#ifdef ENETUNREACH - defined_error("ENETUNREACH", ENETUNREACH) -#else - undefined_error("ENETUNREACH") -#endif -#if 0 - /* "Too many files open in system" error */ - rb_define_const(rb_mErrno, "ENFILE", eENFILE); -#endif -#ifdef ENFILE - defined_error("ENFILE", ENFILE) -#else - undefined_error("ENFILE") -#endif -#if 0 - /* \ENOANO error */ - rb_define_const(rb_mErrno, "ENOANO", eENOANO); -#endif -#ifdef ENOANO - defined_error("ENOANO", ENOANO) -#else - undefined_error("ENOANO") -#endif -#if 0 - /* \ENOATTR error */ - rb_define_const(rb_mErrno, "ENOATTR", eENOATTR); -#endif -#ifdef ENOATTR - defined_error("ENOATTR", ENOATTR) -#else - undefined_error("ENOATTR") -#endif -#if 0 - /* "No buffer space available" error */ - rb_define_const(rb_mErrno, "ENOBUFS", eENOBUFS); -#endif -#ifdef ENOBUFS - defined_error("ENOBUFS", ENOBUFS) -#else - undefined_error("ENOBUFS") -#endif -#if 0 - /* \ENOCSI error */ - rb_define_const(rb_mErrno, "ENOCSI", eENOCSI); -#endif -#ifdef ENOCSI - defined_error("ENOCSI", ENOCSI) -#else - undefined_error("ENOCSI") -#endif -#if 0 - /* "[OB XSR] [Option Start] No message is available on the STREAM head read queue [Option End]" error */ - rb_define_const(rb_mErrno, "ENODATA", eENODATA); -#endif -#ifdef ENODATA - defined_error("ENODATA", ENODATA) -#else - undefined_error("ENODATA") -#endif -#if 0 - /* "No such device" error */ - rb_define_const(rb_mErrno, "ENODEV", eENODEV); -#endif -#ifdef ENODEV - defined_error("ENODEV", ENODEV) -#else - undefined_error("ENODEV") -#endif -#if 0 - /* "No such file or directory" error */ - rb_define_const(rb_mErrno, "ENOENT", eENOENT); -#endif -#ifdef ENOENT - defined_error("ENOENT", ENOENT) -#else - undefined_error("ENOENT") -#endif -#if 0 - /* "Executable file format error" error */ - rb_define_const(rb_mErrno, "ENOEXEC", eENOEXEC); -#endif -#ifdef ENOEXEC - defined_error("ENOEXEC", ENOEXEC) -#else - undefined_error("ENOEXEC") -#endif -#if 0 - /* \ENOKEY error */ - rb_define_const(rb_mErrno, "ENOKEY", eENOKEY); -#endif -#ifdef ENOKEY - defined_error("ENOKEY", ENOKEY) -#else - undefined_error("ENOKEY") -#endif -#if 0 - /* "No locks available" error */ - rb_define_const(rb_mErrno, "ENOLCK", eENOLCK); -#endif -#ifdef ENOLCK - defined_error("ENOLCK", ENOLCK) -#else - undefined_error("ENOLCK") -#endif -#if 0 - /* "Reserved" error */ - rb_define_const(rb_mErrno, "ENOLINK", eENOLINK); -#endif -#ifdef ENOLINK - defined_error("ENOLINK", ENOLINK) -#else - undefined_error("ENOLINK") -#endif -#if 0 - /* \ENOMEDIUM error */ - rb_define_const(rb_mErrno, "ENOMEDIUM", eENOMEDIUM); -#endif -#ifdef ENOMEDIUM - defined_error("ENOMEDIUM", ENOMEDIUM) -#else - undefined_error("ENOMEDIUM") -#endif -#if 0 - /* "Not enough space" error */ - rb_define_const(rb_mErrno, "ENOMEM", eENOMEM); -#endif -#ifdef ENOMEM - defined_error("ENOMEM", ENOMEM) -#else - undefined_error("ENOMEM") -#endif -#if 0 - /* "No message of the desired type" error */ - rb_define_const(rb_mErrno, "ENOMSG", eENOMSG); -#endif -#ifdef ENOMSG - defined_error("ENOMSG", ENOMSG) -#else - undefined_error("ENOMSG") -#endif -#if 0 - /* \ENONET error */ - rb_define_const(rb_mErrno, "ENONET", eENONET); -#endif -#ifdef ENONET - defined_error("ENONET", ENONET) -#else - undefined_error("ENONET") -#endif -#if 0 - /* \ENOPKG error */ - rb_define_const(rb_mErrno, "ENOPKG", eENOPKG); -#endif -#ifdef ENOPKG - defined_error("ENOPKG", ENOPKG) -#else - undefined_error("ENOPKG") -#endif -#if 0 - /* \ENOPOLICY error */ - rb_define_const(rb_mErrno, "ENOPOLICY", eENOPOLICY); -#endif -#ifdef ENOPOLICY - defined_error("ENOPOLICY", ENOPOLICY) -#else - undefined_error("ENOPOLICY") -#endif -#if 0 - /* "Protocol not available" error */ - rb_define_const(rb_mErrno, "ENOPROTOOPT", eENOPROTOOPT); -#endif -#ifdef ENOPROTOOPT - defined_error("ENOPROTOOPT", ENOPROTOOPT) -#else - undefined_error("ENOPROTOOPT") -#endif -#if 0 - /* "No space left on device" error */ - rb_define_const(rb_mErrno, "ENOSPC", eENOSPC); -#endif -#ifdef ENOSPC - defined_error("ENOSPC", ENOSPC) -#else - undefined_error("ENOSPC") -#endif -#if 0 - /* "[OB XSR] [Option Start] No STREAM resources [Option End]" error */ - rb_define_const(rb_mErrno, "ENOSR", eENOSR); -#endif -#ifdef ENOSR - defined_error("ENOSR", ENOSR) -#else - undefined_error("ENOSR") -#endif -#if 0 - /* "[OB XSR] [Option Start] Not a STREAM [Option End]" error */ - rb_define_const(rb_mErrno, "ENOSTR", eENOSTR); -#endif -#ifdef ENOSTR - defined_error("ENOSTR", ENOSTR) -#else - undefined_error("ENOSTR") -#endif -#if 0 - /* "Functionality not supported" error */ - rb_define_const(rb_mErrno, "ENOSYS", eENOSYS); -#endif -#ifdef ENOSYS - defined_error("ENOSYS", ENOSYS) -#else - undefined_error("ENOSYS") -#endif -#if 0 - /* \ENOTBLK error */ - rb_define_const(rb_mErrno, "ENOTBLK", eENOTBLK); -#endif -#ifdef ENOTBLK - defined_error("ENOTBLK", ENOTBLK) -#else - undefined_error("ENOTBLK") -#endif -#if 0 - /* \ENOTCAPABLE error */ - rb_define_const(rb_mErrno, "ENOTCAPABLE", eENOTCAPABLE); -#endif -#ifdef ENOTCAPABLE - defined_error("ENOTCAPABLE", ENOTCAPABLE) -#else - undefined_error("ENOTCAPABLE") -#endif -#if 0 - /* "The socket is not connected" error */ - rb_define_const(rb_mErrno, "ENOTCONN", eENOTCONN); -#endif -#ifdef ENOTCONN - defined_error("ENOTCONN", ENOTCONN) -#else - undefined_error("ENOTCONN") -#endif -#if 0 - /* "Not a directory or a symbolic link to a directory" error */ - rb_define_const(rb_mErrno, "ENOTDIR", eENOTDIR); -#endif -#ifdef ENOTDIR - defined_error("ENOTDIR", ENOTDIR) -#else - undefined_error("ENOTDIR") -#endif -#if 0 - /* "Directory not empty" error */ - rb_define_const(rb_mErrno, "ENOTEMPTY", eENOTEMPTY); -#endif -#ifdef ENOTEMPTY - defined_error("ENOTEMPTY", ENOTEMPTY) -#else - undefined_error("ENOTEMPTY") -#endif -#if 0 - /* \ENOTNAM error */ - rb_define_const(rb_mErrno, "ENOTNAM", eENOTNAM); -#endif -#ifdef ENOTNAM - defined_error("ENOTNAM", ENOTNAM) -#else - undefined_error("ENOTNAM") -#endif -#if 0 - /* "State not recoverable" error */ - rb_define_const(rb_mErrno, "ENOTRECOVERABLE", eENOTRECOVERABLE); -#endif -#ifdef ENOTRECOVERABLE - defined_error("ENOTRECOVERABLE", ENOTRECOVERABLE) -#else - undefined_error("ENOTRECOVERABLE") -#endif -#if 0 - /* "Not a socket" error */ - rb_define_const(rb_mErrno, "ENOTSOCK", eENOTSOCK); -#endif -#ifdef ENOTSOCK - defined_error("ENOTSOCK", ENOTSOCK) -#else - undefined_error("ENOTSOCK") -#endif -#if 0 - /* "Not supported (may be the same value as [EOPNOTSUPP])" error */ - rb_define_const(rb_mErrno, "ENOTSUP", eENOTSUP); -#endif -#ifdef ENOTSUP - defined_error("ENOTSUP", ENOTSUP) -#else - undefined_error("ENOTSUP") -#endif -#if 0 - /* "Inappropriate I/O control operation" error */ - rb_define_const(rb_mErrno, "ENOTTY", eENOTTY); -#endif -#ifdef ENOTTY - defined_error("ENOTTY", ENOTTY) -#else - undefined_error("ENOTTY") -#endif -#if 0 - /* \ENOTUNIQ error */ - rb_define_const(rb_mErrno, "ENOTUNIQ", eENOTUNIQ); -#endif -#ifdef ENOTUNIQ - defined_error("ENOTUNIQ", ENOTUNIQ) -#else - undefined_error("ENOTUNIQ") -#endif -#if 0 - /* "No such device or address" error */ - rb_define_const(rb_mErrno, "ENXIO", eENXIO); -#endif -#ifdef ENXIO - defined_error("ENXIO", ENXIO) -#else - undefined_error("ENXIO") -#endif -#if 0 - /* "Operation not supported on socket (may be the same value as [ENOTSUP])" error */ - rb_define_const(rb_mErrno, "EOPNOTSUPP", eEOPNOTSUPP); -#endif -#ifdef EOPNOTSUPP - defined_error("EOPNOTSUPP", EOPNOTSUPP) -#else - undefined_error("EOPNOTSUPP") -#endif -#if 0 - /* "Value too large to be stored in data type" error */ - rb_define_const(rb_mErrno, "EOVERFLOW", eEOVERFLOW); -#endif -#ifdef EOVERFLOW - defined_error("EOVERFLOW", EOVERFLOW) -#else - undefined_error("EOVERFLOW") -#endif -#if 0 - /* "Previous owner died" error */ - rb_define_const(rb_mErrno, "EOWNERDEAD", eEOWNERDEAD); -#endif -#ifdef EOWNERDEAD - defined_error("EOWNERDEAD", EOWNERDEAD) -#else - undefined_error("EOWNERDEAD") -#endif -#if 0 - /* "Operation not permitted" error */ - rb_define_const(rb_mErrno, "EPERM", eEPERM); -#endif -#ifdef EPERM - defined_error("EPERM", EPERM) -#else - undefined_error("EPERM") -#endif -#if 0 - /* \EPFNOSUPPORT error */ - rb_define_const(rb_mErrno, "EPFNOSUPPORT", eEPFNOSUPPORT); -#endif -#ifdef EPFNOSUPPORT - defined_error("EPFNOSUPPORT", EPFNOSUPPORT) -#else - undefined_error("EPFNOSUPPORT") -#endif -#if 0 - /* "Broken pipe" error */ - rb_define_const(rb_mErrno, "EPIPE", eEPIPE); -#endif -#ifdef EPIPE - defined_error("EPIPE", EPIPE) -#else - undefined_error("EPIPE") -#endif -#if 0 - /* \EPROCLIM error */ - rb_define_const(rb_mErrno, "EPROCLIM", eEPROCLIM); -#endif -#ifdef EPROCLIM - defined_error("EPROCLIM", EPROCLIM) -#else - undefined_error("EPROCLIM") -#endif -#if 0 - /* \EPROCUNAVAIL error */ - rb_define_const(rb_mErrno, "EPROCUNAVAIL", eEPROCUNAVAIL); -#endif -#ifdef EPROCUNAVAIL - defined_error("EPROCUNAVAIL", EPROCUNAVAIL) -#else - undefined_error("EPROCUNAVAIL") -#endif -#if 0 - /* \EPROGMISMATCH error */ - rb_define_const(rb_mErrno, "EPROGMISMATCH", eEPROGMISMATCH); -#endif -#ifdef EPROGMISMATCH - defined_error("EPROGMISMATCH", EPROGMISMATCH) -#else - undefined_error("EPROGMISMATCH") -#endif -#if 0 - /* \EPROGUNAVAIL error */ - rb_define_const(rb_mErrno, "EPROGUNAVAIL", eEPROGUNAVAIL); -#endif -#ifdef EPROGUNAVAIL - defined_error("EPROGUNAVAIL", EPROGUNAVAIL) -#else - undefined_error("EPROGUNAVAIL") -#endif -#if 0 - /* "Protocol error" error */ - rb_define_const(rb_mErrno, "EPROTO", eEPROTO); -#endif -#ifdef EPROTO - defined_error("EPROTO", EPROTO) -#else - undefined_error("EPROTO") -#endif -#if 0 - /* "Protocol not supported" error */ - rb_define_const(rb_mErrno, "EPROTONOSUPPORT", eEPROTONOSUPPORT); -#endif -#ifdef EPROTONOSUPPORT - defined_error("EPROTONOSUPPORT", EPROTONOSUPPORT) -#else - undefined_error("EPROTONOSUPPORT") -#endif -#if 0 - /* "Protocol wrong type for socket" error */ - rb_define_const(rb_mErrno, "EPROTOTYPE", eEPROTOTYPE); -#endif -#ifdef EPROTOTYPE - defined_error("EPROTOTYPE", EPROTOTYPE) -#else - undefined_error("EPROTOTYPE") -#endif -#if 0 - /* \EPWROFF error */ - rb_define_const(rb_mErrno, "EPWROFF", eEPWROFF); -#endif -#ifdef EPWROFF - defined_error("EPWROFF", EPWROFF) -#else - undefined_error("EPWROFF") -#endif -#if 0 - /* \EQFULL error */ - rb_define_const(rb_mErrno, "EQFULL", eEQFULL); -#endif -#ifdef EQFULL - defined_error("EQFULL", EQFULL) -#else - undefined_error("EQFULL") -#endif -#if 0 - /* "Result too large" error */ - rb_define_const(rb_mErrno, "ERANGE", eERANGE); -#endif -#ifdef ERANGE - defined_error("ERANGE", ERANGE) -#else - undefined_error("ERANGE") -#endif -#if 0 - /* \EREMCHG error */ - rb_define_const(rb_mErrno, "EREMCHG", eEREMCHG); -#endif -#ifdef EREMCHG - defined_error("EREMCHG", EREMCHG) -#else - undefined_error("EREMCHG") -#endif -#if 0 - /* \EREMOTE error */ - rb_define_const(rb_mErrno, "EREMOTE", eEREMOTE); -#endif -#ifdef EREMOTE - defined_error("EREMOTE", EREMOTE) -#else - undefined_error("EREMOTE") -#endif -#if 0 - /* \EREMOTEIO error */ - rb_define_const(rb_mErrno, "EREMOTEIO", eEREMOTEIO); -#endif -#ifdef EREMOTEIO - defined_error("EREMOTEIO", EREMOTEIO) -#else - undefined_error("EREMOTEIO") -#endif -#if 0 - /* \ERESTART error */ - rb_define_const(rb_mErrno, "ERESTART", eERESTART); -#endif -#ifdef ERESTART - defined_error("ERESTART", ERESTART) -#else - undefined_error("ERESTART") -#endif -#if 0 - /* \ERFKILL error */ - rb_define_const(rb_mErrno, "ERFKILL", eERFKILL); -#endif -#ifdef ERFKILL - defined_error("ERFKILL", ERFKILL) -#else - undefined_error("ERFKILL") -#endif -#if 0 - /* "Read-only file system" error */ - rb_define_const(rb_mErrno, "EROFS", eEROFS); -#endif -#ifdef EROFS - defined_error("EROFS", EROFS) -#else - undefined_error("EROFS") -#endif -#if 0 - /* \ERPCMISMATCH error */ - rb_define_const(rb_mErrno, "ERPCMISMATCH", eERPCMISMATCH); -#endif -#ifdef ERPCMISMATCH - defined_error("ERPCMISMATCH", ERPCMISMATCH) -#else - undefined_error("ERPCMISMATCH") -#endif -#if 0 - /* \ESHLIBVERS error */ - rb_define_const(rb_mErrno, "ESHLIBVERS", eESHLIBVERS); -#endif -#ifdef ESHLIBVERS - defined_error("ESHLIBVERS", ESHLIBVERS) -#else - undefined_error("ESHLIBVERS") -#endif -#if 0 - /* \ESHUTDOWN error */ - rb_define_const(rb_mErrno, "ESHUTDOWN", eESHUTDOWN); -#endif -#ifdef ESHUTDOWN - defined_error("ESHUTDOWN", ESHUTDOWN) -#else - undefined_error("ESHUTDOWN") -#endif -#if 0 - /* \ESOCKTNOSUPPORT error */ - rb_define_const(rb_mErrno, "ESOCKTNOSUPPORT", eESOCKTNOSUPPORT); -#endif -#ifdef ESOCKTNOSUPPORT - defined_error("ESOCKTNOSUPPORT", ESOCKTNOSUPPORT) -#else - undefined_error("ESOCKTNOSUPPORT") -#endif -#if 0 - /* "Invalid seek" error */ - rb_define_const(rb_mErrno, "ESPIPE", eESPIPE); -#endif -#ifdef ESPIPE - defined_error("ESPIPE", ESPIPE) -#else - undefined_error("ESPIPE") -#endif -#if 0 - /* "No such process" error */ - rb_define_const(rb_mErrno, "ESRCH", eESRCH); -#endif -#ifdef ESRCH - defined_error("ESRCH", ESRCH) -#else - undefined_error("ESRCH") -#endif -#if 0 - /* \ESRMNT error */ - rb_define_const(rb_mErrno, "ESRMNT", eESRMNT); -#endif -#ifdef ESRMNT - defined_error("ESRMNT", ESRMNT) -#else - undefined_error("ESRMNT") -#endif -#if 0 - /* "Reserved" error */ - rb_define_const(rb_mErrno, "ESTALE", eESTALE); -#endif -#ifdef ESTALE - defined_error("ESTALE", ESTALE) -#else - undefined_error("ESTALE") -#endif -#if 0 - /* \ESTRPIPE error */ - rb_define_const(rb_mErrno, "ESTRPIPE", eESTRPIPE); -#endif -#ifdef ESTRPIPE - defined_error("ESTRPIPE", ESTRPIPE) -#else - undefined_error("ESTRPIPE") -#endif -#if 0 - /* "[OB XSR] [Option Start] Stream ioctl() timeout [Option End]" error */ - rb_define_const(rb_mErrno, "ETIME", eETIME); -#endif -#ifdef ETIME - defined_error("ETIME", ETIME) -#else - undefined_error("ETIME") -#endif -#if 0 - /* "Connection timed out" error */ - rb_define_const(rb_mErrno, "ETIMEDOUT", eETIMEDOUT); -#endif -#ifdef ETIMEDOUT - defined_error("ETIMEDOUT", ETIMEDOUT) -#else - undefined_error("ETIMEDOUT") -#endif -#if 0 - /* \ETOOMANYREFS error */ - rb_define_const(rb_mErrno, "ETOOMANYREFS", eETOOMANYREFS); -#endif -#ifdef ETOOMANYREFS - defined_error("ETOOMANYREFS", ETOOMANYREFS) -#else - undefined_error("ETOOMANYREFS") -#endif -#if 0 - /* "Text file busy" error */ - rb_define_const(rb_mErrno, "ETXTBSY", eETXTBSY); -#endif -#ifdef ETXTBSY - defined_error("ETXTBSY", ETXTBSY) -#else - undefined_error("ETXTBSY") -#endif -#if 0 - /* \EUCLEAN error */ - rb_define_const(rb_mErrno, "EUCLEAN", eEUCLEAN); -#endif -#ifdef EUCLEAN - defined_error("EUCLEAN", EUCLEAN) -#else - undefined_error("EUCLEAN") -#endif -#if 0 - /* \EUNATCH error */ - rb_define_const(rb_mErrno, "EUNATCH", eEUNATCH); -#endif -#ifdef EUNATCH - defined_error("EUNATCH", EUNATCH) -#else - undefined_error("EUNATCH") -#endif -#if 0 - /* \EUSERS error */ - rb_define_const(rb_mErrno, "EUSERS", eEUSERS); -#endif -#ifdef EUSERS - defined_error("EUSERS", EUSERS) -#else - undefined_error("EUSERS") -#endif -#if 0 - /* "Operation would block (may be the same value as [EAGAIN])" error */ - rb_define_const(rb_mErrno, "EWOULDBLOCK", eEWOULDBLOCK); -#endif -#ifdef EWOULDBLOCK - defined_error("EWOULDBLOCK", EWOULDBLOCK) -#else - undefined_error("EWOULDBLOCK") -#endif -#if 0 - /* "Cross-device link" error */ - rb_define_const(rb_mErrno, "EXDEV", eEXDEV); -#endif -#ifdef EXDEV - defined_error("EXDEV", EXDEV) -#else - undefined_error("EXDEV") -#endif -#if 0 - /* \EXFULL error */ - rb_define_const(rb_mErrno, "EXFULL", eEXFULL); -#endif -#ifdef EXFULL - defined_error("EXFULL", EXFULL) -#else - undefined_error("EXFULL") -#endif -#if 0 - /* "Largest errno" error */ - rb_define_const(rb_mErrno, "ELAST", eELAST); -#endif -#ifdef ELAST - defined_error("ELAST", ELAST) -#else - undefined_error("ELAST") -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h deleted file mode 100644 index fdc7c26..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef RUBY_METHOD_H -#define RUBY_METHOD_H 1 -/********************************************************************** - - method.h - - - $Author$ - created at: Wed Jul 15 20:02:33 2009 - - Copyright (C) 2009 Koichi Sasada - -**********************************************************************/ - -#include "internal.h" -#include "internal/imemo.h" -#include "internal/compilers.h" -#include "internal/static_assert.h" - -#ifndef END_OF_ENUMERATION -# if defined(__GNUC__) &&! defined(__STRICT_ANSI__) -# define END_OF_ENUMERATION(key) -# else -# define END_OF_ENUMERATION(key) END_OF_##key##_PLACEHOLDER = 0 -# endif -#endif - -/* cref */ - -typedef enum { - METHOD_VISI_UNDEF = 0x00, - METHOD_VISI_PUBLIC = 0x01, - METHOD_VISI_PRIVATE = 0x02, - METHOD_VISI_PROTECTED = 0x03, - - METHOD_VISI_MASK = 0x03 -} rb_method_visibility_t; - -typedef struct rb_scope_visi_struct { - BITFIELD(rb_method_visibility_t, method_visi, 3); - unsigned int module_func : 1; -} rb_scope_visibility_t; - -/*! CREF (Class REFerence) */ -typedef struct rb_cref_struct { - VALUE flags; - VALUE refinements; - VALUE klass_or_self; - struct rb_cref_struct * next; - const rb_scope_visibility_t scope_visi; -} rb_cref_t; - -/* method data type */ - -typedef struct rb_method_entry_struct { - VALUE flags; - VALUE defined_class; - struct rb_method_definition_struct * const def; - ID called_id; - VALUE owner; -} rb_method_entry_t; - -typedef struct rb_callable_method_entry_struct { /* same fields with rb_method_entry_t */ - VALUE flags; - const VALUE defined_class; - struct rb_method_definition_struct * const def; - ID called_id; - const VALUE owner; -} rb_callable_method_entry_t; - -#define METHOD_ENTRY_VISI(me) (rb_method_visibility_t)(((me)->flags & (IMEMO_FL_USER0 | IMEMO_FL_USER1)) >> (IMEMO_FL_USHIFT+0)) -#define METHOD_ENTRY_BASIC(me) (int) (((me)->flags & (IMEMO_FL_USER2 )) >> (IMEMO_FL_USHIFT+2)) -#define METHOD_ENTRY_COMPLEMENTED(me) ((me)->flags & IMEMO_FL_USER3) -#define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags |= IMEMO_FL_USER3) -#define METHOD_ENTRY_CACHED(me) ((me)->flags & IMEMO_FL_USER4) -#define METHOD_ENTRY_CACHED_SET(me) ((me)->flags |= IMEMO_FL_USER4) -#define METHOD_ENTRY_INVALIDATED(me) ((me)->flags & IMEMO_FL_USER5) -#define METHOD_ENTRY_INVALIDATED_SET(me) ((me)->flags |= IMEMO_FL_USER5) - -static inline void -METHOD_ENTRY_VISI_SET(rb_method_entry_t *me, rb_method_visibility_t visi) -{ - VM_ASSERT((int)visi >= 0 && visi <= 3); - me->flags = (me->flags & ~(IMEMO_FL_USER0 | IMEMO_FL_USER1)) | (visi << (IMEMO_FL_USHIFT+0)); -} -static inline void -METHOD_ENTRY_BASIC_SET(rb_method_entry_t *me, unsigned int basic) -{ - VM_ASSERT(basic <= 1); - me->flags = (me->flags & ~(IMEMO_FL_USER2 )) | (basic << (IMEMO_FL_USHIFT+2)); -} -static inline void -METHOD_ENTRY_FLAGS_SET(rb_method_entry_t *me, rb_method_visibility_t visi, unsigned int basic) -{ - VM_ASSERT((int)visi >= 0 && visi <= 3); - VM_ASSERT(basic <= 1); - me->flags = - (me->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2)) | - ((visi << (IMEMO_FL_USHIFT+0)) | (basic << (IMEMO_FL_USHIFT+2))); -} -static inline void -METHOD_ENTRY_FLAGS_COPY(rb_method_entry_t *dst, const rb_method_entry_t *src) -{ - dst->flags = - (dst->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2 - |IMEMO_FL_USER3)) | - (src->flags & (IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2|IMEMO_FL_USER3)); -} - -typedef enum { - VM_METHOD_TYPE_ISEQ, /*!< Ruby method */ - VM_METHOD_TYPE_CFUNC, /*!< C method */ - VM_METHOD_TYPE_ATTRSET, /*!< attr_writer or attr_accessor */ - VM_METHOD_TYPE_IVAR, /*!< attr_reader or attr_accessor */ - VM_METHOD_TYPE_BMETHOD, - VM_METHOD_TYPE_ZSUPER, - VM_METHOD_TYPE_ALIAS, - VM_METHOD_TYPE_UNDEF, - VM_METHOD_TYPE_NOTIMPLEMENTED, - VM_METHOD_TYPE_OPTIMIZED, /*!< Kernel#send, Proc#call, etc */ - VM_METHOD_TYPE_MISSING, /*!< wrapper for method_missing(id) */ - VM_METHOD_TYPE_REFINED, /*!< refinement */ - - END_OF_ENUMERATION(VM_METHOD_TYPE) -} rb_method_type_t; -#define VM_METHOD_TYPE_MINIMUM_BITS 4 -STATIC_ASSERT(VM_METHOD_TYPE_MINIMUM_BITS, - VM_METHOD_TYPE_REFINED <= (1<klass is original owner */ -} rb_method_alias_t; - -typedef struct rb_method_refined_struct { - struct rb_method_entry_struct * orig_me; -} rb_method_refined_t; - -typedef struct rb_method_bmethod_struct { - VALUE proc; /* should be marked */ - struct rb_hook_list_struct *hooks; - VALUE defined_ractor; -} rb_method_bmethod_t; - -enum method_optimized_type { - OPTIMIZED_METHOD_TYPE_SEND, - OPTIMIZED_METHOD_TYPE_CALL, - OPTIMIZED_METHOD_TYPE_BLOCK_CALL, - OPTIMIZED_METHOD_TYPE_STRUCT_AREF, - OPTIMIZED_METHOD_TYPE_STRUCT_ASET, - OPTIMIZED_METHOD_TYPE__MAX -}; - -typedef struct rb_method_optimized { - enum method_optimized_type type; - unsigned int index; -} rb_method_optimized_t; - -struct rb_method_definition_struct { - BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS); - unsigned int iseq_overload: 1; - unsigned int no_redef_warning: 1; - unsigned int aliased : 1; - int reference_count : 28; - - union { - rb_method_iseq_t iseq; - rb_method_cfunc_t cfunc; - rb_method_attr_t attr; - rb_method_alias_t alias; - rb_method_refined_t refined; - rb_method_bmethod_t bmethod; - rb_method_optimized_t optimized; - } body; - - ID original_id; - uintptr_t method_serial; -}; - -struct rb_id_table; - -typedef struct rb_method_definition_struct rb_method_definition_t; -STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8); - -#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF) -#define UNDEFINED_REFINED_METHOD_P(def) \ - ((def)->type == VM_METHOD_TYPE_REFINED && \ - UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me)) - -void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi); -void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi); -void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi); -void rb_add_method_optimized(VALUE klass, ID mid, enum method_optimized_type, unsigned int index, rb_method_visibility_t visi); -void rb_add_refined_method_entry(VALUE refined_class, ID mid); - -rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex); -rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, rb_method_definition_t *def); - -const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id); - -const rb_method_entry_t *rb_method_entry(VALUE klass, ID id); -const rb_method_entry_t *rb_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class); -const rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class); -const rb_method_entry_t *rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me); -RUBY_SYMBOL_EXPORT_BEGIN -const rb_method_entry_t *rb_resolve_me_location(const rb_method_entry_t *, VALUE[5]); -RUBY_SYMBOL_EXPORT_END - -const rb_callable_method_entry_t *rb_callable_method_entry(VALUE klass, ID id); -const rb_callable_method_entry_t *rb_callable_method_entry_or_negative(VALUE klass, ID id); -const rb_callable_method_entry_t *rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class); -const rb_callable_method_entry_t *rb_callable_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class); - -int rb_method_entry_arity(const rb_method_entry_t *me); -int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2); -st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me); - -VALUE rb_method_entry_location(const rb_method_entry_t *me); - -void rb_free_method_entry(const rb_method_entry_t *me); - -const rb_method_entry_t *rb_method_entry_clone(const rb_method_entry_t *me); -const rb_callable_method_entry_t *rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID called_id, VALUE defined_class); -void rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src); - -void rb_method_table_insert(VALUE klass, struct rb_id_table *table, ID method_id, const rb_method_entry_t *me); - -void rb_scope_visibility_set(rb_method_visibility_t); - -VALUE rb_unnamed_parameters(int arity); - -void rb_clear_method_cache(VALUE klass_or_module, ID mid); -void rb_clear_all_refinement_method_cache(void); - -#endif /* RUBY_METHOD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h deleted file mode 100644 index 1e411f2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef RUBY_NODE_H -#define RUBY_NODE_H 1 -/********************************************************************** - - node.h - - - $Author$ - created at: Fri May 28 15:14:02 JST 1993 - - Copyright (C) 1993-2007 Yukihiro Matsumoto - -**********************************************************************/ - -#include -#include "rubyparser.h" -#include "ruby/backward/2/attributes.h" - -typedef void (*bug_report_func)(const char *fmt, ...) RUBYPARSER_ATTRIBUTE_FORMAT(1, 2); -typedef struct node_buffer_elem_struct { - struct node_buffer_elem_struct *next; - long len; /* Length of nodes */ - size_t allocated; /* Total memory size of allocated buf */ - size_t used; /* Current usage of buf */ - NODE **nodes; /* Array of node pointers */ - NODE *buf[FLEX_ARY_LEN]; -} node_buffer_elem_t; - -typedef struct { - node_buffer_elem_t *head; - node_buffer_elem_t *last; -} node_buffer_list_t; - -struct node_buffer_struct { - node_buffer_list_t buffer_list; - struct rb_ast_local_table_link *local_tables; - // - id (sequence number) - // - token_type - // - text of token - // - location info - // Array, whose entry is array - rb_parser_ary_t *tokens; -}; - -RUBY_SYMBOL_EXPORT_BEGIN - -#ifdef UNIVERSAL_PARSER -rb_ast_t *rb_ast_new(const rb_parser_config_t *config); -#else -rb_ast_t *rb_ast_new(void); -#endif -size_t rb_ast_memsize(const rb_ast_t*); -void rb_ast_dispose(rb_ast_t*); -const char *ruby_node_name(int node); -void rb_node_init(NODE *n, enum node_type type); - -void rb_ast_update_references(rb_ast_t*); -void rb_ast_free(rb_ast_t*); -NODE *rb_ast_newnode(rb_ast_t*, enum node_type type, size_t size, size_t alignment); -void rb_ast_delete_node(rb_ast_t*, NODE *n); -rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int); -rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int); - -VALUE rb_parser_dump_tree(const NODE *node, int comment); - -const struct kwtable *rb_reserved_word(const char *, unsigned int); - -struct parser_params; -PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3); -VALUE rb_node_set_type(NODE *n, enum node_type t); - -RUBY_SYMBOL_EXPORT_END - -#define NODE_LSHIFT (NODE_TYPESHIFT+7) -#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1) - -#define nd_line(n) (int)(((SIGNED_VALUE)(n)->flags)>>NODE_LSHIFT) -#define nd_set_line(n,l) \ - (n)->flags=(((n)->flags&~((VALUE)(-1)<nd_loc) -#define nd_first_column(n) ((int)(RNODE(n)->nd_loc.beg_pos.column)) -#define nd_set_first_column(n, v) (RNODE(n)->nd_loc.beg_pos.column = (v)) -#define nd_first_lineno(n) ((int)(RNODE(n)->nd_loc.beg_pos.lineno)) -#define nd_set_first_lineno(n, v) (RNODE(n)->nd_loc.beg_pos.lineno = (v)) -#define nd_first_loc(n) (RNODE(n)->nd_loc.beg_pos) -#define nd_set_first_loc(n, v) (nd_first_loc(n) = (v)) - -#define nd_last_column(n) ((int)(RNODE(n)->nd_loc.end_pos.column)) -#define nd_set_last_column(n, v) (RNODE(n)->nd_loc.end_pos.column = (v)) -#define nd_last_lineno(n) ((int)(RNODE(n)->nd_loc.end_pos.lineno)) -#define nd_set_last_lineno(n, v) (RNODE(n)->nd_loc.end_pos.lineno = (v)) -#define nd_last_loc(n) (RNODE(n)->nd_loc.end_pos) -#define nd_set_last_loc(n, v) (nd_last_loc(n) = (v)) -#define nd_node_id(n) (RNODE(n)->node_id) -#define nd_set_node_id(n,id) (RNODE(n)->node_id = (id)) - -static inline bool -nd_type_p(const NODE *n, enum node_type t) -{ - return (enum node_type)nd_type(n) == t; -} - -#endif /* RUBY_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc deleted file mode 100644 index 626da27..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc +++ /dev/null @@ -1,224 +0,0 @@ - case NODE_SCOPE: - return "NODE_SCOPE"; - case NODE_BLOCK: - return "NODE_BLOCK"; - case NODE_IF: - return "NODE_IF"; - case NODE_UNLESS: - return "NODE_UNLESS"; - case NODE_CASE: - return "NODE_CASE"; - case NODE_CASE2: - return "NODE_CASE2"; - case NODE_CASE3: - return "NODE_CASE3"; - case NODE_WHEN: - return "NODE_WHEN"; - case NODE_IN: - return "NODE_IN"; - case NODE_WHILE: - return "NODE_WHILE"; - case NODE_UNTIL: - return "NODE_UNTIL"; - case NODE_ITER: - return "NODE_ITER"; - case NODE_FOR: - return "NODE_FOR"; - case NODE_FOR_MASGN: - return "NODE_FOR_MASGN"; - case NODE_BREAK: - return "NODE_BREAK"; - case NODE_NEXT: - return "NODE_NEXT"; - case NODE_REDO: - return "NODE_REDO"; - case NODE_RETRY: - return "NODE_RETRY"; - case NODE_BEGIN: - return "NODE_BEGIN"; - case NODE_RESCUE: - return "NODE_RESCUE"; - case NODE_RESBODY: - return "NODE_RESBODY"; - case NODE_ENSURE: - return "NODE_ENSURE"; - case NODE_AND: - return "NODE_AND"; - case NODE_OR: - return "NODE_OR"; - case NODE_MASGN: - return "NODE_MASGN"; - case NODE_LASGN: - return "NODE_LASGN"; - case NODE_DASGN: - return "NODE_DASGN"; - case NODE_GASGN: - return "NODE_GASGN"; - case NODE_IASGN: - return "NODE_IASGN"; - case NODE_CDECL: - return "NODE_CDECL"; - case NODE_CVASGN: - return "NODE_CVASGN"; - case NODE_OP_ASGN1: - return "NODE_OP_ASGN1"; - case NODE_OP_ASGN2: - return "NODE_OP_ASGN2"; - case NODE_OP_ASGN_AND: - return "NODE_OP_ASGN_AND"; - case NODE_OP_ASGN_OR: - return "NODE_OP_ASGN_OR"; - case NODE_OP_CDECL: - return "NODE_OP_CDECL"; - case NODE_CALL: - return "NODE_CALL"; - case NODE_OPCALL: - return "NODE_OPCALL"; - case NODE_FCALL: - return "NODE_FCALL"; - case NODE_VCALL: - return "NODE_VCALL"; - case NODE_QCALL: - return "NODE_QCALL"; - case NODE_SUPER: - return "NODE_SUPER"; - case NODE_ZSUPER: - return "NODE_ZSUPER"; - case NODE_LIST: - return "NODE_LIST"; - case NODE_ZLIST: - return "NODE_ZLIST"; - case NODE_HASH: - return "NODE_HASH"; - case NODE_RETURN: - return "NODE_RETURN"; - case NODE_YIELD: - return "NODE_YIELD"; - case NODE_LVAR: - return "NODE_LVAR"; - case NODE_DVAR: - return "NODE_DVAR"; - case NODE_GVAR: - return "NODE_GVAR"; - case NODE_IVAR: - return "NODE_IVAR"; - case NODE_CONST: - return "NODE_CONST"; - case NODE_CVAR: - return "NODE_CVAR"; - case NODE_NTH_REF: - return "NODE_NTH_REF"; - case NODE_BACK_REF: - return "NODE_BACK_REF"; - case NODE_MATCH: - return "NODE_MATCH"; - case NODE_MATCH2: - return "NODE_MATCH2"; - case NODE_MATCH3: - return "NODE_MATCH3"; - case NODE_INTEGER: - return "NODE_INTEGER"; - case NODE_FLOAT: - return "NODE_FLOAT"; - case NODE_RATIONAL: - return "NODE_RATIONAL"; - case NODE_IMAGINARY: - return "NODE_IMAGINARY"; - case NODE_STR: - return "NODE_STR"; - case NODE_DSTR: - return "NODE_DSTR"; - case NODE_XSTR: - return "NODE_XSTR"; - case NODE_DXSTR: - return "NODE_DXSTR"; - case NODE_EVSTR: - return "NODE_EVSTR"; - case NODE_REGX: - return "NODE_REGX"; - case NODE_DREGX: - return "NODE_DREGX"; - case NODE_ONCE: - return "NODE_ONCE"; - case NODE_ARGS: - return "NODE_ARGS"; - case NODE_ARGS_AUX: - return "NODE_ARGS_AUX"; - case NODE_OPT_ARG: - return "NODE_OPT_ARG"; - case NODE_KW_ARG: - return "NODE_KW_ARG"; - case NODE_POSTARG: - return "NODE_POSTARG"; - case NODE_ARGSCAT: - return "NODE_ARGSCAT"; - case NODE_ARGSPUSH: - return "NODE_ARGSPUSH"; - case NODE_SPLAT: - return "NODE_SPLAT"; - case NODE_BLOCK_PASS: - return "NODE_BLOCK_PASS"; - case NODE_DEFN: - return "NODE_DEFN"; - case NODE_DEFS: - return "NODE_DEFS"; - case NODE_ALIAS: - return "NODE_ALIAS"; - case NODE_VALIAS: - return "NODE_VALIAS"; - case NODE_UNDEF: - return "NODE_UNDEF"; - case NODE_CLASS: - return "NODE_CLASS"; - case NODE_MODULE: - return "NODE_MODULE"; - case NODE_SCLASS: - return "NODE_SCLASS"; - case NODE_COLON2: - return "NODE_COLON2"; - case NODE_COLON3: - return "NODE_COLON3"; - case NODE_DOT2: - return "NODE_DOT2"; - case NODE_DOT3: - return "NODE_DOT3"; - case NODE_FLIP2: - return "NODE_FLIP2"; - case NODE_FLIP3: - return "NODE_FLIP3"; - case NODE_SELF: - return "NODE_SELF"; - case NODE_NIL: - return "NODE_NIL"; - case NODE_TRUE: - return "NODE_TRUE"; - case NODE_FALSE: - return "NODE_FALSE"; - case NODE_ERRINFO: - return "NODE_ERRINFO"; - case NODE_DEFINED: - return "NODE_DEFINED"; - case NODE_POSTEXE: - return "NODE_POSTEXE"; - case NODE_SYM: - return "NODE_SYM"; - case NODE_DSYM: - return "NODE_DSYM"; - case NODE_ATTRASGN: - return "NODE_ATTRASGN"; - case NODE_LAMBDA: - return "NODE_LAMBDA"; - case NODE_ARYPTN: - return "NODE_ARYPTN"; - case NODE_HSHPTN: - return "NODE_HSHPTN"; - case NODE_FNDPTN: - return "NODE_FNDPTN"; - case NODE_ERROR: - return "NODE_ERROR"; - case NODE_LINE: - return "NODE_LINE"; - case NODE_FILE: - return "NODE_FILE"; - case NODE_ENCODING: - return "NODE_ENCODING"; diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc deleted file mode 100644 index 2f8c0b2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/optinsn.inc.erb" - or tool/insns2vm.rb - */ - -static INSN * -insn_operands_unification(INSN *iobj) -{ -#ifdef OPT_OPERANDS_UNIFICATION - VALUE *op = iobj->operands; - - switch (iobj->insn_id) { - default: - /* do nothing */; - break; - - case BIN(getlocal): - - /* getlocal_WC_0(idx)()(val) */ - if ( op[1] == LONG2NUM(0) ) { - iobj->insn_id = BIN(getlocal_WC_0); - iobj->operand_size = 1; - break; - } - - /* getlocal_WC_1(idx)()(val) */ - if ( op[1] == LONG2NUM(1) ) { - iobj->insn_id = BIN(getlocal_WC_1); - iobj->operand_size = 1; - break; - } - - break; - case BIN(setlocal): - - /* setlocal_WC_0(idx)(val)() */ - if ( op[1] == LONG2NUM(0) ) { - iobj->insn_id = BIN(setlocal_WC_0); - iobj->operand_size = 1; - break; - } - - /* setlocal_WC_1(idx)(val)() */ - if ( op[1] == LONG2NUM(1) ) { - iobj->insn_id = BIN(setlocal_WC_1); - iobj->operand_size = 1; - break; - } - - break; - case BIN(putobject): - - /* putobject_INT2FIX_0_()()(val) */ - if ( op[0] == INT2FIX(0) ) { - iobj->insn_id = BIN(putobject_INT2FIX_0_); - iobj->operand_size = 0; - break; - } - - /* putobject_INT2FIX_1_()()(val) */ - if ( op[0] == INT2FIX(1) ) { - iobj->insn_id = BIN(putobject_INT2FIX_1_); - iobj->operand_size = 0; - break; - } - - break; - } -#endif - return iobj; -} - -int -rb_insn_unified_local_var_level(VALUE insn) -{ -#ifdef OPT_OPERANDS_UNIFICATION - /* optimize rule */ - switch (insn) { - default: - return -1; /* do nothing */; - case BIN(getlocal_WC_0): - return 0; - case BIN(getlocal_WC_1): - return 1; - case BIN(setlocal_WC_0): - return 0; - case BIN(setlocal_WC_1): - return 1; - case BIN(putobject_INT2FIX_0_): - return INT2FIX(0); - case BIN(putobject_INT2FIX_1_): - return INT2FIX(1); - } -#endif - return -1; -} diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc deleted file mode 100644 index 0175744..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/optunifs.inc.erb" - or tool/insns2vm.rb - */ - -/* Let .bss section automatically initialize this variable */ -/* cf. Section 6.7.8 of ISO/IEC 9899:1999 */ -static const int *const *const unified_insns_data[212]; - -ASSERT_VM_INSTRUCTION_SIZE(unified_insns_data); diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h deleted file mode 100644 index 6a1ccaf..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h +++ /dev/null @@ -1,243 +0,0 @@ -/* A Bison parser, made by Lrama 0.6.9. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ -#ifndef YY_YY_PARSE_H_INCLUDED -# define YY_YY_PARSE_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG && !defined(yydebug) -extern int yydebug; -#endif - - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - END_OF_INPUT = 0, /* "end-of-input" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - keyword_class = 258, /* "'class'" */ - keyword_module = 259, /* "'module'" */ - keyword_def = 260, /* "'def'" */ - keyword_undef = 261, /* "'undef'" */ - keyword_begin = 262, /* "'begin'" */ - keyword_rescue = 263, /* "'rescue'" */ - keyword_ensure = 264, /* "'ensure'" */ - keyword_end = 265, /* "'end'" */ - keyword_if = 266, /* "'if'" */ - keyword_unless = 267, /* "'unless'" */ - keyword_then = 268, /* "'then'" */ - keyword_elsif = 269, /* "'elsif'" */ - keyword_else = 270, /* "'else'" */ - keyword_case = 271, /* "'case'" */ - keyword_when = 272, /* "'when'" */ - keyword_while = 273, /* "'while'" */ - keyword_until = 274, /* "'until'" */ - keyword_for = 275, /* "'for'" */ - keyword_break = 276, /* "'break'" */ - keyword_next = 277, /* "'next'" */ - keyword_redo = 278, /* "'redo'" */ - keyword_retry = 279, /* "'retry'" */ - keyword_in = 280, /* "'in'" */ - keyword_do = 281, /* "'do'" */ - keyword_do_cond = 282, /* "'do' for condition" */ - keyword_do_block = 283, /* "'do' for block" */ - keyword_do_LAMBDA = 284, /* "'do' for lambda" */ - keyword_return = 285, /* "'return'" */ - keyword_yield = 286, /* "'yield'" */ - keyword_super = 287, /* "'super'" */ - keyword_self = 288, /* "'self'" */ - keyword_nil = 289, /* "'nil'" */ - keyword_true = 290, /* "'true'" */ - keyword_false = 291, /* "'false'" */ - keyword_and = 292, /* "'and'" */ - keyword_or = 293, /* "'or'" */ - keyword_not = 294, /* "'not'" */ - modifier_if = 295, /* "'if' modifier" */ - modifier_unless = 296, /* "'unless' modifier" */ - modifier_while = 297, /* "'while' modifier" */ - modifier_until = 298, /* "'until' modifier" */ - modifier_rescue = 299, /* "'rescue' modifier" */ - keyword_alias = 300, /* "'alias'" */ - keyword_defined = 301, /* "'defined?'" */ - keyword_BEGIN = 302, /* "'BEGIN'" */ - keyword_END = 303, /* "'END'" */ - keyword__LINE__ = 304, /* "'__LINE__'" */ - keyword__FILE__ = 305, /* "'__FILE__'" */ - keyword__ENCODING__ = 306, /* "'__ENCODING__'" */ - tIDENTIFIER = 307, /* "local variable or method" */ - tFID = 308, /* "method" */ - tGVAR = 309, /* "global variable" */ - tIVAR = 310, /* "instance variable" */ - tCONSTANT = 311, /* "constant" */ - tCVAR = 312, /* "class variable" */ - tLABEL = 313, /* "label" */ - tINTEGER = 314, /* "integer literal" */ - tFLOAT = 315, /* "float literal" */ - tRATIONAL = 316, /* "rational literal" */ - tIMAGINARY = 317, /* "imaginary literal" */ - tCHAR = 318, /* "char literal" */ - tNTH_REF = 319, /* "numbered reference" */ - tBACK_REF = 320, /* "back reference" */ - tSTRING_CONTENT = 321, /* "literal content" */ - tREGEXP_END = 322, /* tREGEXP_END */ - tDUMNY_END = 323, /* "dummy end" */ - tSP = 324, /* "escaped space" */ - tUPLUS = 132, /* "unary+" */ - tUMINUS = 133, /* "unary-" */ - tPOW = 134, /* "**" */ - tCMP = 135, /* "<=>" */ - tEQ = 140, /* "==" */ - tEQQ = 141, /* "===" */ - tNEQ = 142, /* "!=" */ - tGEQ = 139, /* ">=" */ - tLEQ = 138, /* "<=" */ - tANDOP = 148, /* "&&" */ - tOROP = 149, /* "||" */ - tMATCH = 143, /* "=~" */ - tNMATCH = 144, /* "!~" */ - tDOT2 = 128, /* ".." */ - tDOT3 = 129, /* "..." */ - tBDOT2 = 130, /* "(.." */ - tBDOT3 = 131, /* "(..." */ - tAREF = 145, /* "[]" */ - tASET = 146, /* "[]=" */ - tLSHFT = 136, /* "<<" */ - tRSHFT = 137, /* ">>" */ - tANDDOT = 150, /* "&." */ - tCOLON2 = 147, /* "::" */ - tCOLON3 = 325, /* ":: at EXPR_BEG" */ - tOP_ASGN = 326, /* "operator-assignment" */ - tASSOC = 327, /* "=>" */ - tLPAREN = 328, /* "(" */ - tLPAREN_ARG = 329, /* "( arg" */ - tRPAREN = 330, /* ")" */ - tLBRACK = 331, /* "[" */ - tLBRACE = 332, /* "{" */ - tLBRACE_ARG = 333, /* "{ arg" */ - tSTAR = 334, /* "*" */ - tDSTAR = 335, /* "**arg" */ - tAMPER = 336, /* "&" */ - tLAMBDA = 337, /* "->" */ - tSYMBEG = 338, /* "symbol literal" */ - tSTRING_BEG = 339, /* "string literal" */ - tXSTRING_BEG = 340, /* "backtick literal" */ - tREGEXP_BEG = 341, /* "regexp literal" */ - tWORDS_BEG = 342, /* "word list" */ - tQWORDS_BEG = 343, /* "verbatim word list" */ - tSYMBOLS_BEG = 344, /* "symbol list" */ - tQSYMBOLS_BEG = 345, /* "verbatim symbol list" */ - tSTRING_END = 346, /* "terminator" */ - tSTRING_DEND = 347, /* "'}'" */ - tSTRING_DBEG = 348, /* tSTRING_DBEG */ - tSTRING_DVAR = 349, /* tSTRING_DVAR */ - tLAMBEG = 350, /* tLAMBEG */ - tLABEL_END = 351, /* tLABEL_END */ - tIGNORED_NL = 352, /* tIGNORED_NL */ - tCOMMENT = 353, /* tCOMMENT */ - tEMBDOC_BEG = 354, /* tEMBDOC_BEG */ - tEMBDOC = 355, /* tEMBDOC */ - tEMBDOC_END = 356, /* tEMBDOC_END */ - tHEREDOC_BEG = 357, /* tHEREDOC_BEG */ - tHEREDOC_END = 358, /* tHEREDOC_END */ - k__END__ = 359, /* k__END__ */ - tLOWEST = 360, /* tLOWEST */ - tUMINUS_NUM = 361, /* tUMINUS_NUM */ - tLAST_TOKEN = 362 /* tLAST_TOKEN */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 2755 "parse.y" - - NODE *node; - rb_node_fcall_t *node_fcall; - rb_node_args_t *node_args; - rb_node_args_aux_t *node_args_aux; - rb_node_opt_arg_t *node_opt_arg; - rb_node_kw_arg_t *node_kw_arg; - rb_node_block_pass_t *node_block_pass; - rb_node_masgn_t *node_masgn; - rb_node_def_temp_t *node_def_temp; - rb_node_exits_t *node_exits; - ID id; - int num; - st_table *tbl; - st_table *labels; - const struct vtable *vars; - struct rb_strterm_struct *strterm; - struct lex_context ctxt; - -#line 214 "parse.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE YYLTYPE; -struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - - - -int yyparse (struct parser_params *p); - - - -#endif /* !YY_YY_PARSE_H_INCLUDED */ - diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h deleted file mode 100644 index ca75352..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h +++ /dev/null @@ -1,564 +0,0 @@ -#ifndef INTERNAL_BITS2_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BITS2_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for bitwise integer algorithms. - * @see Henry S. Warren Jr., "Hacker's Delight" (2nd ed.), 2013. - * @see SEI CERT C Coding Standard INT32-C. "Ensure that operations on - * signed integers do not result in overflow" - * @see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateleft - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateright - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/byteswap-uint64-byteswap-ulong-byteswap-ushort - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/rotl-rotl64-rotr-rotr64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/lzcnt16-lzcnt-lzcnt64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_tzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotl64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotr64 - * @see https://stackoverflow.com/a/776523 - */ -#include "ruby/internal/config.h" -#include /* for CHAR_BITS */ -#include /* for uintptr_t */ -#include "internal/compilers.h" /* for MSC_VERSION_SINCE */ - -#if MSC_VERSION_SINCE(1310) -# include /* for _byteswap_uint64 */ -#endif - -#if defined(HAVE_X86INTRIN_H) -# include /* for _lzcnt_u64 */ -#elif MSC_VERSION_SINCE(1310) -# include /* for the following intrinsics */ -#endif - -#if defined(_MSC_VER) && defined(__AVX__) -# pragma intrinsic(__popcnt) -# pragma intrinsic(__popcnt64) -#endif - -#if defined(_MSC_VER) && defined(__AVX2__) -# pragma intrinsic(__lzcnt) -# pragma intrinsic(__lzcnt64) -#endif - -#if MSC_VERSION_SINCE(1310) -# pragma intrinsic(_rotl) -# pragma intrinsic(_rotr) -# ifdef _WIN64 -# pragma intrinsic(_rotl64) -# pragma intrinsic(_rotr64) -# endif -#endif - -#if MSC_VERSION_SINCE(1400) -# pragma intrinsic(_BitScanForward) -# pragma intrinsic(_BitScanReverse) -# ifdef _WIN64 -# pragma intrinsic(_BitScanForward64) -# pragma intrinsic(_BitScanReverse64) -# endif -#endif - -#include "parser_value.h" /* for VALUE */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ - -/* The most significant bit of the lower part of half-long integer. - * If sizeof(long) == 4, this is 0x8000. - * If sizeof(long) == 8, this is 0x80000000. - */ -#define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2)) - -#define SIGNED_INTEGER_TYPE_P(T) (0 > ((T)0)-1) - -#define SIGNED_INTEGER_MIN(T) \ - ((sizeof(T) == sizeof(int8_t)) ? ((T)INT8_MIN) : \ - ((sizeof(T) == sizeof(int16_t)) ? ((T)INT16_MIN) : \ - ((sizeof(T) == sizeof(int32_t)) ? ((T)INT32_MIN) : \ - ((sizeof(T) == sizeof(int64_t)) ? ((T)INT64_MIN) : \ - 0)))) - -#define SIGNED_INTEGER_MAX(T) ((T)(SIGNED_INTEGER_MIN(T) ^ ((T)~(T)0))) - -#define UNSIGNED_INTEGER_MAX(T) ((T)~(T)0) - -#if __has_builtin(__builtin_mul_overflow_p) -# define MUL_OVERFLOW_P(a, b) \ - __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0) -#elif __has_builtin(__builtin_mul_overflow) -# define MUL_OVERFLOW_P(a, b) \ - __extension__ ({ __typeof__(a) c; __builtin_mul_overflow((a), (b), &c); }) -#endif - -#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \ - (a) == 0 ? 0 : \ - (a) == -1 ? (b) < -(max) : \ - (a) > 0 ? \ - ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \ - ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b))) - -#if __has_builtin(__builtin_mul_overflow_p) -/* __builtin_mul_overflow_p can take bitfield */ -/* and GCC permits bitfields for integers other than int */ -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - __extension__ ({ \ - struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \ - __builtin_mul_overflow_p((a), (b), c.fixnum); \ - }) -#else -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX) -#endif - -#ifdef MUL_OVERFLOW_P -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b) -#else -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX) -#endif - -#ifdef HAVE_UINT128_T -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - sizeof(x) <= sizeof(int64_t) ? 64 - nlz_int64((uint64_t)(x)) : \ - 128 - nlz_int128((uint128_t)(x))) -#else -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - 64 - nlz_int64((uint64_t)(x))) -#endif - -#ifndef swap16 -# define swap16 ruby_swap16 -#endif - -#ifndef swap32 -# define swap32 ruby_swap32 -#endif - -#ifndef swap64 -# define swap64 ruby_swap64 -#endif - -static inline uint16_t ruby_swap16(uint16_t); -static inline uint32_t ruby_swap32(uint32_t); -static inline uint64_t ruby_swap64(uint64_t); -static inline unsigned nlz_int(unsigned x); -static inline unsigned nlz_long(unsigned long x); -static inline unsigned nlz_long_long(unsigned long long x); -static inline unsigned nlz_intptr(uintptr_t x); -static inline unsigned nlz_int32(uint32_t x); -static inline unsigned nlz_int64(uint64_t x); -#ifdef HAVE_UINT128_T -static inline unsigned nlz_int128(uint128_t x); -#endif -static inline unsigned rb_popcount32(uint32_t x); -static inline unsigned rb_popcount64(uint64_t x); -static inline unsigned rb_popcount_intptr(uintptr_t x); -static inline int ntz_int32(uint32_t x); -static inline int ntz_int64(uint64_t x); -static inline int ntz_intptr(uintptr_t x); -static inline VALUE RUBY_BIT_ROTL(VALUE, int); -static inline VALUE RUBY_BIT_ROTR(VALUE, int); - -static inline uint16_t -ruby_swap16(uint16_t x) -{ -#if __has_builtin(__builtin_bswap16) - return __builtin_bswap16(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ushort(x); - -#else - return (x << 8) | (x >> 8); - -#endif -} - -static inline uint32_t -ruby_swap32(uint32_t x) -{ -#if __has_builtin(__builtin_bswap32) - return __builtin_bswap32(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ulong(x); - -#else - x = ((x & 0x0000FFFF) << 16) | ((x & 0xFFFF0000) >> 16); - x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >> 8); - return x; - -#endif -} - -static inline uint64_t -ruby_swap64(uint64_t x) -{ -#if __has_builtin(__builtin_bswap64) - return __builtin_bswap64(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_uint64(x); - -#else - x = ((x & 0x00000000FFFFFFFFULL) << 32) | ((x & 0xFFFFFFFF00000000ULL) >> 32); - x = ((x & 0x0000FFFF0000FFFFULL) << 16) | ((x & 0xFFFF0000FFFF0000ULL) >> 16); - x = ((x & 0x00FF00FF00FF00FFULL) << 8) | ((x & 0xFF00FF00FF00FF00ULL) >> 8); - return x; - -#endif -} - -static inline unsigned int -nlz_int32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - /* Note: It seems there is no such thing like __LZCNT__ predefined in MSVC. - * AMD CPUs have had this instruction for decades (since K10) but for - * Intel, Haswell is the oldest one. We need to use __AVX2__ for maximum - * safety. */ - return (unsigned int)__lzcnt(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse(&r, x) ? (31 - (int)r) : 32; - -#elif __has_builtin(__builtin_clz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned int)__builtin_clz(x) : 32; - -#else - uint32_t y; - unsigned n = 32; - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); -#endif -} - -static inline unsigned int -nlz_int64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - return (unsigned int)__lzcnt64(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64; - -#elif __has_builtin(__builtin_clzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - uint64_t y; - unsigned int n = 64; - y = x >> 32; if (y) {n -= 32; x = y;} - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); - -#endif -} - -#ifdef HAVE_UINT128_T -static inline unsigned int -nlz_int128(uint128_t x) -{ - uint64_t y = (uint64_t)(x >> 64); - - if (x == 0) { - return 128; - } - else if (y == 0) { - return (unsigned int)nlz_int64(x) + 64; - } - else { - return (unsigned int)nlz_int64(y); - } -} -#endif - -static inline unsigned int -nlz_int(unsigned int x) -{ - if (sizeof(unsigned int) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned int) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long(unsigned long x) -{ - if (sizeof(unsigned long) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long_long(unsigned long long x) -{ - if (sizeof(unsigned long long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } -#ifdef HAVE_UINT128_T - else if (sizeof(unsigned long long) * CHAR_BIT == 128) { - return nlz_int128((uint128_t)x); - } -#endif - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) == sizeof(unsigned int)) { - return nlz_int((unsigned int)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long)) { - return nlz_long((unsigned long)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long long)) { - return nlz_long_long((unsigned long long)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -rb_popcount32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - /* Note: CPUs since Nehalem and Barcelona have had this instruction so SSE - * 4.2 should suffice, but it seems there is no such thing like __SSE_4_2__ - * predefined macro in MSVC. They do have __AVX__ so use it instead. */ - return (unsigned int)__popcnt(x); - -#elif __has_builtin(__builtin_popcount) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT >= 32); - return (unsigned int)__builtin_popcount(x); - -#else - x = (x & 0x55555555) + (x >> 1 & 0x55555555); - x = (x & 0x33333333) + (x >> 2 & 0x33333333); - x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f); - x = (x & 0x001f001f) + (x >> 8 & 0x001f001f); - x = (x & 0x0000003f) + (x >>16 & 0x0000003f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - return (unsigned int)__popcnt64(x); - -#elif __has_builtin(__builtin_popcount) - if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555); - x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333); - x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707); - x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f); - x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f); - x = (x & 0x000000000000007f) + (x >>32 & 0x000000000000007f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return rb_popcount64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return rb_popcount32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline int -ntz_int32(uint32_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) - /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using - * assembly? Because issuing LZCNT seems possible (see nlz.h). */ - unsigned long r; - return _BitScanForward(&r, x) ? (int)r : 32; - -#elif __has_builtin(__builtin_ctz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned)__builtin_ctz(x) : 32; - -#else - return rb_popcount32((~x) & (x-1)); - -#endif -} - -static inline int -ntz_int64(uint64_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) - unsigned long r; - return _BitScanForward64(&r, x) ? (int)r : 64; - -#elif __has_builtin(__builtin_ctzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - return rb_popcount64((~x) & (x-1)); - -#endif -} - -static inline int -ntz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return ntz_int64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return ntz_int32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline VALUE -RUBY_BIT_ROTL(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateleft32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateleft32(v, n); - -#elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateleft64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotl(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotl64(v, n); - -#elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotl(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (n & m)) | (v >> (-n & m)); -#endif -} - -static inline VALUE -RUBY_BIT_ROTR(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateright32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateright32(v, n); - -#elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateright64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotr(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotr64(v, n); - -#elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotr(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (-n & m)) | (v >> (n & m)); -#endif -} - -#endif /* INTERNAL_BITS2_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h deleted file mode 100644 index 2955720..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef RUBY_PARSER_NODE_H -#define RUBY_PARSER_NODE_H 1 -/* - * This is a header file used by only "parse.y" - */ -#include "rubyparser.h" -#include "internal/compilers.h" - -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -static inline rb_code_location_t -code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2) -{ - rb_code_location_t loc; - loc.beg_pos = loc1->beg_pos; - loc.end_pos = loc2->end_pos; - return loc; -} - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_PARSER_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h deleted file mode 100644 index 877b1e9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h +++ /dev/null @@ -1,162 +0,0 @@ -/* This is a public domain general purpose hash table package - originally written by Peter Moore @ UCB. - - The hash table data structures were redesigned and the package was - rewritten by Vladimir Makarov . */ - -#ifndef RUBY_ST2_H -#define RUBY_ST2_H 1 - -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -#include -#include -#include "ruby/config.h" -#include "ruby/backward/2/long_long.h" -#include "ruby/defines.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#if SIZEOF_LONG == SIZEOF_VOIDP -typedef unsigned long parser_st_data_t; -#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP -typedef unsigned LONG_LONG parser_st_data_t; -#else -# error ---->> parser_st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- -#endif -#define ST2_DATA_T_DEFINED - -#ifndef CHAR_BIT -# ifdef HAVE_LIMITS_H -# include -# else -# define CHAR_BIT 8 -# endif -#endif -#ifndef _ -# define _(args) args -#endif -#ifndef ANYARGS -# ifdef __cplusplus -# define ANYARGS ... -# else -# define ANYARGS -# endif -#endif - -typedef struct parser_st_table parser_st_table; - -typedef parser_st_data_t parser_st_index_t; - -/* Maximal value of unsigned integer type parser_st_index_t. */ -#define MAX_ST2_INDEX_VAL (~(parser_st_index_t) 0) - -typedef int parser_st_compare_func(parser_st_data_t, parser_st_data_t); -typedef parser_st_index_t parser_st_hash_func(parser_st_data_t); - -typedef char st_check_for_sizeof_parser_st_index_t[SIZEOF_VOIDP == (int)sizeof(parser_st_index_t) ? 1 : -1]; -#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP - -struct parser_st_hash_type { - int (*compare)(parser_st_data_t, parser_st_data_t); /* parser_st_compare_func* */ - parser_st_index_t (*hash)(parser_st_data_t); /* parser_st_hash_func* */ -}; - -#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT) - -#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR) && defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P) -# define ST2_DATA_COMPATIBLE_P(type) \ - __builtin_choose_expr(__builtin_types_compatible_p(type, parser_st_data_t), 1, 0) -#else -# define ST2_DATA_COMPATIBLE_P(type) 0 -#endif - -typedef struct parser_st_table_entry parser_st_table_entry; - -struct parser_st_table_entry; /* defined in parser_st.c */ - -struct parser_st_table { - /* Cached features of the table -- see st.c for more details. */ - unsigned char entry_power, bin_power, size_ind; - /* How many times the table was rebuilt. */ - unsigned int rebuilds_num; - const struct parser_st_hash_type *type; - /* Number of entries currently in the table. */ - parser_st_index_t num_entries; - /* Array of bins used for access by keys. */ - parser_st_index_t *bins; - /* Start and bound index of entries in array entries. - entries_starts and entries_bound are in interval - [0,allocated_entries]. */ - parser_st_index_t entries_start, entries_bound; - /* Array of size 2^entry_power. */ - parser_st_table_entry *entries; -}; - -#define parser_st_is_member(table,key) rb_parser_st_lookup((table),(key),(parser_st_data_t *)0) - -enum parser_st_retval {ST2_CONTINUE, ST2_STOP, ST2_DELETE, ST2_CHECK, ST2_REPLACE}; - -size_t rb_parser_st_table_size(const struct parser_st_table *tbl); -parser_st_table *rb_parser_st_init_table(const struct parser_st_hash_type *); -parser_st_table *rb_parser_st_init_table_with_size(const struct parser_st_hash_type *, parser_st_index_t); -parser_st_table *rb_parser_st_init_existing_table_with_size(parser_st_table *, const struct parser_st_hash_type *, parser_st_index_t); -parser_st_table *rb_parser_st_init_numtable(void); -parser_st_table *rb_parser_st_init_numtable_with_size(parser_st_index_t); -parser_st_table *rb_parser_st_init_strtable(void); -parser_st_table *rb_parser_st_init_strtable_with_size(parser_st_index_t); -parser_st_table *rb_parser_st_init_strcasetable(void); -parser_st_table *rb_parser_st_init_strcasetable_with_size(parser_st_index_t); -int rb_parser_st_delete(parser_st_table *, parser_st_data_t *, parser_st_data_t *); /* returns 0:notfound 1:deleted */ -int rb_parser_st_delete_safe(parser_st_table *, parser_st_data_t *, parser_st_data_t *, parser_st_data_t); -int rb_parser_st_shift(parser_st_table *, parser_st_data_t *, parser_st_data_t *); /* returns 0:notfound 1:deleted */ -int rb_parser_st_insert(parser_st_table *, parser_st_data_t, parser_st_data_t); -int rb_parser_st_insert2(parser_st_table *, parser_st_data_t, parser_st_data_t, parser_st_data_t (*)(parser_st_data_t)); -int rb_parser_st_lookup(parser_st_table *, parser_st_data_t, parser_st_data_t *); -int rb_parser_st_get_key(parser_st_table *, parser_st_data_t, parser_st_data_t *); -typedef int parser_st_update_callback_func(parser_st_data_t *key, parser_st_data_t *value, parser_st_data_t arg, int existing); -/* *key may be altered, but must equal to the old key, i.e., the - * results of hash() are same and compare() returns 0, otherwise the - * behavior is undefined */ -int rb_parser_st_update(parser_st_table *table, parser_st_data_t key, parser_st_update_callback_func *func, parser_st_data_t arg); -typedef int parser_st_foreach_callback_func(parser_st_data_t, parser_st_data_t, parser_st_data_t); -typedef int parser_st_foreach_check_callback_func(parser_st_data_t, parser_st_data_t, parser_st_data_t, int); -int rb_parser_st_foreach_with_replace(parser_st_table *tab, parser_st_foreach_check_callback_func *func, parser_st_update_callback_func *replace, parser_st_data_t arg); -int rb_parser_st_foreach(parser_st_table *, parser_st_foreach_callback_func *, parser_st_data_t); -int rb_parser_st_foreach_check(parser_st_table *, parser_st_foreach_check_callback_func *, parser_st_data_t, parser_st_data_t); -parser_st_index_t rb_parser_st_keys(parser_st_table *table, parser_st_data_t *keys, parser_st_index_t size); -parser_st_index_t rb_parser_st_keys_check(parser_st_table *table, parser_st_data_t *keys, parser_st_index_t size, parser_st_data_t never); -parser_st_index_t rb_parser_st_values(parser_st_table *table, parser_st_data_t *values, parser_st_index_t size); -parser_st_index_t rb_parser_st_values_check(parser_st_table *table, parser_st_data_t *values, parser_st_index_t size, parser_st_data_t never); -void rb_parser_st_add_direct(parser_st_table *, parser_st_data_t, parser_st_data_t); -void rb_parser_st_free_table(parser_st_table *); -void rb_parser_st_cleanup_safe(parser_st_table *, parser_st_data_t); -void rb_parser_st_clear(parser_st_table *); -parser_st_table *rb_parser_st_replace(parser_st_table *, parser_st_table *); -parser_st_table *rb_parser_st_copy(parser_st_table *); -CONSTFUNC(int rb_parser_st_numcmp(parser_st_data_t, parser_st_data_t)); -CONSTFUNC(parser_st_index_t rb_parser_st_numhash(parser_st_data_t)); -PUREFUNC(int rb_parser_st_locale_insensitive_strcasecmp(const char *s1, const char *s2)); -PUREFUNC(int rb_parser_st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n)); -PUREFUNC(size_t rb_parser_st_memsize(const parser_st_table *)); -PUREFUNC(parser_st_index_t rb_parser_st_hash(const void *ptr, size_t len, parser_st_index_t h)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_uint32(parser_st_index_t h, uint32_t i)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_uint(parser_st_index_t h, parser_st_index_t i)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_end(parser_st_index_t h)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_start(parser_st_index_t h)); - -RUBY_SYMBOL_EXPORT_END - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_ST2_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h deleted file mode 100644 index 4fe444e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef EXTERNAL_VALUE_H -#define EXTERNAL_VALUE_H - -#include "ruby/config.h" - -#if defined(__DOXYGEN__) - -/** - * Type that represents a Ruby object. It is an unsigned integer of some kind, - * depending on platforms. - * - * ```CXX - * VALUE value = rb_eval_string("ARGF.readlines.map.with_index"); - * ``` - * - * @warning ::VALUE is not a pointer. - * @warning ::VALUE can be wider than `long`. - */ -typedef uintptr_t VALUE; - -/** - * Type that represents a Ruby identifier such as a variable name. - * - * ```CXX - * ID method = rb_intern("method"); - * VALUE result = rb_funcall(obj, method, 0); - * ``` - * - * @note ::rb_cSymbol is a Ruby-level data type for the same thing. - */ -typedef uintptr_t ID; - -/** - * A signed integer type that has the same width with ::VALUE. - * - * @internal - * - * @shyouhei wonders: is it guaranteed that `uintptr_t` and `intptr_t` are the - * same width? As far as I read ISO/IEC 9899:2018 section 7.20.1.4 paragraph 1 - * no such description is given... or defined elsewhere? - */ -typedef intptr_t SIGNED_VALUE; - -/** - * Identical to `sizeof(VALUE)`, except it is a macro that can also be used - * inside of preprocessor directives such as `#if`. Handy on occasions. - */ -#define SIZEOF_VALUE SIZEOF_UINTPTR_T - -/** - * @private - * - * A compile-time constant of type ::VALUE whose value is 0. - */ -#define RBIMPL_VALUE_NULL UINTPTR_C(0) - -/** - * @private - * - * A compile-time constant of type ::VALUE whose value is 1. - */ -#define RBIMPL_VALUE_ONE UINTPTR_C(1) - -/** - * @private - * - * Maximum possible value that a ::VALUE can take. - */ -#define RBIMPL_VALUE_FULL UINTPTR_MAX - -#elif defined HAVE_UINTPTR_T && 0 -typedef uintptr_t VALUE; -typedef uintptr_t ID; -# define SIGNED_VALUE intptr_t -# define SIZEOF_VALUE SIZEOF_UINTPTR_T -# undef PRI_VALUE_PREFIX -# define RBIMPL_VALUE_NULL UINTPTR_C(0) -# define RBIMPL_VALUE_ONE UINTPTR_C(1) -# define RBIMPL_VALUE_FULL UINTPTR_MAX - -#elif SIZEOF_LONG == SIZEOF_VOIDP -typedef unsigned long VALUE; -typedef unsigned long ID; -# define SIGNED_VALUE long -# define SIZEOF_VALUE SIZEOF_LONG -# define PRI_VALUE_PREFIX "l" -# define RBIMPL_VALUE_NULL 0UL -# define RBIMPL_VALUE_ONE 1UL -# define RBIMPL_VALUE_FULL ULONG_MAX - -#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP -typedef unsigned LONG_LONG VALUE; -typedef unsigned LONG_LONG ID; -# define SIGNED_VALUE LONG_LONG -# define LONG_LONG_VALUE 1 -# define SIZEOF_VALUE SIZEOF_LONG_LONG -# define PRI_VALUE_PREFIX PRI_LL_PREFIX -# define RBIMPL_VALUE_NULL 0ULL -# define RBIMPL_VALUE_ONE 1ULL -# define RBIMPL_VALUE_FULL ULLONG_MAX - -#else -# error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- -#endif - -#endif /* EXTERNAL_VALUE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h deleted file mode 100644 index 7c40ca2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h +++ /dev/null @@ -1,6245 +0,0 @@ -/******************************************************************************/ -/* This file is generated by the templates/template.rb script and should not */ -/* be modified manually. See */ -/* templates/include/prism/ast.h.erb */ -/* if you are looking to modify the */ -/* template */ -/******************************************************************************/ - -/** - * @file ast.h - * - * The abstract syntax tree. - */ -#ifndef PRISM_AST_H -#define PRISM_AST_H - -#include "prism/defines.h" -#include "prism/util/pm_constant_pool.h" -#include "prism/util/pm_integer.h" -#include "prism/util/pm_string.h" - -#include -#include -#include - -/** - * This enum represents every type of token in the Ruby source. - */ -typedef enum pm_token_type { - /** final token in the file */ - PM_TOKEN_EOF = 1, - - /** a token that was expected but not found */ - PM_TOKEN_MISSING, - - /** a token that was not present but it is okay */ - PM_TOKEN_NOT_PROVIDED, - - /** & */ - PM_TOKEN_AMPERSAND, - - /** && */ - PM_TOKEN_AMPERSAND_AMPERSAND, - - /** &&= */ - PM_TOKEN_AMPERSAND_AMPERSAND_EQUAL, - - /** &. */ - PM_TOKEN_AMPERSAND_DOT, - - /** &= */ - PM_TOKEN_AMPERSAND_EQUAL, - - /** ` */ - PM_TOKEN_BACKTICK, - - /** a back reference */ - PM_TOKEN_BACK_REFERENCE, - - /** ! or !@ */ - PM_TOKEN_BANG, - - /** != */ - PM_TOKEN_BANG_EQUAL, - - /** !~ */ - PM_TOKEN_BANG_TILDE, - - /** { */ - PM_TOKEN_BRACE_LEFT, - - /** } */ - PM_TOKEN_BRACE_RIGHT, - - /** [ */ - PM_TOKEN_BRACKET_LEFT, - - /** [ for the beginning of an array */ - PM_TOKEN_BRACKET_LEFT_ARRAY, - - /** [] */ - PM_TOKEN_BRACKET_LEFT_RIGHT, - - /** []= */ - PM_TOKEN_BRACKET_LEFT_RIGHT_EQUAL, - - /** ] */ - PM_TOKEN_BRACKET_RIGHT, - - /** ^ */ - PM_TOKEN_CARET, - - /** ^= */ - PM_TOKEN_CARET_EQUAL, - - /** a character literal */ - PM_TOKEN_CHARACTER_LITERAL, - - /** a class variable */ - PM_TOKEN_CLASS_VARIABLE, - - /** : */ - PM_TOKEN_COLON, - - /** :: */ - PM_TOKEN_COLON_COLON, - - /** , */ - PM_TOKEN_COMMA, - - /** a comment */ - PM_TOKEN_COMMENT, - - /** a constant */ - PM_TOKEN_CONSTANT, - - /** the . call operator */ - PM_TOKEN_DOT, - - /** the .. range operator */ - PM_TOKEN_DOT_DOT, - - /** the ... range operator or forwarding parameter */ - PM_TOKEN_DOT_DOT_DOT, - - /** =begin */ - PM_TOKEN_EMBDOC_BEGIN, - - /** =end */ - PM_TOKEN_EMBDOC_END, - - /** a line inside of embedded documentation */ - PM_TOKEN_EMBDOC_LINE, - - /** #{ */ - PM_TOKEN_EMBEXPR_BEGIN, - - /** } */ - PM_TOKEN_EMBEXPR_END, - - /** # */ - PM_TOKEN_EMBVAR, - - /** = */ - PM_TOKEN_EQUAL, - - /** == */ - PM_TOKEN_EQUAL_EQUAL, - - /** === */ - PM_TOKEN_EQUAL_EQUAL_EQUAL, - - /** => */ - PM_TOKEN_EQUAL_GREATER, - - /** =~ */ - PM_TOKEN_EQUAL_TILDE, - - /** a floating point number */ - PM_TOKEN_FLOAT, - - /** a floating pointer number with an imaginary suffix */ - PM_TOKEN_FLOAT_IMAGINARY, - - /** a floating pointer number with a rational suffix */ - PM_TOKEN_FLOAT_RATIONAL, - - /** a floating pointer number with a rational and imaginary suffix */ - PM_TOKEN_FLOAT_RATIONAL_IMAGINARY, - - /** a global variable */ - PM_TOKEN_GLOBAL_VARIABLE, - - /** > */ - PM_TOKEN_GREATER, - - /** >= */ - PM_TOKEN_GREATER_EQUAL, - - /** >> */ - PM_TOKEN_GREATER_GREATER, - - /** >>= */ - PM_TOKEN_GREATER_GREATER_EQUAL, - - /** the end of a heredoc */ - PM_TOKEN_HEREDOC_END, - - /** the start of a heredoc */ - PM_TOKEN_HEREDOC_START, - - /** an identifier */ - PM_TOKEN_IDENTIFIER, - - /** an ignored newline */ - PM_TOKEN_IGNORED_NEWLINE, - - /** an instance variable */ - PM_TOKEN_INSTANCE_VARIABLE, - - /** an integer (any base) */ - PM_TOKEN_INTEGER, - - /** an integer with an imaginary suffix */ - PM_TOKEN_INTEGER_IMAGINARY, - - /** an integer with a rational suffix */ - PM_TOKEN_INTEGER_RATIONAL, - - /** an integer with a rational and imaginary suffix */ - PM_TOKEN_INTEGER_RATIONAL_IMAGINARY, - - /** alias */ - PM_TOKEN_KEYWORD_ALIAS, - - /** and */ - PM_TOKEN_KEYWORD_AND, - - /** begin */ - PM_TOKEN_KEYWORD_BEGIN, - - /** BEGIN */ - PM_TOKEN_KEYWORD_BEGIN_UPCASE, - - /** break */ - PM_TOKEN_KEYWORD_BREAK, - - /** case */ - PM_TOKEN_KEYWORD_CASE, - - /** class */ - PM_TOKEN_KEYWORD_CLASS, - - /** def */ - PM_TOKEN_KEYWORD_DEF, - - /** defined? */ - PM_TOKEN_KEYWORD_DEFINED, - - /** do */ - PM_TOKEN_KEYWORD_DO, - - /** do keyword for a predicate in a while, until, or for loop */ - PM_TOKEN_KEYWORD_DO_LOOP, - - /** else */ - PM_TOKEN_KEYWORD_ELSE, - - /** elsif */ - PM_TOKEN_KEYWORD_ELSIF, - - /** end */ - PM_TOKEN_KEYWORD_END, - - /** END */ - PM_TOKEN_KEYWORD_END_UPCASE, - - /** ensure */ - PM_TOKEN_KEYWORD_ENSURE, - - /** false */ - PM_TOKEN_KEYWORD_FALSE, - - /** for */ - PM_TOKEN_KEYWORD_FOR, - - /** if */ - PM_TOKEN_KEYWORD_IF, - - /** if in the modifier form */ - PM_TOKEN_KEYWORD_IF_MODIFIER, - - /** in */ - PM_TOKEN_KEYWORD_IN, - - /** module */ - PM_TOKEN_KEYWORD_MODULE, - - /** next */ - PM_TOKEN_KEYWORD_NEXT, - - /** nil */ - PM_TOKEN_KEYWORD_NIL, - - /** not */ - PM_TOKEN_KEYWORD_NOT, - - /** or */ - PM_TOKEN_KEYWORD_OR, - - /** redo */ - PM_TOKEN_KEYWORD_REDO, - - /** rescue */ - PM_TOKEN_KEYWORD_RESCUE, - - /** rescue in the modifier form */ - PM_TOKEN_KEYWORD_RESCUE_MODIFIER, - - /** retry */ - PM_TOKEN_KEYWORD_RETRY, - - /** return */ - PM_TOKEN_KEYWORD_RETURN, - - /** self */ - PM_TOKEN_KEYWORD_SELF, - - /** super */ - PM_TOKEN_KEYWORD_SUPER, - - /** then */ - PM_TOKEN_KEYWORD_THEN, - - /** true */ - PM_TOKEN_KEYWORD_TRUE, - - /** undef */ - PM_TOKEN_KEYWORD_UNDEF, - - /** unless */ - PM_TOKEN_KEYWORD_UNLESS, - - /** unless in the modifier form */ - PM_TOKEN_KEYWORD_UNLESS_MODIFIER, - - /** until */ - PM_TOKEN_KEYWORD_UNTIL, - - /** until in the modifier form */ - PM_TOKEN_KEYWORD_UNTIL_MODIFIER, - - /** when */ - PM_TOKEN_KEYWORD_WHEN, - - /** while */ - PM_TOKEN_KEYWORD_WHILE, - - /** while in the modifier form */ - PM_TOKEN_KEYWORD_WHILE_MODIFIER, - - /** yield */ - PM_TOKEN_KEYWORD_YIELD, - - /** __ENCODING__ */ - PM_TOKEN_KEYWORD___ENCODING__, - - /** __FILE__ */ - PM_TOKEN_KEYWORD___FILE__, - - /** __LINE__ */ - PM_TOKEN_KEYWORD___LINE__, - - /** a label */ - PM_TOKEN_LABEL, - - /** the end of a label */ - PM_TOKEN_LABEL_END, - - /** { */ - PM_TOKEN_LAMBDA_BEGIN, - - /** < */ - PM_TOKEN_LESS, - - /** <= */ - PM_TOKEN_LESS_EQUAL, - - /** <=> */ - PM_TOKEN_LESS_EQUAL_GREATER, - - /** << */ - PM_TOKEN_LESS_LESS, - - /** <<= */ - PM_TOKEN_LESS_LESS_EQUAL, - - /** a method name */ - PM_TOKEN_METHOD_NAME, - - /** - */ - PM_TOKEN_MINUS, - - /** -= */ - PM_TOKEN_MINUS_EQUAL, - - /** -> */ - PM_TOKEN_MINUS_GREATER, - - /** a newline character outside of other tokens */ - PM_TOKEN_NEWLINE, - - /** a numbered reference to a capture group in the previous regular expression match */ - PM_TOKEN_NUMBERED_REFERENCE, - - /** ( */ - PM_TOKEN_PARENTHESIS_LEFT, - - /** ( for a parentheses node */ - PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES, - - /** ) */ - PM_TOKEN_PARENTHESIS_RIGHT, - - /** % */ - PM_TOKEN_PERCENT, - - /** %= */ - PM_TOKEN_PERCENT_EQUAL, - - /** %i */ - PM_TOKEN_PERCENT_LOWER_I, - - /** %w */ - PM_TOKEN_PERCENT_LOWER_W, - - /** %x */ - PM_TOKEN_PERCENT_LOWER_X, - - /** %I */ - PM_TOKEN_PERCENT_UPPER_I, - - /** %W */ - PM_TOKEN_PERCENT_UPPER_W, - - /** | */ - PM_TOKEN_PIPE, - - /** |= */ - PM_TOKEN_PIPE_EQUAL, - - /** || */ - PM_TOKEN_PIPE_PIPE, - - /** ||= */ - PM_TOKEN_PIPE_PIPE_EQUAL, - - /** + */ - PM_TOKEN_PLUS, - - /** += */ - PM_TOKEN_PLUS_EQUAL, - - /** ? */ - PM_TOKEN_QUESTION_MARK, - - /** the beginning of a regular expression */ - PM_TOKEN_REGEXP_BEGIN, - - /** the end of a regular expression */ - PM_TOKEN_REGEXP_END, - - /** ; */ - PM_TOKEN_SEMICOLON, - - /** / */ - PM_TOKEN_SLASH, - - /** /= */ - PM_TOKEN_SLASH_EQUAL, - - /** * */ - PM_TOKEN_STAR, - - /** *= */ - PM_TOKEN_STAR_EQUAL, - - /** ** */ - PM_TOKEN_STAR_STAR, - - /** **= */ - PM_TOKEN_STAR_STAR_EQUAL, - - /** the beginning of a string */ - PM_TOKEN_STRING_BEGIN, - - /** the contents of a string */ - PM_TOKEN_STRING_CONTENT, - - /** the end of a string */ - PM_TOKEN_STRING_END, - - /** the beginning of a symbol */ - PM_TOKEN_SYMBOL_BEGIN, - - /** ~ or ~@ */ - PM_TOKEN_TILDE, - - /** unary & */ - PM_TOKEN_UAMPERSAND, - - /** unary :: */ - PM_TOKEN_UCOLON_COLON, - - /** unary .. operator */ - PM_TOKEN_UDOT_DOT, - - /** unary ... operator */ - PM_TOKEN_UDOT_DOT_DOT, - - /** -@ */ - PM_TOKEN_UMINUS, - - /** -@ for a number */ - PM_TOKEN_UMINUS_NUM, - - /** +@ */ - PM_TOKEN_UPLUS, - - /** unary * */ - PM_TOKEN_USTAR, - - /** unary ** */ - PM_TOKEN_USTAR_STAR, - - /** a separator between words in a list */ - PM_TOKEN_WORDS_SEP, - - /** marker for the point in the file at which the parser should stop */ - PM_TOKEN___END__, - - /** The maximum token value. */ - PM_TOKEN_MAXIMUM, -} pm_token_type_t; - -/** - * This struct represents a token in the Ruby source. We use it to track both - * type and location information. - */ -typedef struct { - /** The type of the token. */ - pm_token_type_t type; - - /** A pointer to the start location of the token in the source. */ - const uint8_t *start; - - /** A pointer to the end location of the token in the source. */ - const uint8_t *end; -} pm_token_t; - -/** - * This represents a range of bytes in the source string to which a node or - * token corresponds. - */ -typedef struct { - /** A pointer to the start location of the range in the source. */ - const uint8_t *start; - - /** A pointer to the end location of the range in the source. */ - const uint8_t *end; -} pm_location_t; - -struct pm_node; - -/** - * A list of nodes in the source, most often used for lists of children. - */ -typedef struct pm_node_list { - /** The number of nodes in the list. */ - size_t size; - - /** The capacity of the list that has been allocated. */ - size_t capacity; - - /** The nodes in the list. */ - struct pm_node **nodes; -} pm_node_list_t; - -/** - * This enum represents every type of node in the Ruby syntax tree. - */ -enum pm_node_type { - /** AliasGlobalVariableNode */ - PM_ALIAS_GLOBAL_VARIABLE_NODE = 1, - - /** AliasMethodNode */ - PM_ALIAS_METHOD_NODE = 2, - - /** AlternationPatternNode */ - PM_ALTERNATION_PATTERN_NODE = 3, - - /** AndNode */ - PM_AND_NODE = 4, - - /** ArgumentsNode */ - PM_ARGUMENTS_NODE = 5, - - /** ArrayNode */ - PM_ARRAY_NODE = 6, - - /** ArrayPatternNode */ - PM_ARRAY_PATTERN_NODE = 7, - - /** AssocNode */ - PM_ASSOC_NODE = 8, - - /** AssocSplatNode */ - PM_ASSOC_SPLAT_NODE = 9, - - /** BackReferenceReadNode */ - PM_BACK_REFERENCE_READ_NODE = 10, - - /** BeginNode */ - PM_BEGIN_NODE = 11, - - /** BlockArgumentNode */ - PM_BLOCK_ARGUMENT_NODE = 12, - - /** BlockLocalVariableNode */ - PM_BLOCK_LOCAL_VARIABLE_NODE = 13, - - /** BlockNode */ - PM_BLOCK_NODE = 14, - - /** BlockParameterNode */ - PM_BLOCK_PARAMETER_NODE = 15, - - /** BlockParametersNode */ - PM_BLOCK_PARAMETERS_NODE = 16, - - /** BreakNode */ - PM_BREAK_NODE = 17, - - /** CallAndWriteNode */ - PM_CALL_AND_WRITE_NODE = 18, - - /** CallNode */ - PM_CALL_NODE = 19, - - /** CallOperatorWriteNode */ - PM_CALL_OPERATOR_WRITE_NODE = 20, - - /** CallOrWriteNode */ - PM_CALL_OR_WRITE_NODE = 21, - - /** CallTargetNode */ - PM_CALL_TARGET_NODE = 22, - - /** CapturePatternNode */ - PM_CAPTURE_PATTERN_NODE = 23, - - /** CaseMatchNode */ - PM_CASE_MATCH_NODE = 24, - - /** CaseNode */ - PM_CASE_NODE = 25, - - /** ClassNode */ - PM_CLASS_NODE = 26, - - /** ClassVariableAndWriteNode */ - PM_CLASS_VARIABLE_AND_WRITE_NODE = 27, - - /** ClassVariableOperatorWriteNode */ - PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE = 28, - - /** ClassVariableOrWriteNode */ - PM_CLASS_VARIABLE_OR_WRITE_NODE = 29, - - /** ClassVariableReadNode */ - PM_CLASS_VARIABLE_READ_NODE = 30, - - /** ClassVariableTargetNode */ - PM_CLASS_VARIABLE_TARGET_NODE = 31, - - /** ClassVariableWriteNode */ - PM_CLASS_VARIABLE_WRITE_NODE = 32, - - /** ConstantAndWriteNode */ - PM_CONSTANT_AND_WRITE_NODE = 33, - - /** ConstantOperatorWriteNode */ - PM_CONSTANT_OPERATOR_WRITE_NODE = 34, - - /** ConstantOrWriteNode */ - PM_CONSTANT_OR_WRITE_NODE = 35, - - /** ConstantPathAndWriteNode */ - PM_CONSTANT_PATH_AND_WRITE_NODE = 36, - - /** ConstantPathNode */ - PM_CONSTANT_PATH_NODE = 37, - - /** ConstantPathOperatorWriteNode */ - PM_CONSTANT_PATH_OPERATOR_WRITE_NODE = 38, - - /** ConstantPathOrWriteNode */ - PM_CONSTANT_PATH_OR_WRITE_NODE = 39, - - /** ConstantPathTargetNode */ - PM_CONSTANT_PATH_TARGET_NODE = 40, - - /** ConstantPathWriteNode */ - PM_CONSTANT_PATH_WRITE_NODE = 41, - - /** ConstantReadNode */ - PM_CONSTANT_READ_NODE = 42, - - /** ConstantTargetNode */ - PM_CONSTANT_TARGET_NODE = 43, - - /** ConstantWriteNode */ - PM_CONSTANT_WRITE_NODE = 44, - - /** DefNode */ - PM_DEF_NODE = 45, - - /** DefinedNode */ - PM_DEFINED_NODE = 46, - - /** ElseNode */ - PM_ELSE_NODE = 47, - - /** EmbeddedStatementsNode */ - PM_EMBEDDED_STATEMENTS_NODE = 48, - - /** EmbeddedVariableNode */ - PM_EMBEDDED_VARIABLE_NODE = 49, - - /** EnsureNode */ - PM_ENSURE_NODE = 50, - - /** FalseNode */ - PM_FALSE_NODE = 51, - - /** FindPatternNode */ - PM_FIND_PATTERN_NODE = 52, - - /** FlipFlopNode */ - PM_FLIP_FLOP_NODE = 53, - - /** FloatNode */ - PM_FLOAT_NODE = 54, - - /** ForNode */ - PM_FOR_NODE = 55, - - /** ForwardingArgumentsNode */ - PM_FORWARDING_ARGUMENTS_NODE = 56, - - /** ForwardingParameterNode */ - PM_FORWARDING_PARAMETER_NODE = 57, - - /** ForwardingSuperNode */ - PM_FORWARDING_SUPER_NODE = 58, - - /** GlobalVariableAndWriteNode */ - PM_GLOBAL_VARIABLE_AND_WRITE_NODE = 59, - - /** GlobalVariableOperatorWriteNode */ - PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE = 60, - - /** GlobalVariableOrWriteNode */ - PM_GLOBAL_VARIABLE_OR_WRITE_NODE = 61, - - /** GlobalVariableReadNode */ - PM_GLOBAL_VARIABLE_READ_NODE = 62, - - /** GlobalVariableTargetNode */ - PM_GLOBAL_VARIABLE_TARGET_NODE = 63, - - /** GlobalVariableWriteNode */ - PM_GLOBAL_VARIABLE_WRITE_NODE = 64, - - /** HashNode */ - PM_HASH_NODE = 65, - - /** HashPatternNode */ - PM_HASH_PATTERN_NODE = 66, - - /** IfNode */ - PM_IF_NODE = 67, - - /** ImaginaryNode */ - PM_IMAGINARY_NODE = 68, - - /** ImplicitNode */ - PM_IMPLICIT_NODE = 69, - - /** ImplicitRestNode */ - PM_IMPLICIT_REST_NODE = 70, - - /** InNode */ - PM_IN_NODE = 71, - - /** IndexAndWriteNode */ - PM_INDEX_AND_WRITE_NODE = 72, - - /** IndexOperatorWriteNode */ - PM_INDEX_OPERATOR_WRITE_NODE = 73, - - /** IndexOrWriteNode */ - PM_INDEX_OR_WRITE_NODE = 74, - - /** IndexTargetNode */ - PM_INDEX_TARGET_NODE = 75, - - /** InstanceVariableAndWriteNode */ - PM_INSTANCE_VARIABLE_AND_WRITE_NODE = 76, - - /** InstanceVariableOperatorWriteNode */ - PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE = 77, - - /** InstanceVariableOrWriteNode */ - PM_INSTANCE_VARIABLE_OR_WRITE_NODE = 78, - - /** InstanceVariableReadNode */ - PM_INSTANCE_VARIABLE_READ_NODE = 79, - - /** InstanceVariableTargetNode */ - PM_INSTANCE_VARIABLE_TARGET_NODE = 80, - - /** InstanceVariableWriteNode */ - PM_INSTANCE_VARIABLE_WRITE_NODE = 81, - - /** IntegerNode */ - PM_INTEGER_NODE = 82, - - /** InterpolatedMatchLastLineNode */ - PM_INTERPOLATED_MATCH_LAST_LINE_NODE = 83, - - /** InterpolatedRegularExpressionNode */ - PM_INTERPOLATED_REGULAR_EXPRESSION_NODE = 84, - - /** InterpolatedStringNode */ - PM_INTERPOLATED_STRING_NODE = 85, - - /** InterpolatedSymbolNode */ - PM_INTERPOLATED_SYMBOL_NODE = 86, - - /** InterpolatedXStringNode */ - PM_INTERPOLATED_X_STRING_NODE = 87, - - /** ItParametersNode */ - PM_IT_PARAMETERS_NODE = 88, - - /** KeywordHashNode */ - PM_KEYWORD_HASH_NODE = 89, - - /** KeywordRestParameterNode */ - PM_KEYWORD_REST_PARAMETER_NODE = 90, - - /** LambdaNode */ - PM_LAMBDA_NODE = 91, - - /** LocalVariableAndWriteNode */ - PM_LOCAL_VARIABLE_AND_WRITE_NODE = 92, - - /** LocalVariableOperatorWriteNode */ - PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE = 93, - - /** LocalVariableOrWriteNode */ - PM_LOCAL_VARIABLE_OR_WRITE_NODE = 94, - - /** LocalVariableReadNode */ - PM_LOCAL_VARIABLE_READ_NODE = 95, - - /** LocalVariableTargetNode */ - PM_LOCAL_VARIABLE_TARGET_NODE = 96, - - /** LocalVariableWriteNode */ - PM_LOCAL_VARIABLE_WRITE_NODE = 97, - - /** MatchLastLineNode */ - PM_MATCH_LAST_LINE_NODE = 98, - - /** MatchPredicateNode */ - PM_MATCH_PREDICATE_NODE = 99, - - /** MatchRequiredNode */ - PM_MATCH_REQUIRED_NODE = 100, - - /** MatchWriteNode */ - PM_MATCH_WRITE_NODE = 101, - - /** MissingNode */ - PM_MISSING_NODE = 102, - - /** ModuleNode */ - PM_MODULE_NODE = 103, - - /** MultiTargetNode */ - PM_MULTI_TARGET_NODE = 104, - - /** MultiWriteNode */ - PM_MULTI_WRITE_NODE = 105, - - /** NextNode */ - PM_NEXT_NODE = 106, - - /** NilNode */ - PM_NIL_NODE = 107, - - /** NoKeywordsParameterNode */ - PM_NO_KEYWORDS_PARAMETER_NODE = 108, - - /** NumberedParametersNode */ - PM_NUMBERED_PARAMETERS_NODE = 109, - - /** NumberedReferenceReadNode */ - PM_NUMBERED_REFERENCE_READ_NODE = 110, - - /** OptionalKeywordParameterNode */ - PM_OPTIONAL_KEYWORD_PARAMETER_NODE = 111, - - /** OptionalParameterNode */ - PM_OPTIONAL_PARAMETER_NODE = 112, - - /** OrNode */ - PM_OR_NODE = 113, - - /** ParametersNode */ - PM_PARAMETERS_NODE = 114, - - /** ParenthesesNode */ - PM_PARENTHESES_NODE = 115, - - /** PinnedExpressionNode */ - PM_PINNED_EXPRESSION_NODE = 116, - - /** PinnedVariableNode */ - PM_PINNED_VARIABLE_NODE = 117, - - /** PostExecutionNode */ - PM_POST_EXECUTION_NODE = 118, - - /** PreExecutionNode */ - PM_PRE_EXECUTION_NODE = 119, - - /** ProgramNode */ - PM_PROGRAM_NODE = 120, - - /** RangeNode */ - PM_RANGE_NODE = 121, - - /** RationalNode */ - PM_RATIONAL_NODE = 122, - - /** RedoNode */ - PM_REDO_NODE = 123, - - /** RegularExpressionNode */ - PM_REGULAR_EXPRESSION_NODE = 124, - - /** RequiredKeywordParameterNode */ - PM_REQUIRED_KEYWORD_PARAMETER_NODE = 125, - - /** RequiredParameterNode */ - PM_REQUIRED_PARAMETER_NODE = 126, - - /** RescueModifierNode */ - PM_RESCUE_MODIFIER_NODE = 127, - - /** RescueNode */ - PM_RESCUE_NODE = 128, - - /** RestParameterNode */ - PM_REST_PARAMETER_NODE = 129, - - /** RetryNode */ - PM_RETRY_NODE = 130, - - /** ReturnNode */ - PM_RETURN_NODE = 131, - - /** SelfNode */ - PM_SELF_NODE = 132, - - /** ShareableConstantNode */ - PM_SHAREABLE_CONSTANT_NODE = 133, - - /** SingletonClassNode */ - PM_SINGLETON_CLASS_NODE = 134, - - /** SourceEncodingNode */ - PM_SOURCE_ENCODING_NODE = 135, - - /** SourceFileNode */ - PM_SOURCE_FILE_NODE = 136, - - /** SourceLineNode */ - PM_SOURCE_LINE_NODE = 137, - - /** SplatNode */ - PM_SPLAT_NODE = 138, - - /** StatementsNode */ - PM_STATEMENTS_NODE = 139, - - /** StringNode */ - PM_STRING_NODE = 140, - - /** SuperNode */ - PM_SUPER_NODE = 141, - - /** SymbolNode */ - PM_SYMBOL_NODE = 142, - - /** TrueNode */ - PM_TRUE_NODE = 143, - - /** UndefNode */ - PM_UNDEF_NODE = 144, - - /** UnlessNode */ - PM_UNLESS_NODE = 145, - - /** UntilNode */ - PM_UNTIL_NODE = 146, - - /** WhenNode */ - PM_WHEN_NODE = 147, - - /** WhileNode */ - PM_WHILE_NODE = 148, - - /** XStringNode */ - PM_X_STRING_NODE = 149, - - /** YieldNode */ - PM_YIELD_NODE = 150, - - /** A special kind of node used for compilation. */ - PM_SCOPE_NODE -}; - -/** - * This is the type of node embedded in the node struct. We explicitly control - * the size of it here to avoid having the variable-width enum. - */ -typedef uint16_t pm_node_type_t; - -/** - * These are the flags embedded in the node struct. We explicitly control the - * size of it here to avoid having the variable-width enum. - */ -typedef uint16_t pm_node_flags_t; - -/** - * We store the flags enum in every node in the tree. Some flags are common to - * all nodes (the ones listed below). Others are specific to certain node types. - */ -#define PM_NODE_FLAG_BITS (sizeof(pm_node_flags_t) * 8) - -static const pm_node_flags_t PM_NODE_FLAG_NEWLINE = (1 << (PM_NODE_FLAG_BITS - 1)); -static const pm_node_flags_t PM_NODE_FLAG_STATIC_LITERAL = (1 << (PM_NODE_FLAG_BITS - 2)); -static const pm_node_flags_t PM_NODE_FLAG_COMMON_MASK = (1 << (PM_NODE_FLAG_BITS - 1)) | (1 << (PM_NODE_FLAG_BITS - 2)); - -/** - * Cast the type to an enum to allow the compiler to provide exhaustiveness - * checking. - */ -#define PM_NODE_TYPE(node) ((enum pm_node_type) (node)->type) - -/** - * Return true if the type of the given node matches the given type. - */ -#define PM_NODE_TYPE_P(node, type) (PM_NODE_TYPE(node) == (type)) - -/** - * Return true if the given flag is set on the given node. - */ -#define PM_NODE_FLAG_P(node, flag) ((((pm_node_t *)(node))->flags & (flag)) != 0) - -/** - * This is the base structure that represents a node in the syntax tree. It is - * embedded into every node type. - */ -typedef struct pm_node { - /** - * This represents the type of the node. It somewhat maps to the nodes that - * existed in the original grammar and ripper, but it's not a 1:1 mapping. - */ - pm_node_type_t type; - - /** - * This represents any flags on the node. Some are common to all nodes, and - * some are specific to the type of node. - */ - pm_node_flags_t flags; - - /** - * This is the location of the node in the source. It's a range of bytes - * containing a start and an end. - */ - pm_location_t location; -} pm_node_t; - -/** - * AliasGlobalVariableNode - * - * Type: PM_ALIAS_GLOBAL_VARIABLE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_alias_global_variable_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * AliasGlobalVariableNode#new_name - * - * Represents the new name of the global variable that can be used after aliasing. This can be either a global variable, a back reference, or a numbered reference. - * - * alias $foo $bar - * ^^^^ - */ - struct pm_node *new_name; - - /** - * AliasGlobalVariableNode#old_name - * - * Represents the old name of the global variable that could be used before aliasing. This can be either a global variable, a back reference, or a numbered reference. - * - * alias $foo $bar - * ^^^^ - */ - struct pm_node *old_name; - - /** - * AliasGlobalVariableNode#keyword_loc - * - * The location of the `alias` keyword. - * - * alias $foo $bar - * ^^^^^ - */ - pm_location_t keyword_loc; -} pm_alias_global_variable_node_t; - -/** - * AliasMethodNode - * - * Type: PM_ALIAS_METHOD_NODE - * - * @extends pm_node_t - */ -typedef struct pm_alias_method_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * AliasMethodNode#new_name - */ - struct pm_node *new_name; - - /** - * AliasMethodNode#old_name - */ - struct pm_node *old_name; - - /** - * AliasMethodNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_alias_method_node_t; - -/** - * AlternationPatternNode - * - * Type: PM_ALTERNATION_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_alternation_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * AlternationPatternNode#left - */ - struct pm_node *left; - - /** - * AlternationPatternNode#right - */ - struct pm_node *right; - - /** - * AlternationPatternNode#operator_loc - */ - pm_location_t operator_loc; -} pm_alternation_pattern_node_t; - -/** - * AndNode - * - * Type: PM_AND_NODE - * - * @extends pm_node_t - */ -typedef struct pm_and_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * AndNode#left - * - * Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * left and right - * ^^^^ - * - * 1 && 2 - * ^ - */ - struct pm_node *left; - - /** - * AndNode#right - * - * Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * left && right - * ^^^^^ - * - * 1 and 2 - * ^ - */ - struct pm_node *right; - - /** - * AndNode#operator_loc - * - * The location of the `and` keyword or the `&&` operator. - * - * left and right - * ^^^ - */ - pm_location_t operator_loc; -} pm_and_node_t; - -/** - * ArgumentsNode - * - * Type: PM_ARGUMENTS_NODE - * Flags: - * PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS - * PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT - * - * @extends pm_node_t - */ -typedef struct pm_arguments_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ArgumentsNode#arguments - */ - struct pm_node_list arguments; -} pm_arguments_node_t; - -/** - * ArrayNode - * - * Type: PM_ARRAY_NODE - * Flags: - * PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT - * - * @extends pm_node_t - */ -typedef struct pm_array_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ArrayNode#elements - * - * Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array. - */ - struct pm_node_list elements; - - /** - * ArrayNode#opening_loc - * - * Represents the optional source location for the opening token. - * - * [1,2,3] # "[" - * %w[foo bar baz] # "%w[" - * %I(apple orange banana) # "%I(" - * foo = 1, 2, 3 # nil - */ - pm_location_t opening_loc; - - /** - * ArrayNode#closing_loc - * - * Represents the optional source location for the closing token. - * - * [1,2,3] # "]" - * %w[foo bar baz] # "]" - * %I(apple orange banana) # ")" - * foo = 1, 2, 3 # nil - */ - pm_location_t closing_loc; -} pm_array_node_t; - -/** - * ArrayPatternNode - * - * Type: PM_ARRAY_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_array_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ArrayPatternNode#constant - */ - struct pm_node *constant; - - /** - * ArrayPatternNode#requireds - */ - struct pm_node_list requireds; - - /** - * ArrayPatternNode#rest - */ - struct pm_node *rest; - - /** - * ArrayPatternNode#posts - */ - struct pm_node_list posts; - - /** - * ArrayPatternNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * ArrayPatternNode#closing_loc - */ - pm_location_t closing_loc; -} pm_array_pattern_node_t; - -/** - * AssocNode - * - * Type: PM_ASSOC_NODE - * - * @extends pm_node_t - */ -typedef struct pm_assoc_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * AssocNode#key - * - * The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * { a: b } - * ^ - * - * { foo => bar } - * ^^^ - * - * { def a; end => 1 } - * ^^^^^^^^^^ - */ - struct pm_node *key; - - /** - * AssocNode#value - * - * The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * { foo => bar } - * ^^^ - * - * { x: 1 } - * ^ - */ - struct pm_node *value; - - /** - * AssocNode#operator_loc - * - * The location of the `=>` operator, if present. - * - * { foo => bar } - * ^^ - */ - pm_location_t operator_loc; -} pm_assoc_node_t; - -/** - * AssocSplatNode - * - * Type: PM_ASSOC_SPLAT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_assoc_splat_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * AssocSplatNode#value - * - * The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. - * - * { **foo } - * ^^^ - */ - struct pm_node *value; - - /** - * AssocSplatNode#operator_loc - * - * The location of the `**` operator. - * - * { **x } - * ^^ - */ - pm_location_t operator_loc; -} pm_assoc_splat_node_t; - -/** - * BackReferenceReadNode - * - * Type: PM_BACK_REFERENCE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_back_reference_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BackReferenceReadNode#name - * - * The name of the back-reference variable, including the leading `$`. - * - * $& # name `:$&` - * - * $+ # name `:$+` - */ - pm_constant_id_t name; -} pm_back_reference_read_node_t; - -/** - * BeginNode - * - * Type: PM_BEGIN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_begin_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BeginNode#begin_keyword_loc - */ - pm_location_t begin_keyword_loc; - - /** - * BeginNode#statements - */ - struct pm_statements_node *statements; - - /** - * BeginNode#rescue_clause - */ - struct pm_rescue_node *rescue_clause; - - /** - * BeginNode#else_clause - */ - struct pm_else_node *else_clause; - - /** - * BeginNode#ensure_clause - */ - struct pm_ensure_node *ensure_clause; - - /** - * BeginNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_begin_node_t; - -/** - * BlockArgumentNode - * - * Type: PM_BLOCK_ARGUMENT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_block_argument_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BlockArgumentNode#expression - */ - struct pm_node *expression; - - /** - * BlockArgumentNode#operator_loc - */ - pm_location_t operator_loc; -} pm_block_argument_node_t; - -/** - * BlockLocalVariableNode - * - * Type: PM_BLOCK_LOCAL_VARIABLE_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_block_local_variable_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BlockLocalVariableNode#name - */ - pm_constant_id_t name; -} pm_block_local_variable_node_t; - -/** - * BlockNode - * - * Type: PM_BLOCK_NODE - * - * @extends pm_node_t - */ -typedef struct pm_block_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BlockNode#locals - */ - pm_constant_id_list_t locals; - - /** - * BlockNode#parameters - */ - struct pm_node *parameters; - - /** - * BlockNode#body - */ - struct pm_node *body; - - /** - * BlockNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * BlockNode#closing_loc - */ - pm_location_t closing_loc; -} pm_block_node_t; - -/** - * BlockParameterNode - * - * Type: PM_BLOCK_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_block_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BlockParameterNode#name - */ - pm_constant_id_t name; - - /** - * BlockParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * BlockParameterNode#operator_loc - */ - pm_location_t operator_loc; -} pm_block_parameter_node_t; - -/** - * BlockParametersNode - * - * Type: PM_BLOCK_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_block_parameters_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BlockParametersNode#parameters - */ - struct pm_parameters_node *parameters; - - /** - * BlockParametersNode#locals - */ - struct pm_node_list locals; - - /** - * BlockParametersNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * BlockParametersNode#closing_loc - */ - pm_location_t closing_loc; -} pm_block_parameters_node_t; - -/** - * BreakNode - * - * Type: PM_BREAK_NODE - * - * @extends pm_node_t - */ -typedef struct pm_break_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * BreakNode#arguments - * - * The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * break foo - * ^^^ - */ - struct pm_arguments_node *arguments; - - /** - * BreakNode#keyword_loc - * - * The location of the `break` keyword. - * - * break foo - * ^^^^^ - */ - pm_location_t keyword_loc; -} pm_break_node_t; - -/** - * CallAndWriteNode - * - * Type: PM_CALL_AND_WRITE_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CallAndWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * CallAndWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallAndWriteNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallAndWriteNode#read_name - */ - pm_constant_id_t read_name; - - /** - * CallAndWriteNode#write_name - */ - pm_constant_id_t write_name; - - /** - * CallAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * CallAndWriteNode#value - */ - struct pm_node *value; -} pm_call_and_write_node_t; - -/** - * CallNode - * - * Type: PM_CALL_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CallNode#receiver - * - * The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * foo.bar - * ^^^ - * - * +foo - * ^^^ - * - * foo + bar - * ^^^ - */ - struct pm_node *receiver; - - /** - * CallNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallNode#name - */ - pm_constant_id_t name; - - /** - * CallNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * CallNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * CallNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * CallNode#block - */ - struct pm_node *block; -} pm_call_node_t; - -/** - * CallOperatorWriteNode - * - * Type: PM_CALL_OPERATOR_WRITE_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CallOperatorWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * CallOperatorWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallOperatorWriteNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallOperatorWriteNode#read_name - */ - pm_constant_id_t read_name; - - /** - * CallOperatorWriteNode#write_name - */ - pm_constant_id_t write_name; - - /** - * CallOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; - - /** - * CallOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * CallOperatorWriteNode#value - */ - struct pm_node *value; -} pm_call_operator_write_node_t; - -/** - * CallOrWriteNode - * - * Type: PM_CALL_OR_WRITE_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CallOrWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * CallOrWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallOrWriteNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallOrWriteNode#read_name - */ - pm_constant_id_t read_name; - - /** - * CallOrWriteNode#write_name - */ - pm_constant_id_t write_name; - - /** - * CallOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * CallOrWriteNode#value - */ - struct pm_node *value; -} pm_call_or_write_node_t; - -/** - * CallTargetNode - * - * Type: PM_CALL_TARGET_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CallTargetNode#receiver - */ - struct pm_node *receiver; - - /** - * CallTargetNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallTargetNode#name - */ - pm_constant_id_t name; - - /** - * CallTargetNode#message_loc - */ - pm_location_t message_loc; -} pm_call_target_node_t; - -/** - * CapturePatternNode - * - * Type: PM_CAPTURE_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_capture_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CapturePatternNode#value - */ - struct pm_node *value; - - /** - * CapturePatternNode#target - */ - struct pm_node *target; - - /** - * CapturePatternNode#operator_loc - */ - pm_location_t operator_loc; -} pm_capture_pattern_node_t; - -/** - * CaseMatchNode - * - * Type: PM_CASE_MATCH_NODE - * - * @extends pm_node_t - */ -typedef struct pm_case_match_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CaseMatchNode#predicate - */ - struct pm_node *predicate; - - /** - * CaseMatchNode#conditions - */ - struct pm_node_list conditions; - - /** - * CaseMatchNode#consequent - */ - struct pm_else_node *consequent; - - /** - * CaseMatchNode#case_keyword_loc - */ - pm_location_t case_keyword_loc; - - /** - * CaseMatchNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_case_match_node_t; - -/** - * CaseNode - * - * Type: PM_CASE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_case_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * CaseNode#predicate - */ - struct pm_node *predicate; - - /** - * CaseNode#conditions - */ - struct pm_node_list conditions; - - /** - * CaseNode#consequent - */ - struct pm_else_node *consequent; - - /** - * CaseNode#case_keyword_loc - */ - pm_location_t case_keyword_loc; - - /** - * CaseNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_case_node_t; - -/** - * ClassNode - * - * Type: PM_CLASS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassNode#locals - */ - pm_constant_id_list_t locals; - - /** - * ClassNode#class_keyword_loc - */ - pm_location_t class_keyword_loc; - - /** - * ClassNode#constant_path - */ - struct pm_node *constant_path; - - /** - * ClassNode#inheritance_operator_loc - */ - pm_location_t inheritance_operator_loc; - - /** - * ClassNode#superclass - */ - struct pm_node *superclass; - - /** - * ClassNode#body - */ - struct pm_node *body; - - /** - * ClassNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; - - /** - * ClassNode#name - */ - pm_constant_id_t name; -} pm_class_node_t; - -/** - * ClassVariableAndWriteNode - * - * Type: PM_CLASS_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * ClassVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ClassVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ClassVariableAndWriteNode#value - */ - struct pm_node *value; -} pm_class_variable_and_write_node_t; - -/** - * ClassVariableOperatorWriteNode - * - * Type: PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * ClassVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ClassVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * ClassVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * ClassVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_class_variable_operator_write_node_t; - -/** - * ClassVariableOrWriteNode - * - * Type: PM_CLASS_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * ClassVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ClassVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ClassVariableOrWriteNode#value - */ - struct pm_node *value; -} pm_class_variable_or_write_node_t; - -/** - * ClassVariableReadNode - * - * Type: PM_CLASS_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassVariableReadNode#name - * - * The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @@abc # name `:@@abc` - * - * @@_test # name `:@@_test` - */ - pm_constant_id_t name; -} pm_class_variable_read_node_t; - -/** - * ClassVariableTargetNode - * - * Type: PM_CLASS_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassVariableTargetNode#name - */ - pm_constant_id_t name; -} pm_class_variable_target_node_t; - -/** - * ClassVariableWriteNode - * - * Type: PM_CLASS_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ClassVariableWriteNode#name - * - * The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @@abc = 123 # name `@@abc` - * - * @@_test = :test # name `@@_test` - */ - pm_constant_id_t name; - - /** - * ClassVariableWriteNode#name_loc - * - * The location of the variable name. - * - * @@foo = :bar - * ^^^^^ - */ - pm_location_t name_loc; - - /** - * ClassVariableWriteNode#value - * - * The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * @@foo = :bar - * ^^^^ - * - * @@_xyz = 123 - * ^^^ - */ - struct pm_node *value; - - /** - * ClassVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * @@foo = :bar - * ^ - */ - pm_location_t operator_loc; -} pm_class_variable_write_node_t; - -/** - * ConstantAndWriteNode - * - * Type: PM_CONSTANT_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * ConstantAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ConstantAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantAndWriteNode#value - */ - struct pm_node *value; -} pm_constant_and_write_node_t; - -/** - * ConstantOperatorWriteNode - * - * Type: PM_CONSTANT_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * ConstantOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ConstantOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * ConstantOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * ConstantOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_constant_operator_write_node_t; - -/** - * ConstantOrWriteNode - * - * Type: PM_CONSTANT_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * ConstantOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ConstantOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantOrWriteNode#value - */ - struct pm_node *value; -} pm_constant_or_write_node_t; - -/** - * ConstantPathAndWriteNode - * - * Type: PM_CONSTANT_PATH_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantPathAndWriteNode#target - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantPathAndWriteNode#value - */ - struct pm_node *value; -} pm_constant_path_and_write_node_t; - -/** - * ConstantPathNode - * - * Type: PM_CONSTANT_PATH_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantPathNode#parent - * - * The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. - * - * Foo::Bar - * ^^^ - * - * self::Test - * ^^^^ - * - * a.b::C - * ^^^ - */ - struct pm_node *parent; - - /** - * ConstantPathNode#name - * - * The name of the constant being accessed. This could be `nil` in the event of a syntax error. - */ - pm_constant_id_t name; - - /** - * ConstantPathNode#delimiter_loc - * - * The location of the `::` delimiter. - * - * ::Foo - * ^^ - * - * One::Two - * ^^ - */ - pm_location_t delimiter_loc; - - /** - * ConstantPathNode#name_loc - * - * The location of the name of the constant. - * - * ::Foo - * ^^^ - * - * One::Two - * ^^^ - */ - pm_location_t name_loc; -} pm_constant_path_node_t; - -/** - * ConstantPathOperatorWriteNode - * - * Type: PM_CONSTANT_PATH_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantPathOperatorWriteNode#target - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * ConstantPathOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * ConstantPathOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_constant_path_operator_write_node_t; - -/** - * ConstantPathOrWriteNode - * - * Type: PM_CONSTANT_PATH_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantPathOrWriteNode#target - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantPathOrWriteNode#value - */ - struct pm_node *value; -} pm_constant_path_or_write_node_t; - -/** - * ConstantPathTargetNode - * - * Type: PM_CONSTANT_PATH_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantPathTargetNode#parent - */ - struct pm_node *parent; - - /** - * ConstantPathTargetNode#name - */ - pm_constant_id_t name; - - /** - * ConstantPathTargetNode#delimiter_loc - */ - pm_location_t delimiter_loc; - - /** - * ConstantPathTargetNode#name_loc - */ - pm_location_t name_loc; -} pm_constant_path_target_node_t; - -/** - * ConstantPathWriteNode - * - * Type: PM_CONSTANT_PATH_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantPathWriteNode#target - * - * A node representing the constant path being written to. - * - * Foo::Bar = 1 - * ^^^^^^^^ - * - * ::Foo = :abc - * ^^^^^ - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathWriteNode#operator_loc - * - * The location of the `=` operator. - * - * ::ABC = 123 - * ^ - */ - pm_location_t operator_loc; - - /** - * ConstantPathWriteNode#value - * - * The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * FOO::BAR = :abc - * ^^^^ - */ - struct pm_node *value; -} pm_constant_path_write_node_t; - -/** - * ConstantReadNode - * - * Type: PM_CONSTANT_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantReadNode#name - * - * The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - * - * X # name `:X` - * - * SOME_CONSTANT # name `:SOME_CONSTANT` - */ - pm_constant_id_t name; -} pm_constant_read_node_t; - -/** - * ConstantTargetNode - * - * Type: PM_CONSTANT_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantTargetNode#name - */ - pm_constant_id_t name; -} pm_constant_target_node_t; - -/** - * ConstantWriteNode - * - * Type: PM_CONSTANT_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ConstantWriteNode#name - * - * The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - * - * Foo = :bar # name `:Foo` - * - * XYZ = 1 # name `:XYZ` - */ - pm_constant_id_t name; - - /** - * ConstantWriteNode#name_loc - * - * The location of the constant name. - * - * FOO = 1 - * ^^^ - */ - pm_location_t name_loc; - - /** - * ConstantWriteNode#value - * - * The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * FOO = :bar - * ^^^^ - * - * MyClass = Class.new - * ^^^^^^^^^ - */ - struct pm_node *value; - - /** - * ConstantWriteNode#operator_loc - * - * The location of the `=` operator. - * - * FOO = :bar - * ^ - */ - pm_location_t operator_loc; -} pm_constant_write_node_t; - -/** - * DefNode - * - * Type: PM_DEF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_def_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * DefNode#name - */ - pm_constant_id_t name; - - /** - * DefNode#name_loc - */ - pm_location_t name_loc; - - /** - * DefNode#receiver - */ - struct pm_node *receiver; - - /** - * DefNode#parameters - */ - struct pm_parameters_node *parameters; - - /** - * DefNode#body - */ - struct pm_node *body; - - /** - * DefNode#locals - */ - pm_constant_id_list_t locals; - - /** - * DefNode#def_keyword_loc - */ - pm_location_t def_keyword_loc; - - /** - * DefNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * DefNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * DefNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * DefNode#equal_loc - */ - pm_location_t equal_loc; - - /** - * DefNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_def_node_t; - -/** - * DefinedNode - * - * Type: PM_DEFINED_NODE - * - * @extends pm_node_t - */ -typedef struct pm_defined_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * DefinedNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * DefinedNode#value - */ - struct pm_node *value; - - /** - * DefinedNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * DefinedNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_defined_node_t; - -/** - * ElseNode - * - * Type: PM_ELSE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_else_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ElseNode#else_keyword_loc - */ - pm_location_t else_keyword_loc; - - /** - * ElseNode#statements - */ - struct pm_statements_node *statements; - - /** - * ElseNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_else_node_t; - -/** - * EmbeddedStatementsNode - * - * Type: PM_EMBEDDED_STATEMENTS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_embedded_statements_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * EmbeddedStatementsNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * EmbeddedStatementsNode#statements - */ - struct pm_statements_node *statements; - - /** - * EmbeddedStatementsNode#closing_loc - */ - pm_location_t closing_loc; -} pm_embedded_statements_node_t; - -/** - * EmbeddedVariableNode - * - * Type: PM_EMBEDDED_VARIABLE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_embedded_variable_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * EmbeddedVariableNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * EmbeddedVariableNode#variable - */ - struct pm_node *variable; -} pm_embedded_variable_node_t; - -/** - * EnsureNode - * - * Type: PM_ENSURE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_ensure_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * EnsureNode#ensure_keyword_loc - */ - pm_location_t ensure_keyword_loc; - - /** - * EnsureNode#statements - */ - struct pm_statements_node *statements; - - /** - * EnsureNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_ensure_node_t; - -/** - * FalseNode - * - * Type: PM_FALSE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_false_node { - /** The embedded base node. */ - pm_node_t base; -} pm_false_node_t; - -/** - * FindPatternNode - * - * Type: PM_FIND_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_find_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * FindPatternNode#constant - */ - struct pm_node *constant; - - /** - * FindPatternNode#left - */ - struct pm_node *left; - - /** - * FindPatternNode#requireds - */ - struct pm_node_list requireds; - - /** - * FindPatternNode#right - */ - struct pm_node *right; - - /** - * FindPatternNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * FindPatternNode#closing_loc - */ - pm_location_t closing_loc; -} pm_find_pattern_node_t; - -/** - * FlipFlopNode - * - * Type: PM_FLIP_FLOP_NODE - * Flags: - * PM_RANGE_FLAGS_EXCLUDE_END - * - * @extends pm_node_t - */ -typedef struct pm_flip_flop_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * FlipFlopNode#left - */ - struct pm_node *left; - - /** - * FlipFlopNode#right - */ - struct pm_node *right; - - /** - * FlipFlopNode#operator_loc - */ - pm_location_t operator_loc; -} pm_flip_flop_node_t; - -/** - * FloatNode - * - * Type: PM_FLOAT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_float_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * FloatNode#value - * - * The value of the floating point number as a Float. - */ - double value; -} pm_float_node_t; - -/** - * ForNode - * - * Type: PM_FOR_NODE - * - * @extends pm_node_t - */ -typedef struct pm_for_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ForNode#index - */ - struct pm_node *index; - - /** - * ForNode#collection - */ - struct pm_node *collection; - - /** - * ForNode#statements - */ - struct pm_statements_node *statements; - - /** - * ForNode#for_keyword_loc - */ - pm_location_t for_keyword_loc; - - /** - * ForNode#in_keyword_loc - */ - pm_location_t in_keyword_loc; - - /** - * ForNode#do_keyword_loc - */ - pm_location_t do_keyword_loc; - - /** - * ForNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_for_node_t; - -/** - * ForwardingArgumentsNode - * - * Type: PM_FORWARDING_ARGUMENTS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_forwarding_arguments_node { - /** The embedded base node. */ - pm_node_t base; -} pm_forwarding_arguments_node_t; - -/** - * ForwardingParameterNode - * - * Type: PM_FORWARDING_PARAMETER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_forwarding_parameter_node { - /** The embedded base node. */ - pm_node_t base; -} pm_forwarding_parameter_node_t; - -/** - * ForwardingSuperNode - * - * Type: PM_FORWARDING_SUPER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_forwarding_super_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ForwardingSuperNode#block - */ - struct pm_block_node *block; -} pm_forwarding_super_node_t; - -/** - * GlobalVariableAndWriteNode - * - * Type: PM_GLOBAL_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * GlobalVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * GlobalVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * GlobalVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * GlobalVariableAndWriteNode#value - */ - struct pm_node *value; -} pm_global_variable_and_write_node_t; - -/** - * GlobalVariableOperatorWriteNode - * - * Type: PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * GlobalVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * GlobalVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * GlobalVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * GlobalVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * GlobalVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_global_variable_operator_write_node_t; - -/** - * GlobalVariableOrWriteNode - * - * Type: PM_GLOBAL_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * GlobalVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * GlobalVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * GlobalVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * GlobalVariableOrWriteNode#value - */ - struct pm_node *value; -} pm_global_variable_or_write_node_t; - -/** - * GlobalVariableReadNode - * - * Type: PM_GLOBAL_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * GlobalVariableReadNode#name - * - * The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - * - * $foo # name `:$foo` - * - * $_Test # name `:$_Test` - */ - pm_constant_id_t name; -} pm_global_variable_read_node_t; - -/** - * GlobalVariableTargetNode - * - * Type: PM_GLOBAL_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * GlobalVariableTargetNode#name - */ - pm_constant_id_t name; -} pm_global_variable_target_node_t; - -/** - * GlobalVariableWriteNode - * - * Type: PM_GLOBAL_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * GlobalVariableWriteNode#name - * - * The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - * - * $foo = :bar # name `:$foo` - * - * $_Test = 123 # name `:$_Test` - */ - pm_constant_id_t name; - - /** - * GlobalVariableWriteNode#name_loc - * - * The location of the global variable's name. - * - * $foo = :bar - * ^^^^ - */ - pm_location_t name_loc; - - /** - * GlobalVariableWriteNode#value - * - * The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * $foo = :bar - * ^^^^ - * - * $-xyz = 123 - * ^^^ - */ - struct pm_node *value; - - /** - * GlobalVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * $foo = :bar - * ^ - */ - pm_location_t operator_loc; -} pm_global_variable_write_node_t; - -/** - * HashNode - * - * Type: PM_HASH_NODE - * - * @extends pm_node_t - */ -typedef struct pm_hash_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * HashNode#opening_loc - * - * The location of the opening brace. - * - * { a => b } - * ^ - */ - pm_location_t opening_loc; - - /** - * HashNode#elements - * - * The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. - * - * { a: b } - * ^^^^ - * - * { **foo } - * ^^^^^ - */ - struct pm_node_list elements; - - /** - * HashNode#closing_loc - * - * The location of the closing brace. - * - * { a => b } - * ^ - */ - pm_location_t closing_loc; -} pm_hash_node_t; - -/** - * HashPatternNode - * - * Type: PM_HASH_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_hash_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * HashPatternNode#constant - */ - struct pm_node *constant; - - /** - * HashPatternNode#elements - */ - struct pm_node_list elements; - - /** - * HashPatternNode#rest - */ - struct pm_node *rest; - - /** - * HashPatternNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * HashPatternNode#closing_loc - */ - pm_location_t closing_loc; -} pm_hash_pattern_node_t; - -/** - * IfNode - * - * Type: PM_IF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_if_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * IfNode#if_keyword_loc - * - * The location of the `if` keyword if present. - * - * bar if foo - * ^^ - * - * The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. - */ - pm_location_t if_keyword_loc; - - /** - * IfNode#predicate - * - * The node for the condition the `IfNode` is testing. - * - * if foo - * ^^^ - * bar - * end - * - * bar if foo - * ^^^ - * - * foo ? bar : baz - * ^^^ - */ - struct pm_node *predicate; - - /** - * IfNode#then_keyword_loc - * - * The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. - * - * if foo then bar end - * ^^^^ - * - * a ? b : c - * ^ - */ - pm_location_t then_keyword_loc; - - /** - * IfNode#statements - * - * Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. - * - * if foo - * bar - * ^^^ - * baz - * ^^^ - * end - */ - struct pm_statements_node *statements; - - /** - * IfNode#consequent - * - * Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. - * - * if foo - * bar - * elsif baz - * ^^^^^^^^^ - * qux - * ^^^ - * end - * ^^^ - * - * if foo then bar else baz end - * ^^^^^^^^^^^^ - */ - struct pm_node *consequent; - - /** - * IfNode#end_keyword_loc - * - * The location of the `end` keyword if present, `nil` otherwise. - * - * if foo - * bar - * end - * ^^^ - */ - pm_location_t end_keyword_loc; -} pm_if_node_t; - -/** - * ImaginaryNode - * - * Type: PM_IMAGINARY_NODE - * - * @extends pm_node_t - */ -typedef struct pm_imaginary_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ImaginaryNode#numeric - */ - struct pm_node *numeric; -} pm_imaginary_node_t; - -/** - * ImplicitNode - * - * Type: PM_IMPLICIT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_implicit_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ImplicitNode#value - */ - struct pm_node *value; -} pm_implicit_node_t; - -/** - * ImplicitRestNode - * - * Type: PM_IMPLICIT_REST_NODE - * - * @extends pm_node_t - */ -typedef struct pm_implicit_rest_node { - /** The embedded base node. */ - pm_node_t base; -} pm_implicit_rest_node_t; - -/** - * InNode - * - * Type: PM_IN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_in_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InNode#pattern - */ - struct pm_node *pattern; - - /** - * InNode#statements - */ - struct pm_statements_node *statements; - - /** - * InNode#in_loc - */ - pm_location_t in_loc; - - /** - * InNode#then_loc - */ - pm_location_t then_loc; -} pm_in_node_t; - -/** - * IndexAndWriteNode - * - * Type: PM_INDEX_AND_WRITE_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * IndexAndWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexAndWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * IndexAndWriteNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexAndWriteNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexAndWriteNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexAndWriteNode#block - */ - struct pm_node *block; - - /** - * IndexAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * IndexAndWriteNode#value - */ - struct pm_node *value; -} pm_index_and_write_node_t; - -/** - * IndexOperatorWriteNode - * - * Type: PM_INDEX_OPERATOR_WRITE_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * IndexOperatorWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexOperatorWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * IndexOperatorWriteNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexOperatorWriteNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexOperatorWriteNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexOperatorWriteNode#block - */ - struct pm_node *block; - - /** - * IndexOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; - - /** - * IndexOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * IndexOperatorWriteNode#value - */ - struct pm_node *value; -} pm_index_operator_write_node_t; - -/** - * IndexOrWriteNode - * - * Type: PM_INDEX_OR_WRITE_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * IndexOrWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexOrWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * IndexOrWriteNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexOrWriteNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexOrWriteNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexOrWriteNode#block - */ - struct pm_node *block; - - /** - * IndexOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * IndexOrWriteNode#value - */ - struct pm_node *value; -} pm_index_or_write_node_t; - -/** - * IndexTargetNode - * - * Type: PM_INDEX_TARGET_NODE - * Flags: - * PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * PM_CALL_NODE_FLAGS_VARIABLE_CALL - * PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * IndexTargetNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexTargetNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexTargetNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexTargetNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexTargetNode#block - */ - struct pm_node *block; -} pm_index_target_node_t; - -/** - * InstanceVariableAndWriteNode - * - * Type: PM_INSTANCE_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InstanceVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * InstanceVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * InstanceVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * InstanceVariableAndWriteNode#value - */ - struct pm_node *value; -} pm_instance_variable_and_write_node_t; - -/** - * InstanceVariableOperatorWriteNode - * - * Type: PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InstanceVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * InstanceVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * InstanceVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * InstanceVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * InstanceVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_instance_variable_operator_write_node_t; - -/** - * InstanceVariableOrWriteNode - * - * Type: PM_INSTANCE_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InstanceVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * InstanceVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * InstanceVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * InstanceVariableOrWriteNode#value - */ - struct pm_node *value; -} pm_instance_variable_or_write_node_t; - -/** - * InstanceVariableReadNode - * - * Type: PM_INSTANCE_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InstanceVariableReadNode#name - * - * The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @x # name `:@x` - * - * @_test # name `:@_test` - */ - pm_constant_id_t name; -} pm_instance_variable_read_node_t; - -/** - * InstanceVariableTargetNode - * - * Type: PM_INSTANCE_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InstanceVariableTargetNode#name - */ - pm_constant_id_t name; -} pm_instance_variable_target_node_t; - -/** - * InstanceVariableWriteNode - * - * Type: PM_INSTANCE_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InstanceVariableWriteNode#name - * - * The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @x = :y # name `:@x` - * - * @_foo = "bar" # name `@_foo` - */ - pm_constant_id_t name; - - /** - * InstanceVariableWriteNode#name_loc - * - * The location of the variable name. - * - * @_x = 1 - * ^^^ - */ - pm_location_t name_loc; - - /** - * InstanceVariableWriteNode#value - * - * The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * @foo = :bar - * ^^^^ - * - * @_x = 1234 - * ^^^^ - */ - struct pm_node *value; - - /** - * InstanceVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * @x = y - * ^ - */ - pm_location_t operator_loc; -} pm_instance_variable_write_node_t; - -/** - * IntegerNode - * - * Type: PM_INTEGER_NODE - * Flags: - * PM_INTEGER_BASE_FLAGS_BINARY - * PM_INTEGER_BASE_FLAGS_DECIMAL - * PM_INTEGER_BASE_FLAGS_OCTAL - * PM_INTEGER_BASE_FLAGS_HEXADECIMAL - * - * @extends pm_node_t - */ -typedef struct pm_integer_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * IntegerNode#value - * - * The value of the integer literal as a number. - */ - pm_integer_t value; -} pm_integer_node_t; - -/** - * InterpolatedMatchLastLineNode - * - * Type: PM_INTERPOLATED_MATCH_LAST_LINE_NODE - * Flags: - * PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * PM_REGULAR_EXPRESSION_FLAGS_ONCE - * PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_match_last_line_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InterpolatedMatchLastLineNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedMatchLastLineNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedMatchLastLineNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_match_last_line_node_t; - -/** - * InterpolatedRegularExpressionNode - * - * Type: PM_INTERPOLATED_REGULAR_EXPRESSION_NODE - * Flags: - * PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * PM_REGULAR_EXPRESSION_FLAGS_ONCE - * PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_regular_expression_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InterpolatedRegularExpressionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedRegularExpressionNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedRegularExpressionNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_regular_expression_node_t; - -/** - * InterpolatedStringNode - * - * Type: PM_INTERPOLATED_STRING_NODE - * Flags: - * PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN - * PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_string_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InterpolatedStringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedStringNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedStringNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_string_node_t; - -/** - * InterpolatedSymbolNode - * - * Type: PM_INTERPOLATED_SYMBOL_NODE - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_symbol_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InterpolatedSymbolNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedSymbolNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedSymbolNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_symbol_node_t; - -/** - * InterpolatedXStringNode - * - * Type: PM_INTERPOLATED_X_STRING_NODE - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_x_string_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * InterpolatedXStringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedXStringNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedXStringNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_x_string_node_t; - -/** - * ItParametersNode - * - * Type: PM_IT_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_it_parameters_node { - /** The embedded base node. */ - pm_node_t base; -} pm_it_parameters_node_t; - -/** - * KeywordHashNode - * - * Type: PM_KEYWORD_HASH_NODE - * Flags: - * PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS - * - * @extends pm_node_t - */ -typedef struct pm_keyword_hash_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * KeywordHashNode#elements - */ - struct pm_node_list elements; -} pm_keyword_hash_node_t; - -/** - * KeywordRestParameterNode - * - * Type: PM_KEYWORD_REST_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_keyword_rest_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * KeywordRestParameterNode#name - */ - pm_constant_id_t name; - - /** - * KeywordRestParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * KeywordRestParameterNode#operator_loc - */ - pm_location_t operator_loc; -} pm_keyword_rest_parameter_node_t; - -/** - * LambdaNode - * - * Type: PM_LAMBDA_NODE - * - * @extends pm_node_t - */ -typedef struct pm_lambda_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LambdaNode#locals - */ - pm_constant_id_list_t locals; - - /** - * LambdaNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * LambdaNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * LambdaNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * LambdaNode#parameters - */ - struct pm_node *parameters; - - /** - * LambdaNode#body - */ - struct pm_node *body; -} pm_lambda_node_t; - -/** - * LocalVariableAndWriteNode - * - * Type: PM_LOCAL_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LocalVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * LocalVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * LocalVariableAndWriteNode#value - */ - struct pm_node *value; - - /** - * LocalVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableAndWriteNode#depth - */ - uint32_t depth; -} pm_local_variable_and_write_node_t; - -/** - * LocalVariableOperatorWriteNode - * - * Type: PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LocalVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * LocalVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * LocalVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * LocalVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; - - /** - * LocalVariableOperatorWriteNode#depth - */ - uint32_t depth; -} pm_local_variable_operator_write_node_t; - -/** - * LocalVariableOrWriteNode - * - * Type: PM_LOCAL_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LocalVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * LocalVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * LocalVariableOrWriteNode#value - */ - struct pm_node *value; - - /** - * LocalVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableOrWriteNode#depth - */ - uint32_t depth; -} pm_local_variable_or_write_node_t; - -/** - * LocalVariableReadNode - * - * Type: PM_LOCAL_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LocalVariableReadNode#name - * - * The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * x # name `:x` - * - * _Test # name `:_Test` - * - * Note that this can also be an underscore followed by a number for the default block parameters. - * - * _1 # name `:_1` - * - * Finally, for the default `it` block parameter, the name is `0it`. This is to distinguish it from an `it` local variable that is explicitly declared. - * - * it # name `:0it` - */ - pm_constant_id_t name; - - /** - * LocalVariableReadNode#depth - * - * The number of visible scopes that should be searched to find the origin of this local variable. - * - * foo = 1; foo # depth 0 - * - * bar = 2; tap { bar } # depth 1 - * - * The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - */ - uint32_t depth; -} pm_local_variable_read_node_t; - -/** - * LocalVariableTargetNode - * - * Type: PM_LOCAL_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LocalVariableTargetNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableTargetNode#depth - */ - uint32_t depth; -} pm_local_variable_target_node_t; - -/** - * LocalVariableWriteNode - * - * Type: PM_LOCAL_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * LocalVariableWriteNode#name - * - * The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * foo = :bar # name `:foo` - * - * abc = 123 # name `:abc` - */ - pm_constant_id_t name; - - /** - * LocalVariableWriteNode#depth - * - * The number of semantic scopes we have to traverse to find the declaration of this variable. - * - * foo = 1 # depth 0 - * - * tap { foo = 1 } # depth 1 - * - * The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - */ - uint32_t depth; - - /** - * LocalVariableWriteNode#name_loc - * - * The location of the variable name. - * - * foo = :bar - * ^^^ - */ - pm_location_t name_loc; - - /** - * LocalVariableWriteNode#value - * - * The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * foo = :bar - * ^^^^ - * - * abc = 1234 - * ^^^^ - * - * Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write. - * - * foo = foo - */ - struct pm_node *value; - - /** - * LocalVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * x = :y - * ^ - */ - pm_location_t operator_loc; -} pm_local_variable_write_node_t; - -/** - * MatchLastLineNode - * - * Type: PM_MATCH_LAST_LINE_NODE - * Flags: - * PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * PM_REGULAR_EXPRESSION_FLAGS_ONCE - * PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_match_last_line_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * MatchLastLineNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * MatchLastLineNode#content_loc - */ - pm_location_t content_loc; - - /** - * MatchLastLineNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * MatchLastLineNode#unescaped - */ - pm_string_t unescaped; -} pm_match_last_line_node_t; - -/** - * MatchPredicateNode - * - * Type: PM_MATCH_PREDICATE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_match_predicate_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * MatchPredicateNode#value - */ - struct pm_node *value; - - /** - * MatchPredicateNode#pattern - */ - struct pm_node *pattern; - - /** - * MatchPredicateNode#operator_loc - */ - pm_location_t operator_loc; -} pm_match_predicate_node_t; - -/** - * MatchRequiredNode - * - * Type: PM_MATCH_REQUIRED_NODE - * - * @extends pm_node_t - */ -typedef struct pm_match_required_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * MatchRequiredNode#value - */ - struct pm_node *value; - - /** - * MatchRequiredNode#pattern - */ - struct pm_node *pattern; - - /** - * MatchRequiredNode#operator_loc - */ - pm_location_t operator_loc; -} pm_match_required_node_t; - -/** - * MatchWriteNode - * - * Type: PM_MATCH_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_match_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * MatchWriteNode#call - */ - struct pm_call_node *call; - - /** - * MatchWriteNode#targets - */ - struct pm_node_list targets; -} pm_match_write_node_t; - -/** - * MissingNode - * - * Type: PM_MISSING_NODE - * - * @extends pm_node_t - */ -typedef struct pm_missing_node { - /** The embedded base node. */ - pm_node_t base; -} pm_missing_node_t; - -/** - * ModuleNode - * - * Type: PM_MODULE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_module_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ModuleNode#locals - */ - pm_constant_id_list_t locals; - - /** - * ModuleNode#module_keyword_loc - */ - pm_location_t module_keyword_loc; - - /** - * ModuleNode#constant_path - */ - struct pm_node *constant_path; - - /** - * ModuleNode#body - */ - struct pm_node *body; - - /** - * ModuleNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; - - /** - * ModuleNode#name - */ - pm_constant_id_t name; -} pm_module_node_t; - -/** - * MultiTargetNode - * - * Type: PM_MULTI_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_multi_target_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * MultiTargetNode#lefts - */ - struct pm_node_list lefts; - - /** - * MultiTargetNode#rest - */ - struct pm_node *rest; - - /** - * MultiTargetNode#rights - */ - struct pm_node_list rights; - - /** - * MultiTargetNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * MultiTargetNode#rparen_loc - */ - pm_location_t rparen_loc; -} pm_multi_target_node_t; - -/** - * MultiWriteNode - * - * Type: PM_MULTI_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_multi_write_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * MultiWriteNode#lefts - */ - struct pm_node_list lefts; - - /** - * MultiWriteNode#rest - */ - struct pm_node *rest; - - /** - * MultiWriteNode#rights - */ - struct pm_node_list rights; - - /** - * MultiWriteNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * MultiWriteNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * MultiWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * MultiWriteNode#value - */ - struct pm_node *value; -} pm_multi_write_node_t; - -/** - * NextNode - * - * Type: PM_NEXT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_next_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * NextNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * NextNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_next_node_t; - -/** - * NilNode - * - * Type: PM_NIL_NODE - * - * @extends pm_node_t - */ -typedef struct pm_nil_node { - /** The embedded base node. */ - pm_node_t base; -} pm_nil_node_t; - -/** - * NoKeywordsParameterNode - * - * Type: PM_NO_KEYWORDS_PARAMETER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_no_keywords_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * NoKeywordsParameterNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * NoKeywordsParameterNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_no_keywords_parameter_node_t; - -/** - * NumberedParametersNode - * - * Type: PM_NUMBERED_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_numbered_parameters_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * NumberedParametersNode#maximum - */ - uint8_t maximum; -} pm_numbered_parameters_node_t; - -/** - * NumberedReferenceReadNode - * - * Type: PM_NUMBERED_REFERENCE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_numbered_reference_read_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * NumberedReferenceReadNode#number - * - * The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. - * - * $1 # number `1` - * - * $5432 # number `5432` - * - * $4294967296 # number `0` - */ - uint32_t number; -} pm_numbered_reference_read_node_t; - -/** - * OptionalKeywordParameterNode - * - * Type: PM_OPTIONAL_KEYWORD_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_optional_keyword_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * OptionalKeywordParameterNode#name - */ - pm_constant_id_t name; - - /** - * OptionalKeywordParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * OptionalKeywordParameterNode#value - */ - struct pm_node *value; -} pm_optional_keyword_parameter_node_t; - -/** - * OptionalParameterNode - * - * Type: PM_OPTIONAL_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_optional_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * OptionalParameterNode#name - */ - pm_constant_id_t name; - - /** - * OptionalParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * OptionalParameterNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * OptionalParameterNode#value - */ - struct pm_node *value; -} pm_optional_parameter_node_t; - -/** - * OrNode - * - * Type: PM_OR_NODE - * - * @extends pm_node_t - */ -typedef struct pm_or_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * OrNode#left - * - * Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * left or right - * ^^^^ - * - * 1 || 2 - * ^ - */ - struct pm_node *left; - - /** - * OrNode#right - * - * Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * left || right - * ^^^^^ - * - * 1 or 2 - * ^ - */ - struct pm_node *right; - - /** - * OrNode#operator_loc - * - * The location of the `or` keyword or the `||` operator. - * - * left or right - * ^^ - */ - pm_location_t operator_loc; -} pm_or_node_t; - -/** - * ParametersNode - * - * Type: PM_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_parameters_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ParametersNode#requireds - */ - struct pm_node_list requireds; - - /** - * ParametersNode#optionals - */ - struct pm_node_list optionals; - - /** - * ParametersNode#rest - */ - struct pm_node *rest; - - /** - * ParametersNode#posts - */ - struct pm_node_list posts; - - /** - * ParametersNode#keywords - */ - struct pm_node_list keywords; - - /** - * ParametersNode#keyword_rest - */ - struct pm_node *keyword_rest; - - /** - * ParametersNode#block - */ - struct pm_block_parameter_node *block; -} pm_parameters_node_t; - -/** - * ParenthesesNode - * - * Type: PM_PARENTHESES_NODE - * - * @extends pm_node_t - */ -typedef struct pm_parentheses_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ParenthesesNode#body - */ - struct pm_node *body; - - /** - * ParenthesesNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * ParenthesesNode#closing_loc - */ - pm_location_t closing_loc; -} pm_parentheses_node_t; - -/** - * PinnedExpressionNode - * - * Type: PM_PINNED_EXPRESSION_NODE - * - * @extends pm_node_t - */ -typedef struct pm_pinned_expression_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * PinnedExpressionNode#expression - */ - struct pm_node *expression; - - /** - * PinnedExpressionNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * PinnedExpressionNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * PinnedExpressionNode#rparen_loc - */ - pm_location_t rparen_loc; -} pm_pinned_expression_node_t; - -/** - * PinnedVariableNode - * - * Type: PM_PINNED_VARIABLE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_pinned_variable_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * PinnedVariableNode#variable - */ - struct pm_node *variable; - - /** - * PinnedVariableNode#operator_loc - */ - pm_location_t operator_loc; -} pm_pinned_variable_node_t; - -/** - * PostExecutionNode - * - * Type: PM_POST_EXECUTION_NODE - * - * @extends pm_node_t - */ -typedef struct pm_post_execution_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * PostExecutionNode#statements - */ - struct pm_statements_node *statements; - - /** - * PostExecutionNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * PostExecutionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * PostExecutionNode#closing_loc - */ - pm_location_t closing_loc; -} pm_post_execution_node_t; - -/** - * PreExecutionNode - * - * Type: PM_PRE_EXECUTION_NODE - * - * @extends pm_node_t - */ -typedef struct pm_pre_execution_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * PreExecutionNode#statements - */ - struct pm_statements_node *statements; - - /** - * PreExecutionNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * PreExecutionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * PreExecutionNode#closing_loc - */ - pm_location_t closing_loc; -} pm_pre_execution_node_t; - -/** - * ProgramNode - * - * Type: PM_PROGRAM_NODE - * - * @extends pm_node_t - */ -typedef struct pm_program_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ProgramNode#locals - */ - pm_constant_id_list_t locals; - - /** - * ProgramNode#statements - */ - struct pm_statements_node *statements; -} pm_program_node_t; - -/** - * RangeNode - * - * Type: PM_RANGE_NODE - * Flags: - * PM_RANGE_FLAGS_EXCLUDE_END - * - * @extends pm_node_t - */ -typedef struct pm_range_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RangeNode#left - * - * The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * 1... - * ^ - * - * hello...goodbye - * ^^^^^ - */ - struct pm_node *left; - - /** - * RangeNode#right - * - * The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * ..5 - * ^ - * - * 1...foo - * ^^^ - * If neither right-hand or left-hand side was included, this will be a MissingNode. - */ - struct pm_node *right; - - /** - * RangeNode#operator_loc - * - * The location of the `..` or `...` operator. - */ - pm_location_t operator_loc; -} pm_range_node_t; - -/** - * RationalNode - * - * Type: PM_RATIONAL_NODE - * - * @extends pm_node_t - */ -typedef struct pm_rational_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RationalNode#numeric - */ - struct pm_node *numeric; -} pm_rational_node_t; - -/** - * RedoNode - * - * Type: PM_REDO_NODE - * - * @extends pm_node_t - */ -typedef struct pm_redo_node { - /** The embedded base node. */ - pm_node_t base; -} pm_redo_node_t; - -/** - * RegularExpressionNode - * - * Type: PM_REGULAR_EXPRESSION_NODE - * Flags: - * PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * PM_REGULAR_EXPRESSION_FLAGS_ONCE - * PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_regular_expression_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RegularExpressionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * RegularExpressionNode#content_loc - */ - pm_location_t content_loc; - - /** - * RegularExpressionNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * RegularExpressionNode#unescaped - */ - pm_string_t unescaped; -} pm_regular_expression_node_t; - -/** - * RequiredKeywordParameterNode - * - * Type: PM_REQUIRED_KEYWORD_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_required_keyword_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RequiredKeywordParameterNode#name - */ - pm_constant_id_t name; - - /** - * RequiredKeywordParameterNode#name_loc - */ - pm_location_t name_loc; -} pm_required_keyword_parameter_node_t; - -/** - * RequiredParameterNode - * - * Type: PM_REQUIRED_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_required_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RequiredParameterNode#name - */ - pm_constant_id_t name; -} pm_required_parameter_node_t; - -/** - * RescueModifierNode - * - * Type: PM_RESCUE_MODIFIER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_rescue_modifier_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RescueModifierNode#expression - */ - struct pm_node *expression; - - /** - * RescueModifierNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * RescueModifierNode#rescue_expression - */ - struct pm_node *rescue_expression; -} pm_rescue_modifier_node_t; - -/** - * RescueNode - * - * Type: PM_RESCUE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_rescue_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RescueNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * RescueNode#exceptions - */ - struct pm_node_list exceptions; - - /** - * RescueNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * RescueNode#reference - */ - struct pm_node *reference; - - /** - * RescueNode#statements - */ - struct pm_statements_node *statements; - - /** - * RescueNode#consequent - */ - struct pm_rescue_node *consequent; -} pm_rescue_node_t; - -/** - * RestParameterNode - * - * Type: PM_REST_PARAMETER_NODE - * Flags: - * PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_rest_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * RestParameterNode#name - */ - pm_constant_id_t name; - - /** - * RestParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * RestParameterNode#operator_loc - */ - pm_location_t operator_loc; -} pm_rest_parameter_node_t; - -/** - * RetryNode - * - * Type: PM_RETRY_NODE - * - * @extends pm_node_t - */ -typedef struct pm_retry_node { - /** The embedded base node. */ - pm_node_t base; -} pm_retry_node_t; - -/** - * ReturnNode - * - * Type: PM_RETURN_NODE - * Flags: - * PM_RETURN_NODE_FLAGS_REDUNDANT - * - * @extends pm_node_t - */ -typedef struct pm_return_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ReturnNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * ReturnNode#arguments - */ - struct pm_arguments_node *arguments; -} pm_return_node_t; - -/** - * SelfNode - * - * Type: PM_SELF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_self_node { - /** The embedded base node. */ - pm_node_t base; -} pm_self_node_t; - -/** - * ShareableConstantNode - * - * Type: PM_SHAREABLE_CONSTANT_NODE - * Flags: - * PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL - * PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING - * PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY - * - * @extends pm_node_t - */ -typedef struct pm_shareable_constant_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * ShareableConstantNode#write - * - * The constant write that should be modified with the shareability state. - */ - struct pm_node *write; -} pm_shareable_constant_node_t; - -/** - * SingletonClassNode - * - * Type: PM_SINGLETON_CLASS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_singleton_class_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * SingletonClassNode#locals - */ - pm_constant_id_list_t locals; - - /** - * SingletonClassNode#class_keyword_loc - */ - pm_location_t class_keyword_loc; - - /** - * SingletonClassNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * SingletonClassNode#expression - */ - struct pm_node *expression; - - /** - * SingletonClassNode#body - */ - struct pm_node *body; - - /** - * SingletonClassNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_singleton_class_node_t; - -/** - * SourceEncodingNode - * - * Type: PM_SOURCE_ENCODING_NODE - * - * @extends pm_node_t - */ -typedef struct pm_source_encoding_node { - /** The embedded base node. */ - pm_node_t base; -} pm_source_encoding_node_t; - -/** - * SourceFileNode - * - * Type: PM_SOURCE_FILE_NODE - * Flags: - * PM_STRING_FLAGS_FORCED_UTF8_ENCODING - * PM_STRING_FLAGS_FORCED_BINARY_ENCODING - * PM_STRING_FLAGS_FROZEN - * PM_STRING_FLAGS_MUTABLE - * - * @extends pm_node_t - */ -typedef struct pm_source_file_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * SourceFileNode#filepath - * - * Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs. - */ - pm_string_t filepath; -} pm_source_file_node_t; - -/** - * SourceLineNode - * - * Type: PM_SOURCE_LINE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_source_line_node { - /** The embedded base node. */ - pm_node_t base; -} pm_source_line_node_t; - -/** - * SplatNode - * - * Type: PM_SPLAT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_splat_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * SplatNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * SplatNode#expression - */ - struct pm_node *expression; -} pm_splat_node_t; - -/** - * StatementsNode - * - * Type: PM_STATEMENTS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_statements_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * StatementsNode#body - */ - struct pm_node_list body; -} pm_statements_node_t; - -/** - * StringNode - * - * Type: PM_STRING_NODE - * Flags: - * PM_STRING_FLAGS_FORCED_UTF8_ENCODING - * PM_STRING_FLAGS_FORCED_BINARY_ENCODING - * PM_STRING_FLAGS_FROZEN - * PM_STRING_FLAGS_MUTABLE - * - * @extends pm_node_t - */ -typedef struct pm_string_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * StringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * StringNode#content_loc - */ - pm_location_t content_loc; - - /** - * StringNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * StringNode#unescaped - */ - pm_string_t unescaped; -} pm_string_node_t; - -/** - * SuperNode - * - * Type: PM_SUPER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_super_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * SuperNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * SuperNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * SuperNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * SuperNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * SuperNode#block - */ - struct pm_node *block; -} pm_super_node_t; - -/** - * SymbolNode - * - * Type: PM_SYMBOL_NODE - * Flags: - * PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING - * PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING - * PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_symbol_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * SymbolNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * SymbolNode#value_loc - */ - pm_location_t value_loc; - - /** - * SymbolNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * SymbolNode#unescaped - */ - pm_string_t unescaped; -} pm_symbol_node_t; - -/** - * TrueNode - * - * Type: PM_TRUE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_true_node { - /** The embedded base node. */ - pm_node_t base; -} pm_true_node_t; - -/** - * UndefNode - * - * Type: PM_UNDEF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_undef_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * UndefNode#names - */ - struct pm_node_list names; - - /** - * UndefNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_undef_node_t; - -/** - * UnlessNode - * - * Type: PM_UNLESS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_unless_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * UnlessNode#keyword_loc - * - * The location of the `unless` keyword. - * - * unless cond then bar end - * ^^^^^^ - * - * bar unless cond - * ^^^^^^ - */ - pm_location_t keyword_loc; - - /** - * UnlessNode#predicate - * - * The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * unless cond then bar end - * ^^^^ - * - * bar unless cond - * ^^^^ - */ - struct pm_node *predicate; - - /** - * UnlessNode#then_keyword_loc - * - * The location of the `then` keyword, if present. - * unless cond then bar end ^^^^ - */ - pm_location_t then_keyword_loc; - - /** - * UnlessNode#statements - * - * The body of statements that will executed if the unless condition is - * falsey. Will be `nil` if no body is provided. - * - * unless cond then bar end - * ^^^ - */ - struct pm_statements_node *statements; - - /** - * UnlessNode#consequent - * - * The else clause of the unless expression, if present. - * - * unless cond then bar else baz end - * ^^^^^^^^ - */ - struct pm_else_node *consequent; - - /** - * UnlessNode#end_keyword_loc - * - * The location of the `end` keyword, if present. - * - * unless cond then bar end - * ^^^ - */ - pm_location_t end_keyword_loc; -} pm_unless_node_t; - -/** - * UntilNode - * - * Type: PM_UNTIL_NODE - * Flags: - * PM_LOOP_FLAGS_BEGIN_MODIFIER - * - * @extends pm_node_t - */ -typedef struct pm_until_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * UntilNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * UntilNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * UntilNode#predicate - */ - struct pm_node *predicate; - - /** - * UntilNode#statements - */ - struct pm_statements_node *statements; -} pm_until_node_t; - -/** - * WhenNode - * - * Type: PM_WHEN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_when_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * WhenNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * WhenNode#conditions - */ - struct pm_node_list conditions; - - /** - * WhenNode#then_keyword_loc - */ - pm_location_t then_keyword_loc; - - /** - * WhenNode#statements - */ - struct pm_statements_node *statements; -} pm_when_node_t; - -/** - * WhileNode - * - * Type: PM_WHILE_NODE - * Flags: - * PM_LOOP_FLAGS_BEGIN_MODIFIER - * - * @extends pm_node_t - */ -typedef struct pm_while_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * WhileNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * WhileNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * WhileNode#predicate - */ - struct pm_node *predicate; - - /** - * WhileNode#statements - */ - struct pm_statements_node *statements; -} pm_while_node_t; - -/** - * XStringNode - * - * Type: PM_X_STRING_NODE - * Flags: - * PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING - * PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_x_string_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * XStringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * XStringNode#content_loc - */ - pm_location_t content_loc; - - /** - * XStringNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * XStringNode#unescaped - */ - pm_string_t unescaped; -} pm_x_string_node_t; - -/** - * YieldNode - * - * Type: PM_YIELD_NODE - * - * @extends pm_node_t - */ -typedef struct pm_yield_node { - /** The embedded base node. */ - pm_node_t base; - - /** - * YieldNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * YieldNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * YieldNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * YieldNode#rparen_loc - */ - pm_location_t rparen_loc; -} pm_yield_node_t; - -/** - * Flags for arguments nodes. - */ -typedef enum pm_arguments_node_flags { - /** if arguments contain keywords */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS = 1, - - /** if arguments contain keyword splat */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT = 2, -} pm_arguments_node_flags_t; - -/** - * Flags for array nodes. - */ -typedef enum pm_array_node_flags { - /** if array contains splat nodes */ - PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT = 1, -} pm_array_node_flags_t; - -/** - * Flags for call nodes. - */ -typedef enum pm_call_node_flags { - /** &. operator */ - PM_CALL_NODE_FLAGS_SAFE_NAVIGATION = 1, - - /** a call that could have been a local variable */ - PM_CALL_NODE_FLAGS_VARIABLE_CALL = 2, - - /** a call that is an attribute write, so the value being written should be returned */ - PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE = 4, - - /** a call that ignores method visibility */ - PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY = 8, -} pm_call_node_flags_t; - -/** - * Flags for nodes that have unescaped content. - */ -typedef enum pm_encoding_flags { - /** internal bytes forced the encoding to UTF-8 */ - PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING = 1, - - /** internal bytes forced the encoding to binary */ - PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING = 2, -} pm_encoding_flags_t; - -/** - * Flags for integer nodes that correspond to the base of the integer. - */ -typedef enum pm_integer_base_flags { - /** 0b prefix */ - PM_INTEGER_BASE_FLAGS_BINARY = 1, - - /** 0d or no prefix */ - PM_INTEGER_BASE_FLAGS_DECIMAL = 2, - - /** 0o or 0 prefix */ - PM_INTEGER_BASE_FLAGS_OCTAL = 4, - - /** 0x prefix */ - PM_INTEGER_BASE_FLAGS_HEXADECIMAL = 8, -} pm_integer_base_flags_t; - -/** - * Flags for interpolated string nodes that indicated mutability if they are also marked as literals. - */ -typedef enum pm_interpolated_string_node_flags { - /** frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` */ - PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN = 1, - - /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` */ - PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE = 2, -} pm_interpolated_string_node_flags_t; - -/** - * Flags for keyword hash nodes. - */ -typedef enum pm_keyword_hash_node_flags { - /** a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments */ - PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS = 1, -} pm_keyword_hash_node_flags_t; - -/** - * Flags for while and until loop nodes. - */ -typedef enum pm_loop_flags { - /** a loop after a begin statement, so the body is executed first before the condition */ - PM_LOOP_FLAGS_BEGIN_MODIFIER = 1, -} pm_loop_flags_t; - -/** - * Flags for parameter nodes. - */ -typedef enum pm_parameter_flags { - /** a parameter name that has been repeated in the method signature */ - PM_PARAMETER_FLAGS_REPEATED_PARAMETER = 1, -} pm_parameter_flags_t; - -/** - * Flags for range and flip-flop nodes. - */ -typedef enum pm_range_flags { - /** ... operator */ - PM_RANGE_FLAGS_EXCLUDE_END = 1, -} pm_range_flags_t; - -/** - * Flags for regular expression and match last line nodes. - */ -typedef enum pm_regular_expression_flags { - /** i - ignores the case of characters when matching */ - PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE = 1, - - /** x - ignores whitespace and allows comments in regular expressions */ - PM_REGULAR_EXPRESSION_FLAGS_EXTENDED = 2, - - /** m - allows $ to match the end of lines within strings */ - PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE = 4, - - /** o - only interpolates values into the regular expression once */ - PM_REGULAR_EXPRESSION_FLAGS_ONCE = 8, - - /** e - forces the EUC-JP encoding */ - PM_REGULAR_EXPRESSION_FLAGS_EUC_JP = 16, - - /** n - forces the ASCII-8BIT encoding */ - PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT = 32, - - /** s - forces the Windows-31J encoding */ - PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J = 64, - - /** u - forces the UTF-8 encoding */ - PM_REGULAR_EXPRESSION_FLAGS_UTF_8 = 128, - - /** internal bytes forced the encoding to UTF-8 */ - PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING = 256, - - /** internal bytes forced the encoding to binary */ - PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING = 512, - - /** internal bytes forced the encoding to US-ASCII */ - PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING = 1024, -} pm_regular_expression_flags_t; - -/** - * Flags for return nodes. - */ -typedef enum pm_return_node_flags { - /** a return statement that is redundant because it is the last statement in a method */ - PM_RETURN_NODE_FLAGS_REDUNDANT = 1, -} pm_return_node_flags_t; - -/** - * Flags for shareable constant nodes. - */ -typedef enum pm_shareable_constant_node_flags { - /** constant writes that should be modified with shareable constant value literal */ - PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL = 1, - - /** constant writes that should be modified with shareable constant value experimental everything */ - PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING = 2, - - /** constant writes that should be modified with shareable constant value experimental copy */ - PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY = 4, -} pm_shareable_constant_node_flags_t; - -/** - * Flags for string nodes. - */ -typedef enum pm_string_flags { - /** internal bytes forced the encoding to UTF-8 */ - PM_STRING_FLAGS_FORCED_UTF8_ENCODING = 1, - - /** internal bytes forced the encoding to binary */ - PM_STRING_FLAGS_FORCED_BINARY_ENCODING = 2, - - /** frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` */ - PM_STRING_FLAGS_FROZEN = 4, - - /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` */ - PM_STRING_FLAGS_MUTABLE = 8, -} pm_string_flags_t; - -/** - * Flags for symbol nodes. - */ -typedef enum pm_symbol_flags { - /** internal bytes forced the encoding to UTF-8 */ - PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING = 1, - - /** internal bytes forced the encoding to binary */ - PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING = 2, - - /** internal bytes forced the encoding to US-ASCII */ - PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING = 4, -} pm_symbol_flags_t; - -/** - * When we're serializing to Java, we want to skip serializing the location - * fields as they won't be used by JRuby or TruffleRuby. This boolean allows us - * to specify that through the environment. It will never be true except for in - * those build systems. - */ -#define PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS false - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h deleted file mode 100644 index 849ca6d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h +++ /dev/null @@ -1,206 +0,0 @@ -/** - * @file defines.h - * - * Macro definitions used throughout the prism library. - * - * This file should be included first by any *.h or *.c in prism for consistency - * and to ensure that the macros are defined before they are used. - */ -#ifndef PRISM_DEFINES_H -#define PRISM_DEFINES_H - -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * We want to be able to use the PRI* macros for printing out integers, but on - * some platforms they aren't included unless this is already defined. - */ -#define __STDC_FORMAT_MACROS -#include - -/** - * By default, we compile with -fvisibility=hidden. When this is enabled, we - * need to mark certain functions as being publically-visible. This macro does - * that in a compiler-agnostic way. - */ -#ifndef PRISM_EXPORTED_FUNCTION -# ifdef PRISM_EXPORT_SYMBOLS -# ifdef _WIN32 -# define PRISM_EXPORTED_FUNCTION __declspec(dllexport) extern -# else -# define PRISM_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern -# endif -# else -# define PRISM_EXPORTED_FUNCTION -# endif -#endif - -/** - * Certain compilers support specifying that a function accepts variadic - * parameters that look like printf format strings to provide a better developer - * experience when someone is using the function. This macro does that in a - * compiler-agnostic way. - */ -#if defined(__GNUC__) -# if defined(__MINGW_PRINTF_FORMAT) -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index))) -# else -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index))) -# endif -#elif defined(__clang__) -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index))) -#else -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) -#endif - -/** - * GCC will warn if you specify a function or parameter that is unused at - * runtime. This macro allows you to mark a function or parameter as unused in a - * compiler-agnostic way. - */ -#if defined(__GNUC__) -# define PRISM_ATTRIBUTE_UNUSED __attribute__((unused)) -#else -# define PRISM_ATTRIBUTE_UNUSED -#endif - -/** - * Old Visual Studio versions do not support the inline keyword, so we need to - * define it to be __inline. - */ -#if defined(_MSC_VER) && !defined(inline) -# define inline __inline -#endif - -/** - * Old Visual Studio versions before 2015 do not implement sprintf, but instead - * implement _snprintf. We standard that here. - */ -#if !defined(snprintf) && defined(_MSC_VER) && (_MSC_VER < 1900) -# define snprintf _snprintf -#endif - -/** - * A simple utility macro to concatenate two tokens together, necessary when one - * of the tokens is itself a macro. - */ -#define PM_CONCATENATE(left, right) left ## right - -/** - * We want to be able to use static assertions, but they weren't standardized - * until C11. As such, we polyfill it here by making a hacky typedef that will - * fail to compile due to a negative array size if the condition is false. - */ -#if defined(_Static_assert) -# define PM_STATIC_ASSERT(line, condition, message) _Static_assert(condition, message) -#else -# define PM_STATIC_ASSERT(line, condition, message) typedef char PM_CONCATENATE(static_assert_, line)[(condition) ? 1 : -1] -#endif - -/** - * In general, libc for embedded systems does not support memory-mapped files. - * If the target platform is POSIX or Windows, we can map a file in memory and - * read it in a more efficient manner. - */ -#ifdef _WIN32 -# define PRISM_HAS_MMAP -#else -# include -# ifdef _POSIX_MAPPED_FILES -# define PRISM_HAS_MMAP -# endif -#endif - -/** - * isinf on Windows is defined as accepting a float, but on POSIX systems it - * accepts a float, a double, or a long double. We want to mirror this behavior - * on windows. - */ -#ifdef _WIN32 -# include -# undef isinf -# define isinf(x) (sizeof(x) == sizeof(float) ? !_finitef(x) : !_finite(x)) -#endif - -/** - * If you build prism with a custom allocator, configure it with - * "-D PRISM_XALLOCATOR" to use your own allocator that defines xmalloc, - * xrealloc, xcalloc, and xfree. - * - * For example, your `prism_xallocator.h` file could look like this: - * - * ``` - * #ifndef PRISM_XALLOCATOR_H - * #define PRISM_XALLOCATOR_H - * #define xmalloc my_malloc - * #define xrealloc my_realloc - * #define xcalloc my_calloc - * #define xfree my_free - * #endif - * ``` - */ -#ifdef PRISM_XALLOCATOR - #include "prism_xallocator.h" -#else - #ifndef xmalloc - /** - * The malloc function that should be used. This can be overridden with - * the PRISM_XALLOCATOR define. - */ - #define xmalloc malloc - #endif - - #ifndef xrealloc - /** - * The realloc function that should be used. This can be overridden with - * the PRISM_XALLOCATOR define. - */ - #define xrealloc realloc - #endif - - #ifndef xcalloc - /** - * The calloc function that should be used. This can be overridden with - * the PRISM_XALLOCATOR define. - */ - #define xcalloc calloc - #endif - - #ifndef xfree - /** - * The free function that should be used. This can be overridden with the - * PRISM_XALLOCATOR define. - */ - #define xfree free - #endif -#endif - -/** - * If PRISM_BUILD_MINIMAL is defined, then we're going to define every possible - * switch that will turn off certain features of prism. - */ -#ifdef PRISM_BUILD_MINIMAL - /** Exclude the serialization API. */ - #define PRISM_EXCLUDE_SERIALIZATION - - /** Exclude the JSON serialization API. */ - #define PRISM_EXCLUDE_JSON - - /** Exclude the Array#pack parser API. */ - #define PRISM_EXCLUDE_PACK - - /** Exclude the prettyprint API. */ - #define PRISM_EXCLUDE_PRETTYPRINT - - /** Exclude the full set of encodings, using the minimal only. */ - #define PRISM_ENCODING_EXCLUDE_FULL -#endif - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h deleted file mode 100644 index f596415..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h +++ /dev/null @@ -1,433 +0,0 @@ -/******************************************************************************/ -/* This file is generated by the templates/template.rb script and should not */ -/* be modified manually. See */ -/* templates/include/prism/diagnostic.h.erb */ -/* if you are looking to modify the */ -/* template */ -/******************************************************************************/ - -/** - * @file diagnostic.h - * - * A list of diagnostics generated during parsing. - */ -#ifndef PRISM_DIAGNOSTIC_H -#define PRISM_DIAGNOSTIC_H - -#include "prism/ast.h" -#include "prism/defines.h" -#include "prism/util/pm_list.h" - -#include -#include -#include - -/** - * The diagnostic IDs of all of the diagnostics, used to communicate the types - * of errors between the parser and the user. - */ -typedef enum { - // These are the error diagnostics. - PM_ERR_ALIAS_ARGUMENT, - PM_ERR_ALIAS_ARGUMENT_NUMBERED_REFERENCE, - PM_ERR_AMPAMPEQ_MULTI_ASSIGN, - PM_ERR_ARGUMENT_AFTER_BLOCK, - PM_ERR_ARGUMENT_AFTER_FORWARDING_ELLIPSES, - PM_ERR_ARGUMENT_BARE_HASH, - PM_ERR_ARGUMENT_BLOCK_FORWARDING, - PM_ERR_ARGUMENT_BLOCK_MULTI, - PM_ERR_ARGUMENT_CONFLICT_AMPERSAND, - PM_ERR_ARGUMENT_CONFLICT_STAR, - PM_ERR_ARGUMENT_CONFLICT_STAR_STAR, - PM_ERR_ARGUMENT_FORMAL_CLASS, - PM_ERR_ARGUMENT_FORMAL_CONSTANT, - PM_ERR_ARGUMENT_FORMAL_GLOBAL, - PM_ERR_ARGUMENT_FORMAL_IVAR, - PM_ERR_ARGUMENT_FORWARDING_UNBOUND, - PM_ERR_ARGUMENT_IN, - PM_ERR_ARGUMENT_NO_FORWARDING_AMPERSAND, - PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES, - PM_ERR_ARGUMENT_NO_FORWARDING_STAR, - PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR, - PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT, - PM_ERR_ARGUMENT_SPLAT_AFTER_SPLAT, - PM_ERR_ARGUMENT_TERM_PAREN, - PM_ERR_ARGUMENT_UNEXPECTED_BLOCK, - PM_ERR_ARRAY_ELEMENT, - PM_ERR_ARRAY_EXPRESSION, - PM_ERR_ARRAY_EXPRESSION_AFTER_STAR, - PM_ERR_ARRAY_SEPARATOR, - PM_ERR_ARRAY_TERM, - PM_ERR_BEGIN_LONELY_ELSE, - PM_ERR_BEGIN_TERM, - PM_ERR_BEGIN_UPCASE_BRACE, - PM_ERR_BEGIN_UPCASE_TERM, - PM_ERR_BEGIN_UPCASE_TOPLEVEL, - PM_ERR_BLOCK_PARAM_LOCAL_VARIABLE, - PM_ERR_BLOCK_PARAM_PIPE_TERM, - PM_ERR_BLOCK_TERM_BRACE, - PM_ERR_BLOCK_TERM_END, - PM_ERR_CANNOT_PARSE_EXPRESSION, - PM_ERR_CANNOT_PARSE_STRING_PART, - PM_ERR_CASE_EXPRESSION_AFTER_CASE, - PM_ERR_CASE_EXPRESSION_AFTER_WHEN, - PM_ERR_CASE_MATCH_MISSING_PREDICATE, - PM_ERR_CASE_MISSING_CONDITIONS, - PM_ERR_CASE_TERM, - PM_ERR_CLASS_IN_METHOD, - PM_ERR_CLASS_NAME, - PM_ERR_CLASS_SUPERCLASS, - PM_ERR_CLASS_TERM, - PM_ERR_CLASS_UNEXPECTED_END, - PM_ERR_CLASS_VARIABLE_BARE, - PM_ERR_CONDITIONAL_ELSIF_PREDICATE, - PM_ERR_CONDITIONAL_IF_PREDICATE, - PM_ERR_CONDITIONAL_PREDICATE_TERM, - PM_ERR_CONDITIONAL_TERM, - PM_ERR_CONDITIONAL_TERM_ELSE, - PM_ERR_CONDITIONAL_UNLESS_PREDICATE, - PM_ERR_CONDITIONAL_UNTIL_PREDICATE, - PM_ERR_CONDITIONAL_WHILE_PREDICATE, - PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT, - PM_ERR_DEF_ENDLESS, - PM_ERR_DEF_ENDLESS_SETTER, - PM_ERR_DEF_NAME, - PM_ERR_DEF_PARAMS_TERM, - PM_ERR_DEF_PARAMS_TERM_PAREN, - PM_ERR_DEF_RECEIVER, - PM_ERR_DEF_RECEIVER_TERM, - PM_ERR_DEF_TERM, - PM_ERR_DEFINED_EXPRESSION, - PM_ERR_EMBDOC_TERM, - PM_ERR_EMBEXPR_END, - PM_ERR_EMBVAR_INVALID, - PM_ERR_END_UPCASE_BRACE, - PM_ERR_END_UPCASE_TERM, - PM_ERR_ESCAPE_INVALID_CONTROL, - PM_ERR_ESCAPE_INVALID_CONTROL_REPEAT, - PM_ERR_ESCAPE_INVALID_HEXADECIMAL, - PM_ERR_ESCAPE_INVALID_META, - PM_ERR_ESCAPE_INVALID_META_REPEAT, - PM_ERR_ESCAPE_INVALID_UNICODE, - PM_ERR_ESCAPE_INVALID_UNICODE_CM_FLAGS, - PM_ERR_ESCAPE_INVALID_UNICODE_LITERAL, - PM_ERR_ESCAPE_INVALID_UNICODE_LONG, - PM_ERR_ESCAPE_INVALID_UNICODE_TERM, - PM_ERR_EXPECT_ARGUMENT, - PM_ERR_EXPECT_EOL_AFTER_STATEMENT, - PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, - PM_ERR_EXPECT_EXPRESSION_AFTER_COMMA, - PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL, - PM_ERR_EXPECT_EXPRESSION_AFTER_LESS_LESS, - PM_ERR_EXPECT_EXPRESSION_AFTER_LPAREN, - PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, - PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, - PM_ERR_EXPECT_EXPRESSION_AFTER_QUESTION, - PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT, - PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT_HASH, - PM_ERR_EXPECT_EXPRESSION_AFTER_STAR, - PM_ERR_EXPECT_IDENT_REQ_PARAMETER, - PM_ERR_EXPECT_IN_DELIMITER, - PM_ERR_EXPECT_LPAREN_REQ_PARAMETER, - PM_ERR_EXPECT_MESSAGE, - PM_ERR_EXPECT_RBRACKET, - PM_ERR_EXPECT_RPAREN, - PM_ERR_EXPECT_RPAREN_AFTER_MULTI, - PM_ERR_EXPECT_RPAREN_REQ_PARAMETER, - PM_ERR_EXPECT_STRING_CONTENT, - PM_ERR_EXPECT_WHEN_DELIMITER, - PM_ERR_EXPRESSION_BARE_HASH, - PM_ERR_EXPRESSION_NOT_WRITABLE, - PM_ERR_EXPRESSION_NOT_WRITABLE_ENCODING, - PM_ERR_EXPRESSION_NOT_WRITABLE_FALSE, - PM_ERR_EXPRESSION_NOT_WRITABLE_FILE, - PM_ERR_EXPRESSION_NOT_WRITABLE_LINE, - PM_ERR_EXPRESSION_NOT_WRITABLE_NIL, - PM_ERR_EXPRESSION_NOT_WRITABLE_SELF, - PM_ERR_EXPRESSION_NOT_WRITABLE_TRUE, - PM_ERR_FLOAT_PARSE, - PM_ERR_FOR_COLLECTION, - PM_ERR_FOR_IN, - PM_ERR_FOR_INDEX, - PM_ERR_FOR_TERM, - PM_ERR_GLOBAL_VARIABLE_BARE, - PM_ERR_HASH_EXPRESSION_AFTER_LABEL, - PM_ERR_HASH_KEY, - PM_ERR_HASH_ROCKET, - PM_ERR_HASH_TERM, - PM_ERR_HASH_VALUE, - PM_ERR_HEREDOC_IDENTIFIER, - PM_ERR_HEREDOC_TERM, - PM_ERR_INCOMPLETE_QUESTION_MARK, - PM_ERR_INCOMPLETE_VARIABLE_CLASS, - PM_ERR_INCOMPLETE_VARIABLE_CLASS_3_3, - PM_ERR_INCOMPLETE_VARIABLE_INSTANCE, - PM_ERR_INCOMPLETE_VARIABLE_INSTANCE_3_3, - PM_ERR_INSTANCE_VARIABLE_BARE, - PM_ERR_INVALID_BLOCK_EXIT, - PM_ERR_INVALID_CHARACTER, - PM_ERR_INVALID_ENCODING_MAGIC_COMMENT, - PM_ERR_INVALID_ESCAPE_CHARACTER, - PM_ERR_INVALID_FLOAT_EXPONENT, - PM_ERR_INVALID_LOCAL_VARIABLE_READ, - PM_ERR_INVALID_LOCAL_VARIABLE_WRITE, - PM_ERR_INVALID_MULTIBYTE_CHAR, - PM_ERR_INVALID_MULTIBYTE_CHARACTER, - PM_ERR_INVALID_MULTIBYTE_ESCAPE, - PM_ERR_INVALID_NUMBER_BINARY, - PM_ERR_INVALID_NUMBER_DECIMAL, - PM_ERR_INVALID_NUMBER_FRACTION, - PM_ERR_INVALID_NUMBER_HEXADECIMAL, - PM_ERR_INVALID_NUMBER_OCTAL, - PM_ERR_INVALID_NUMBER_UNDERSCORE_INNER, - PM_ERR_INVALID_NUMBER_UNDERSCORE_TRAILING, - PM_ERR_INVALID_PERCENT, - PM_ERR_INVALID_PRINTABLE_CHARACTER, - PM_ERR_INVALID_RETRY_AFTER_ELSE, - PM_ERR_INVALID_RETRY_AFTER_ENSURE, - PM_ERR_INVALID_RETRY_WITHOUT_RESCUE, - PM_ERR_INVALID_SYMBOL, - PM_ERR_INVALID_VARIABLE_GLOBAL, - PM_ERR_INVALID_VARIABLE_GLOBAL_3_3, - PM_ERR_INVALID_YIELD, - PM_ERR_IT_NOT_ALLOWED_NUMBERED, - PM_ERR_IT_NOT_ALLOWED_ORDINARY, - PM_ERR_LAMBDA_OPEN, - PM_ERR_LAMBDA_TERM_BRACE, - PM_ERR_LAMBDA_TERM_END, - PM_ERR_LIST_I_LOWER_ELEMENT, - PM_ERR_LIST_I_LOWER_TERM, - PM_ERR_LIST_I_UPPER_ELEMENT, - PM_ERR_LIST_I_UPPER_TERM, - PM_ERR_LIST_W_LOWER_ELEMENT, - PM_ERR_LIST_W_LOWER_TERM, - PM_ERR_LIST_W_UPPER_ELEMENT, - PM_ERR_LIST_W_UPPER_TERM, - PM_ERR_MALLOC_FAILED, - PM_ERR_MIXED_ENCODING, - PM_ERR_MODULE_IN_METHOD, - PM_ERR_MODULE_NAME, - PM_ERR_MODULE_TERM, - PM_ERR_MULTI_ASSIGN_MULTI_SPLATS, - PM_ERR_MULTI_ASSIGN_UNEXPECTED_REST, - PM_ERR_NO_LOCAL_VARIABLE, - PM_ERR_NOT_EXPRESSION, - PM_ERR_NUMBER_LITERAL_UNDERSCORE, - PM_ERR_NUMBERED_PARAMETER_IT, - PM_ERR_NUMBERED_PARAMETER_ORDINARY, - PM_ERR_NUMBERED_PARAMETER_OUTER_SCOPE, - PM_ERR_OPERATOR_MULTI_ASSIGN, - PM_ERR_OPERATOR_WRITE_ARGUMENTS, - PM_ERR_OPERATOR_WRITE_BLOCK, - PM_ERR_PARAMETER_ASSOC_SPLAT_MULTI, - PM_ERR_PARAMETER_BLOCK_MULTI, - PM_ERR_PARAMETER_CIRCULAR, - PM_ERR_PARAMETER_FORWARDING_AFTER_REST, - PM_ERR_PARAMETER_METHOD_NAME, - PM_ERR_PARAMETER_NAME_DUPLICATED, - PM_ERR_PARAMETER_NO_DEFAULT, - PM_ERR_PARAMETER_NO_DEFAULT_KW, - PM_ERR_PARAMETER_NUMBERED_RESERVED, - PM_ERR_PARAMETER_ORDER, - PM_ERR_PARAMETER_SPLAT_MULTI, - PM_ERR_PARAMETER_STAR, - PM_ERR_PARAMETER_UNEXPECTED_FWD, - PM_ERR_PARAMETER_WILD_LOOSE_COMMA, - PM_ERR_PARAMETER_UNEXPECTED_NO_KW, - PM_ERR_PATTERN_CAPTURE_DUPLICATE, - PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET, - PM_ERR_PATTERN_EXPRESSION_AFTER_COMMA, - PM_ERR_PATTERN_EXPRESSION_AFTER_HROCKET, - PM_ERR_PATTERN_EXPRESSION_AFTER_IN, - PM_ERR_PATTERN_EXPRESSION_AFTER_KEY, - PM_ERR_PATTERN_EXPRESSION_AFTER_PAREN, - PM_ERR_PATTERN_EXPRESSION_AFTER_PIN, - PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, - PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE, - PM_ERR_PATTERN_EXPRESSION_AFTER_REST, - PM_ERR_PATTERN_HASH_IMPLICIT, - PM_ERR_PATTERN_HASH_KEY, - PM_ERR_PATTERN_HASH_KEY_DUPLICATE, - PM_ERR_PATTERN_HASH_KEY_INTERPOLATED, - PM_ERR_PATTERN_HASH_KEY_LABEL, - PM_ERR_PATTERN_HASH_KEY_LOCALS, - PM_ERR_PATTERN_IDENT_AFTER_HROCKET, - PM_ERR_PATTERN_LABEL_AFTER_COMMA, - PM_ERR_PATTERN_REST, - PM_ERR_PATTERN_TERM_BRACE, - PM_ERR_PATTERN_TERM_BRACKET, - PM_ERR_PATTERN_TERM_PAREN, - PM_ERR_PIPEPIPEEQ_MULTI_ASSIGN, - PM_ERR_REGEXP_ENCODING_OPTION_MISMATCH, - PM_ERR_REGEXP_INCOMPAT_CHAR_ENCODING, - PM_ERR_REGEXP_INVALID_UNICODE_RANGE, - PM_ERR_REGEXP_NON_ESCAPED_MBC, - PM_ERR_REGEXP_TERM, - PM_ERR_REGEXP_UNKNOWN_OPTIONS, - PM_ERR_REGEXP_UTF8_CHAR_NON_UTF8_REGEXP, - PM_ERR_RESCUE_EXPRESSION, - PM_ERR_RESCUE_MODIFIER_VALUE, - PM_ERR_RESCUE_TERM, - PM_ERR_RESCUE_VARIABLE, - PM_ERR_RETURN_INVALID, - PM_ERR_SCRIPT_NOT_FOUND, - PM_ERR_SINGLETON_FOR_LITERALS, - PM_ERR_STATEMENT_ALIAS, - PM_ERR_STATEMENT_POSTEXE_END, - PM_ERR_STATEMENT_PREEXE_BEGIN, - PM_ERR_STATEMENT_UNDEF, - PM_ERR_STRING_CONCATENATION, - PM_ERR_STRING_INTERPOLATED_TERM, - PM_ERR_STRING_LITERAL_EOF, - PM_ERR_STRING_LITERAL_TERM, - PM_ERR_SYMBOL_INVALID, - PM_ERR_SYMBOL_TERM_DYNAMIC, - PM_ERR_SYMBOL_TERM_INTERPOLATED, - PM_ERR_TERNARY_COLON, - PM_ERR_TERNARY_EXPRESSION_FALSE, - PM_ERR_TERNARY_EXPRESSION_TRUE, - PM_ERR_UNARY_RECEIVER, - PM_ERR_UNDEF_ARGUMENT, - PM_ERR_UNEXPECTED_BLOCK_ARGUMENT, - PM_ERR_UNEXPECTED_INDEX_BLOCK, - PM_ERR_UNEXPECTED_INDEX_KEYWORDS, - PM_ERR_UNEXPECTED_SAFE_NAVIGATION, - PM_ERR_UNEXPECTED_TOKEN_CLOSE_CONTEXT, - PM_ERR_UNEXPECTED_TOKEN_IGNORE, - PM_ERR_UNTIL_TERM, - PM_ERR_VOID_EXPRESSION, - PM_ERR_WHILE_TERM, - PM_ERR_WRITE_TARGET_IN_METHOD, - PM_ERR_WRITE_TARGET_READONLY, - PM_ERR_WRITE_TARGET_UNEXPECTED, - PM_ERR_XSTRING_TERM, - - // These are the warning diagnostics. - PM_WARN_AMBIGUOUS_FIRST_ARGUMENT_MINUS, - PM_WARN_AMBIGUOUS_FIRST_ARGUMENT_PLUS, - PM_WARN_AMBIGUOUS_PREFIX_AMPERSAND, - PM_WARN_AMBIGUOUS_PREFIX_STAR, - PM_WARN_AMBIGUOUS_PREFIX_STAR_STAR, - PM_WARN_AMBIGUOUS_SLASH, - PM_WARN_COMPARISON_AFTER_COMPARISON, - PM_WARN_DOT_DOT_DOT_EOL, - PM_WARN_EQUAL_IN_CONDITIONAL, - PM_WARN_EQUAL_IN_CONDITIONAL_3_3, - PM_WARN_END_IN_METHOD, - PM_WARN_DUPLICATED_HASH_KEY, - PM_WARN_DUPLICATED_WHEN_CLAUSE, - PM_WARN_FLOAT_OUT_OF_RANGE, - PM_WARN_IGNORED_FROZEN_STRING_LITERAL, - PM_WARN_INTEGER_IN_FLIP_FLOP, - PM_WARN_INVALID_CHARACTER, - PM_WARN_INVALID_NUMBERED_REFERENCE, - PM_WARN_INVALID_SHAREABLE_CONSTANT_VALUE, - PM_WARN_KEYWORD_EOL, - PM_WARN_LITERAL_IN_CONDITION_DEFAULT, - PM_WARN_LITERAL_IN_CONDITION_VERBOSE, - PM_WARN_SHAREABLE_CONSTANT_VALUE_LINE, - PM_WARN_SHEBANG_CARRIAGE_RETURN, - PM_WARN_UNEXPECTED_CARRIAGE_RETURN, - PM_WARN_UNREACHABLE_STATEMENT, - PM_WARN_UNUSED_LOCAL_VARIABLE, - PM_WARN_VOID_STATEMENT, -} pm_diagnostic_id_t; - -/** - * This struct represents a diagnostic generated during parsing. - * - * @extends pm_list_node_t - */ -typedef struct { - /** The embedded base node. */ - pm_list_node_t node; - - /** The location of the diagnostic in the source. */ - pm_location_t location; - - /** The ID of the diagnostic. */ - pm_diagnostic_id_t diag_id; - - /** The message associated with the diagnostic. */ - const char *message; - - /** - * Whether or not the memory related to the message of this diagnostic is - * owned by this diagnostic. If it is, it needs to be freed when the - * diagnostic is freed. - */ - bool owned; - - /** - * The level of the diagnostic, see `pm_error_level_t` and - * `pm_warning_level_t` for possible values. - */ - uint8_t level; -} pm_diagnostic_t; - -/** - * The levels of errors generated during parsing. - */ -typedef enum { - /** For errors that should raise a syntax error. */ - PM_ERROR_LEVEL_SYNTAX = 0, - - /** For errors that should raise an argument error. */ - PM_ERROR_LEVEL_ARGUMENT = 1, - - /** For errors that should raise a load error. */ - PM_ERROR_LEVEL_LOAD = 2 -} pm_error_level_t; - -/** - * The levels of warnings generated during parsing. - */ -typedef enum { - /** For warnings which should be emitted if $VERBOSE != nil. */ - PM_WARNING_LEVEL_DEFAULT = 0, - - /** For warnings which should be emitted if $VERBOSE == true. */ - PM_WARNING_LEVEL_VERBOSE = 1 -} pm_warning_level_t; - -/** - * Get the human-readable name of the given diagnostic ID. - * - * @param diag_id The diagnostic ID. - * @return The human-readable name of the diagnostic ID. - */ -const char * pm_diagnostic_id_human(pm_diagnostic_id_t diag_id); - -/** - * Append a diagnostic to the given list of diagnostics that is using shared - * memory for its message. - * - * @param list The list to append to. - * @param start The start of the diagnostic. - * @param end The end of the diagnostic. - * @param diag_id The diagnostic ID. - * @return Whether the diagnostic was successfully appended. - */ -bool pm_diagnostic_list_append(pm_list_t *list, const uint8_t *start, const uint8_t *end, pm_diagnostic_id_t diag_id); - -/** - * Append a diagnostic to the given list of diagnostics that is using a format - * string for its message. - * - * @param list The list to append to. - * @param start The start of the diagnostic. - * @param end The end of the diagnostic. - * @param diag_id The diagnostic ID. - * @param ... The arguments to the format string for the message. - * @return Whether the diagnostic was successfully appended. - */ -bool pm_diagnostic_list_append_format(pm_list_t *list, const uint8_t *start, const uint8_t *end, pm_diagnostic_id_t diag_id, ...); - -/** - * Deallocate the internal state of the given diagnostic list. - * - * @param list The list to deallocate. - */ -void pm_diagnostic_list_free(pm_list_t *list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h deleted file mode 100644 index 5f77248..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h +++ /dev/null @@ -1,283 +0,0 @@ -/** - * @file encoding.h - * - * The encoding interface and implementations used by the parser. - */ -#ifndef PRISM_ENCODING_H -#define PRISM_ENCODING_H - -#include "prism/defines.h" -#include "prism/util/pm_strncasecmp.h" - -#include -#include -#include -#include - -/** - * This struct defines the functions necessary to implement the encoding - * interface so we can determine how many bytes the subsequent character takes. - * Each callback should return the number of bytes, or 0 if the next bytes are - * invalid for the encoding and type. - */ -typedef struct { - /** - * Return the number of bytes that the next character takes if it is valid - * in the encoding. Does not read more than n bytes. It is assumed that n is - * at least 1. - */ - size_t (*char_width)(const uint8_t *b, ptrdiff_t n); - - /** - * Return the number of bytes that the next character takes if it is valid - * in the encoding and is alphabetical. Does not read more than n bytes. It - * is assumed that n is at least 1. - */ - size_t (*alpha_char)(const uint8_t *b, ptrdiff_t n); - - /** - * Return the number of bytes that the next character takes if it is valid - * in the encoding and is alphanumeric. Does not read more than n bytes. It - * is assumed that n is at least 1. - */ - size_t (*alnum_char)(const uint8_t *b, ptrdiff_t n); - - /** - * Return true if the next character is valid in the encoding and is an - * uppercase character. Does not read more than n bytes. It is assumed that - * n is at least 1. - */ - bool (*isupper_char)(const uint8_t *b, ptrdiff_t n); - - /** - * The name of the encoding. This should correspond to a value that can be - * passed to Encoding.find in Ruby. - */ - const char *name; - - /** - * Return true if the encoding is a multibyte encoding. - */ - bool multibyte; -} pm_encoding_t; - -/** - * All of the lookup tables use the first bit of each embedded byte to indicate - * whether the codepoint is alphabetical. - */ -#define PRISM_ENCODING_ALPHABETIC_BIT 1 << 0 - -/** - * All of the lookup tables use the second bit of each embedded byte to indicate - * whether the codepoint is alphanumeric. - */ -#define PRISM_ENCODING_ALPHANUMERIC_BIT 1 << 1 - -/** - * All of the lookup tables use the third bit of each embedded byte to indicate - * whether the codepoint is uppercase. - */ -#define PRISM_ENCODING_UPPERCASE_BIT 1 << 2 - -/** - * Return the size of the next character in the UTF-8 encoding. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_utf_8_char_width(const uint8_t *b, ptrdiff_t n); - -/** - * Return the size of the next character in the UTF-8 encoding if it is an - * alphabetical character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_utf_8_alpha_char(const uint8_t *b, ptrdiff_t n); - -/** - * Return the size of the next character in the UTF-8 encoding if it is an - * alphanumeric character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_utf_8_alnum_char(const uint8_t *b, ptrdiff_t n); - -/** - * Return true if the next character in the UTF-8 encoding if it is an uppercase - * character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns True if the next character is valid in the encoding and is an - * uppercase character, or false if it is not. - */ -bool pm_encoding_utf_8_isupper_char(const uint8_t *b, ptrdiff_t n); - -/** - * This lookup table is referenced in both the UTF-8 encoding file and the - * parser directly in order to speed up the default encoding processing. It is - * used to indicate whether a character is alphabetical, alphanumeric, or - * uppercase in unicode mappings. - */ -extern const uint8_t pm_encoding_unicode_table[256]; - -/** - * These are all of the encodings that prism supports. - */ -typedef enum { - PM_ENCODING_UTF_8 = 0, - PM_ENCODING_US_ASCII, - PM_ENCODING_ASCII_8BIT, - PM_ENCODING_EUC_JP, - PM_ENCODING_WINDOWS_31J, - -// We optionally support excluding the full set of encodings to only support the -// minimum necessary to process Ruby code without encoding comments. -#ifndef PRISM_ENCODING_EXCLUDE_FULL - PM_ENCODING_BIG5, - PM_ENCODING_BIG5_HKSCS, - PM_ENCODING_BIG5_UAO, - PM_ENCODING_CESU_8, - PM_ENCODING_CP51932, - PM_ENCODING_CP850, - PM_ENCODING_CP852, - PM_ENCODING_CP855, - PM_ENCODING_CP949, - PM_ENCODING_CP950, - PM_ENCODING_CP951, - PM_ENCODING_EMACS_MULE, - PM_ENCODING_EUC_JP_MS, - PM_ENCODING_EUC_JIS_2004, - PM_ENCODING_EUC_KR, - PM_ENCODING_EUC_TW, - PM_ENCODING_GB12345, - PM_ENCODING_GB18030, - PM_ENCODING_GB1988, - PM_ENCODING_GB2312, - PM_ENCODING_GBK, - PM_ENCODING_IBM437, - PM_ENCODING_IBM720, - PM_ENCODING_IBM737, - PM_ENCODING_IBM775, - PM_ENCODING_IBM852, - PM_ENCODING_IBM855, - PM_ENCODING_IBM857, - PM_ENCODING_IBM860, - PM_ENCODING_IBM861, - PM_ENCODING_IBM862, - PM_ENCODING_IBM863, - PM_ENCODING_IBM864, - PM_ENCODING_IBM865, - PM_ENCODING_IBM866, - PM_ENCODING_IBM869, - PM_ENCODING_ISO_8859_1, - PM_ENCODING_ISO_8859_2, - PM_ENCODING_ISO_8859_3, - PM_ENCODING_ISO_8859_4, - PM_ENCODING_ISO_8859_5, - PM_ENCODING_ISO_8859_6, - PM_ENCODING_ISO_8859_7, - PM_ENCODING_ISO_8859_8, - PM_ENCODING_ISO_8859_9, - PM_ENCODING_ISO_8859_10, - PM_ENCODING_ISO_8859_11, - PM_ENCODING_ISO_8859_13, - PM_ENCODING_ISO_8859_14, - PM_ENCODING_ISO_8859_15, - PM_ENCODING_ISO_8859_16, - PM_ENCODING_KOI8_R, - PM_ENCODING_KOI8_U, - PM_ENCODING_MAC_CENT_EURO, - PM_ENCODING_MAC_CROATIAN, - PM_ENCODING_MAC_CYRILLIC, - PM_ENCODING_MAC_GREEK, - PM_ENCODING_MAC_ICELAND, - PM_ENCODING_MAC_JAPANESE, - PM_ENCODING_MAC_ROMAN, - PM_ENCODING_MAC_ROMANIA, - PM_ENCODING_MAC_THAI, - PM_ENCODING_MAC_TURKISH, - PM_ENCODING_MAC_UKRAINE, - PM_ENCODING_SHIFT_JIS, - PM_ENCODING_SJIS_DOCOMO, - PM_ENCODING_SJIS_KDDI, - PM_ENCODING_SJIS_SOFTBANK, - PM_ENCODING_STATELESS_ISO_2022_JP, - PM_ENCODING_STATELESS_ISO_2022_JP_KDDI, - PM_ENCODING_TIS_620, - PM_ENCODING_UTF8_MAC, - PM_ENCODING_UTF8_DOCOMO, - PM_ENCODING_UTF8_KDDI, - PM_ENCODING_UTF8_SOFTBANK, - PM_ENCODING_WINDOWS_1250, - PM_ENCODING_WINDOWS_1251, - PM_ENCODING_WINDOWS_1252, - PM_ENCODING_WINDOWS_1253, - PM_ENCODING_WINDOWS_1254, - PM_ENCODING_WINDOWS_1255, - PM_ENCODING_WINDOWS_1256, - PM_ENCODING_WINDOWS_1257, - PM_ENCODING_WINDOWS_1258, - PM_ENCODING_WINDOWS_874, -#endif - - PM_ENCODING_MAXIMUM -} pm_encoding_type_t; - -/** - * This is the table of all of the encodings that prism supports. - */ -extern const pm_encoding_t pm_encodings[PM_ENCODING_MAXIMUM]; - -/** - * This is the default UTF-8 encoding. We need a reference to it to quickly - * create parsers. - */ -#define PM_ENCODING_UTF_8_ENTRY (&pm_encodings[PM_ENCODING_UTF_8]) - -/** - * This is the US-ASCII encoding. We need a reference to it to be able to - * compare against it when a string is being created because it could possibly - * need to fall back to ASCII-8BIT. - */ -#define PM_ENCODING_US_ASCII_ENTRY (&pm_encodings[PM_ENCODING_US_ASCII]) - -/** - * This is the ASCII-8BIT encoding. We need a reference to it so that pm_strpbrk - * can compare against it because invalid multibyte characters are not a thing - * in this encoding. It is also needed for handling Regexp encoding flags. - */ -#define PM_ENCODING_ASCII_8BIT_ENTRY (&pm_encodings[PM_ENCODING_ASCII_8BIT]) - -/** - * This is the EUC-JP encoding. We need a reference to it to quickly process - * regular expression modifiers. - */ -#define PM_ENCODING_EUC_JP_ENTRY (&pm_encodings[PM_ENCODING_EUC_JP]) - -/** - * This is the Windows-31J encoding. We need a reference to it to quickly - * process regular expression modifiers. - */ -#define PM_ENCODING_WINDOWS_31J_ENTRY (&pm_encodings[PM_ENCODING_WINDOWS_31J]) - -/** - * Parse the given name of an encoding and return a pointer to the corresponding - * encoding struct if one can be found, otherwise return NULL. - * - * @param start A pointer to the first byte of the name. - * @param end A pointer to the last byte of the name. - * @returns A pointer to the encoding struct if one is found, otherwise NULL. - */ -const pm_encoding_t * pm_encoding_find(const uint8_t *start, const uint8_t *end); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h deleted file mode 100644 index b15a2c5..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef PRISM_EXT_NODE_H -#define PRISM_EXT_NODE_H - -#define EXPECTED_PRISM_VERSION "0.29.0" - -#include -#include -#include "prism.h" - -VALUE pm_source_new(const pm_parser_t *parser, rb_encoding *encoding); -VALUE pm_token_new(const pm_parser_t *parser, const pm_token_t *token, rb_encoding *encoding, VALUE source); -VALUE pm_ast_new(const pm_parser_t *parser, const pm_node_t *node, rb_encoding *encoding, VALUE source); -VALUE pm_integer_new(const pm_integer_t *integer); - -void Init_prism_api_node(void); -void Init_prism_pack(void); -PRISM_EXPORTED_FUNCTION void Init_prism(void); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h deleted file mode 100644 index 8736e59..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @file node.h - * - * Functions related to nodes in the AST. - */ -#ifndef PRISM_NODE_H -#define PRISM_NODE_H - -#include "prism/defines.h" -#include "prism/parser.h" -#include "prism/util/pm_buffer.h" - -/** - * Loop through each node in the node list, writing each node to the given - * pm_node_t pointer. - */ -#define PM_NODE_LIST_FOREACH(list, index, node) \ - for (size_t index = 0; index < (list)->size && ((node) = (list)->nodes[index]); index++) - -/** - * Append a new node onto the end of the node list. - * - * @param list The list to append to. - * @param node The node to append. - */ -void pm_node_list_append(pm_node_list_t *list, pm_node_t *node); - -/** - * Prepend a new node onto the beginning of the node list. - * - * @param list The list to prepend to. - * @param node The node to prepend. - */ -void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node); - -/** - * Concatenate the given node list onto the end of the other node list. - * - * @param list The list to concatenate onto. - * @param other The list to concatenate. - */ -void pm_node_list_concat(pm_node_list_t *list, pm_node_list_t *other); - -/** - * Free the internal memory associated with the given node list. - * - * @param list The list to free. - */ -void pm_node_list_free(pm_node_list_t *list); - -/** - * Deallocate a node and all of its children. - * - * @param parser The parser that owns the node. - * @param node The node to deallocate. - */ -PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node); - -/** - * This struct stores the information gathered by the pm_node_memsize function. - * It contains both the memory footprint and additionally metadata about the - * shape of the tree. - */ -typedef struct { - /** The total memory footprint of the node and all of its children. */ - size_t memsize; - - /** The number of children the node has. */ - size_t node_count; -} pm_memsize_t; - -/** - * Calculates the memory footprint of a given node. - * - * @param node The node to calculate the memory footprint of. - * @param memsize The memory footprint of the node and all of its children. - */ -PRISM_EXPORTED_FUNCTION void pm_node_memsize(pm_node_t *node, pm_memsize_t *memsize); - -/** - * Returns a string representation of the given node type. - * - * @param node_type The node type to convert to a string. - * @return A string representation of the given node type. - */ -PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_type); - -/** - * Visit each of the nodes in this subtree using the given visitor callback. The - * callback function will be called for each node in the subtree. If it returns - * false, then that node's children will not be visited. If it returns true, - * then the children will be visited. The data parameter is treated as an opaque - * pointer and is passed to the visitor callback for consumers to use as they - * see fit. - * - * As an example: - * - * ```c - * #include "prism.h" - * - * bool visit(const pm_node_t *node, void *data) { - * size_t *indent = (size_t *) data; - * for (size_t i = 0; i < *indent * 2; i++) putc(' ', stdout); - * printf("%s\n", pm_node_type_to_str(node->type)); - * - * size_t next_indent = *indent + 1; - * size_t *next_data = &next_indent; - * pm_visit_child_nodes(node, visit, next_data); - * - * return false; - * } - * - * int main(void) { - * const char *source = "1 + 2; 3 + 4"; - * size_t size = strlen(source); - * - * pm_parser_t parser; - * pm_options_t options = { 0 }; - * pm_parser_init(&parser, (const uint8_t *) source, size, &options); - * - * size_t indent = 0; - * pm_node_t *node = pm_parse(&parser); - * - * size_t *data = &indent; - * pm_visit_node(node, visit, data); - * - * pm_node_destroy(&parser, node); - * pm_parser_free(&parser); - * return EXIT_SUCCESS; - * } - * ``` - * - * @param node The root node to start visiting from. - * @param visitor The callback to call for each node in the subtree. - * @param data An opaque pointer that is passed to the visitor callback. - */ -PRISM_EXPORTED_FUNCTION void pm_visit_node(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data); - -/** - * Visit the children of the given node with the given callback. This is the - * default behavior for walking the tree that is called from pm_visit_node if - * the callback returns true. - * - * @param node The node to visit the children of. - * @param visitor The callback to call for each child node. - * @param data An opaque pointer that is passed to the visitor callback. - */ -PRISM_EXPORTED_FUNCTION void pm_visit_child_nodes(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h deleted file mode 100644 index a623ae0..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h +++ /dev/null @@ -1,305 +0,0 @@ -/** - * @file options.h - * - * The options that can be passed to parsing. - */ -#ifndef PRISM_OPTIONS_H -#define PRISM_OPTIONS_H - -#include "prism/defines.h" -#include "prism/util/pm_string.h" - -#include -#include -#include - -/** - * String literals should be made frozen. - */ -#define PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED ((int8_t) -1) - -/** - * String literals may be frozen or mutable depending on the implementation - * default. - */ -#define PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET ((int8_t) 0) - -/** - * String literals should be made mutable. - */ -#define PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED ((int8_t) 1) - -/** - * A scope of locals surrounding the code that is being parsed. - */ -typedef struct pm_options_scope { - /** The number of locals in the scope. */ - size_t locals_count; - - /** The names of the locals in the scope. */ - pm_string_t *locals; -} pm_options_scope_t; - -/** - * The version of Ruby syntax that we should be parsing with. This is used to - * allow consumers to specify which behavior they want in case they need to - * parse in the same way as a specific version of CRuby would have. - */ -typedef enum { - /** The current version of prism. */ - PM_OPTIONS_VERSION_LATEST = 0, - - /** The vendored version of prism in CRuby 3.3.x. */ - PM_OPTIONS_VERSION_CRUBY_3_3 = 1 -} pm_options_version_t; - -/** - * The options that can be passed to the parser. - */ -typedef struct { - /** The name of the file that is currently being parsed. */ - pm_string_t filepath; - - /** - * The line within the file that the parse starts on. This value is - * 1-indexed. - */ - int32_t line; - - /** - * The name of the encoding that the source file is in. Note that this must - * correspond to a name that can be found with Encoding.find in Ruby. - */ - pm_string_t encoding; - - /** - * The number of scopes surrounding the code that is being parsed. - */ - size_t scopes_count; - - /** - * The scopes surrounding the code that is being parsed. For most parses - * this will be NULL, but for evals it will be the locals that are in scope - * surrounding the eval. Scopes are ordered from the outermost scope to the - * innermost one. - */ - pm_options_scope_t *scopes; - - /** - * The version of prism that we should be parsing with. This is used to - * allow consumers to specify which behavior they want in case they need to - * parse exactly as a specific version of CRuby. - */ - pm_options_version_t version; - - /** A bitset of the various options that were set on the command line. */ - uint8_t command_line; - - /** - * Whether or not the frozen string literal option has been set. - * May be: - * - PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET - */ - int8_t frozen_string_literal; -} pm_options_t; - -/** - * A bit representing whether or not the command line -a option was set. -a - * splits the input line $_ into $F. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_A = 0x1; - -/** - * A bit representing whether or not the command line -e option was set. -e - * allow the user to specify a script to be executed. This is necessary for - * prism to know because certain warnings are not generated when -e is used. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_E = 0x2; - -/** - * A bit representing whether or not the command line -l option was set. -l - * chomps the input line by default. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_L = 0x4; - -/** - * A bit representing whether or not the command line -n option was set. -n - * wraps the script in a while gets loop. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_N = 0x8; - -/** - * A bit representing whether or not the command line -p option was set. -p - * prints the value of $_ at the end of each loop. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_P = 0x10; - -/** - * A bit representing whether or not the command line -x option was set. -x - * searches the input file for a shebang that matches the current Ruby engine. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20; - -/** - * Set the filepath option on the given options struct. - * - * @param options The options struct to set the filepath on. - * @param filepath The filepath to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, const char *filepath); - -/** - * Set the line option on the given options struct. - * - * @param options The options struct to set the line on. - * @param line The line to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t line); - -/** - * Set the encoding option on the given options struct. - * - * @param options The options struct to set the encoding on. - * @param encoding The encoding to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, const char *encoding); - -/** - * Set the frozen string literal option on the given options struct. - * - * @param options The options struct to set the frozen string literal value on. - * @param frozen_string_literal The frozen string literal value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_literal); - -/** - * Sets the command line option on the given options struct. - * - * @param options The options struct to set the command line option on. - * @param command_line The command_line value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, uint8_t command_line); - -/** - * Set the version option on the given options struct by parsing the given - * string. If the string contains an invalid option, this returns false. - * Otherwise, it returns true. - * - * @param options The options struct to set the version on. - * @param version The version to set. - * @param length The length of the version string. - * @return Whether or not the version was parsed successfully. - */ -PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const char *version, size_t length); - -/** - * Allocate and zero out the scopes array on the given options struct. - * - * @param options The options struct to initialize the scopes array on. - * @param scopes_count The number of scopes to allocate. - * @return Whether or not the scopes array was initialized successfully. - */ -PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_t scopes_count); - -/** - * Return a pointer to the scope at the given index within the given options. - * - * @param options The options struct to get the scope from. - * @param index The index of the scope to get. - * @return A pointer to the scope at the given index. - */ -PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm_options_t *options, size_t index); - -/** - * Create a new options scope struct. This will hold a set of locals that are in - * scope surrounding the code that is being parsed. - * - * @param scope The scope struct to initialize. - * @param locals_count The number of locals to allocate. - * @return Whether or not the scope was initialized successfully. - */ -PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, size_t locals_count); - -/** - * Return a pointer to the local at the given index within the given scope. - * - * @param scope The scope struct to get the local from. - * @param index The index of the local to get. - * @return A pointer to the local at the given index. - */ -PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_options_scope_t *scope, size_t index); - -/** - * Free the internal memory associated with the options. - * - * @param options The options struct whose internal memory should be freed. - */ -PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options); - -/** - * Deserialize an options struct from the given binary string. This is used to - * pass options to the parser from an FFI call so that consumers of the library - * from an FFI perspective don't have to worry about the structure of our - * options structs. Since the source of these calls will be from Ruby - * implementation internals we assume it is from a trusted source. - * - * `data` is assumed to be a valid pointer pointing to well-formed data. The - * layout of this data should be the same every time, and is described below: - * - * | # bytes | field | - * | ------- | -------------------------- | - * | `4` | the length of the filepath | - * | ... | the filepath bytes | - * | `4` | the line number | - * | `4` | the length the encoding | - * | ... | the encoding bytes | - * | `1` | frozen string literal | - * | `1` | -p command line option | - * | `1` | -n command line option | - * | `1` | -l command line option | - * | `1` | -a command line option | - * | `1` | the version | - * | `4` | the number of scopes | - * | ... | the scopes | - * - * The version field is an enum, so it should be one of the following values: - * - * | value | version | - * | ----- | ------------------------- | - * | `0` | use the latest version of prism | - * | `1` | use the version of prism that is vendored in CRuby 3.3.0 | - * - * Each scope is laid out as follows: - * - * | # bytes | field | - * | ------- | -------------------------- | - * | `4` | the number of locals | - * | ... | the locals | - * - * Each local is laid out as follows: - * - * | # bytes | field | - * | ------- | -------------------------- | - * | `4` | the length of the local | - * | ... | the local bytes | - * - * Some additional things to note about this layout: - * - * * The filepath can have a length of 0, in which case we'll consider it an - * empty string. - * * The line number should be 0-indexed. - * * The encoding can have a length of 0, in which case we'll use the default - * encoding (UTF-8). If it's not 0, it should correspond to a name of an - * encoding that can be passed to `Encoding.find` in Ruby. - * * The frozen string literal and suppress warnings fields are booleans, so - * their values should be either 0 or 1. - * * The number of scopes can be 0. - * - * @param options The options struct to deserialize into. - * @param data The binary string to deserialize from. - */ -void pm_options_read(pm_options_t *options, const char *data); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h deleted file mode 100644 index 0b0b4b1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @file pack.h - * - * A pack template string parser. - */ -#ifndef PRISM_PACK_H -#define PRISM_PACK_H - -#include "prism/defines.h" - -// We optionally support parsing String#pack templates. For systems that don't -// want or need this functionality, it can be turned off with the -// PRISM_EXCLUDE_PACK define. -#ifdef PRISM_EXCLUDE_PACK - -void pm_pack_parse(void); - -#else - -#include -#include - -/** The version of the pack template language that we are parsing. */ -typedef enum pm_pack_version { - PM_PACK_VERSION_3_2_0 -} pm_pack_version; - -/** The type of pack template we are parsing. */ -typedef enum pm_pack_variant { - PM_PACK_VARIANT_PACK, - PM_PACK_VARIANT_UNPACK -} pm_pack_variant; - -/** A directive within the pack template. */ -typedef enum pm_pack_type { - PM_PACK_SPACE, - PM_PACK_COMMENT, - PM_PACK_INTEGER, - PM_PACK_UTF8, - PM_PACK_BER, - PM_PACK_FLOAT, - PM_PACK_STRING_SPACE_PADDED, - PM_PACK_STRING_NULL_PADDED, - PM_PACK_STRING_NULL_TERMINATED, - PM_PACK_STRING_MSB, - PM_PACK_STRING_LSB, - PM_PACK_STRING_HEX_HIGH, - PM_PACK_STRING_HEX_LOW, - PM_PACK_STRING_UU, - PM_PACK_STRING_MIME, - PM_PACK_STRING_BASE64, - PM_PACK_STRING_FIXED, - PM_PACK_STRING_POINTER, - PM_PACK_MOVE, - PM_PACK_BACK, - PM_PACK_NULL, - PM_PACK_END -} pm_pack_type; - -/** The signness of a pack directive. */ -typedef enum pm_pack_signed { - PM_PACK_UNSIGNED, - PM_PACK_SIGNED, - PM_PACK_SIGNED_NA -} pm_pack_signed; - -/** The endianness of a pack directive. */ -typedef enum pm_pack_endian { - PM_PACK_AGNOSTIC_ENDIAN, - PM_PACK_LITTLE_ENDIAN, // aka 'VAX', or 'V' - PM_PACK_BIG_ENDIAN, // aka 'network', or 'N' - PM_PACK_NATIVE_ENDIAN, - PM_PACK_ENDIAN_NA -} pm_pack_endian; - -/** The size of an integer pack directive. */ -typedef enum pm_pack_size { - PM_PACK_SIZE_SHORT, - PM_PACK_SIZE_INT, - PM_PACK_SIZE_LONG, - PM_PACK_SIZE_LONG_LONG, - PM_PACK_SIZE_8, - PM_PACK_SIZE_16, - PM_PACK_SIZE_32, - PM_PACK_SIZE_64, - PM_PACK_SIZE_P, - PM_PACK_SIZE_NA -} pm_pack_size; - -/** The type of length of a pack directive. */ -typedef enum pm_pack_length_type { - PM_PACK_LENGTH_FIXED, - PM_PACK_LENGTH_MAX, - PM_PACK_LENGTH_RELATIVE, // special case for unpack @* - PM_PACK_LENGTH_NA -} pm_pack_length_type; - -/** The type of encoding for a pack template string. */ -typedef enum pm_pack_encoding { - PM_PACK_ENCODING_START, - PM_PACK_ENCODING_ASCII_8BIT, - PM_PACK_ENCODING_US_ASCII, - PM_PACK_ENCODING_UTF_8 -} pm_pack_encoding; - -/** The result of parsing a pack template. */ -typedef enum pm_pack_result { - PM_PACK_OK, - PM_PACK_ERROR_UNSUPPORTED_DIRECTIVE, - PM_PACK_ERROR_UNKNOWN_DIRECTIVE, - PM_PACK_ERROR_LENGTH_TOO_BIG, - PM_PACK_ERROR_BANG_NOT_ALLOWED, - PM_PACK_ERROR_DOUBLE_ENDIAN -} pm_pack_result; - -/** - * Parse a single directive from a pack or unpack format string. - * - * @param variant (in) pack or unpack - * @param format (in, out) the start of the next directive to parse on calling, - * and advanced beyond the parsed directive on return, or as much of it as - * was consumed until an error was encountered - * @param format_end (in) the end of the format string - * @param type (out) the type of the directive - * @param signed_type (out) whether the value is signed - * @param endian (out) the endianness of the value - * @param size (out) the size of the value - * @param length_type (out) what kind of length is specified - * @param length (out) the length of the directive - * @param encoding (in, out) takes the current encoding of the string which - * would result from parsing the whole format string, and returns a possibly - * changed directive - the encoding should be `PM_PACK_ENCODING_START` when - * pm_pack_parse is called for the first directive in a format string - * - * @return `PM_PACK_OK` on success or `PM_PACK_ERROR_*` on error - * @note Consult Ruby documentation for the meaning of directives. - */ -PRISM_EXPORTED_FUNCTION pm_pack_result -pm_pack_parse( - pm_pack_variant variant, - const char **format, - const char *format_end, - pm_pack_type *type, - pm_pack_signed *signed_type, - pm_pack_endian *endian, - pm_pack_size *size, - pm_pack_length_type *length_type, - uint64_t *length, - pm_pack_encoding *encoding -); - -/** - * Prism abstracts sizes away from the native system - this converts an abstract - * size to a native size. - * - * @param size The abstract size to convert. - * @return The native size. - */ -PRISM_EXPORTED_FUNCTION size_t pm_size_to_native(pm_pack_size size); - -#endif - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h deleted file mode 100644 index 8054e33..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h +++ /dev/null @@ -1,891 +0,0 @@ -/** - * @file parser.h - * - * The parser used to parse Ruby source. - */ -#ifndef PRISM_PARSER_H -#define PRISM_PARSER_H - -#include "prism/defines.h" -#include "prism/ast.h" -#include "prism/encoding.h" -#include "prism/options.h" -#include "prism/static_literals.h" -#include "prism/util/pm_constant_pool.h" -#include "prism/util/pm_list.h" -#include "prism/util/pm_newline_list.h" -#include "prism/util/pm_string.h" - -#include - -/** - * This enum provides various bits that represent different kinds of states that - * the lexer can track. This is used to determine which kind of token to return - * based on the context of the parser. - */ -typedef enum { - PM_LEX_STATE_BIT_BEG, - PM_LEX_STATE_BIT_END, - PM_LEX_STATE_BIT_ENDARG, - PM_LEX_STATE_BIT_ENDFN, - PM_LEX_STATE_BIT_ARG, - PM_LEX_STATE_BIT_CMDARG, - PM_LEX_STATE_BIT_MID, - PM_LEX_STATE_BIT_FNAME, - PM_LEX_STATE_BIT_DOT, - PM_LEX_STATE_BIT_CLASS, - PM_LEX_STATE_BIT_LABEL, - PM_LEX_STATE_BIT_LABELED, - PM_LEX_STATE_BIT_FITEM -} pm_lex_state_bit_t; - -/** - * This enum combines the various bits from the above enum into individual - * values that represent the various states of the lexer. - */ -typedef enum { - PM_LEX_STATE_NONE = 0, - PM_LEX_STATE_BEG = (1 << PM_LEX_STATE_BIT_BEG), - PM_LEX_STATE_END = (1 << PM_LEX_STATE_BIT_END), - PM_LEX_STATE_ENDARG = (1 << PM_LEX_STATE_BIT_ENDARG), - PM_LEX_STATE_ENDFN = (1 << PM_LEX_STATE_BIT_ENDFN), - PM_LEX_STATE_ARG = (1 << PM_LEX_STATE_BIT_ARG), - PM_LEX_STATE_CMDARG = (1 << PM_LEX_STATE_BIT_CMDARG), - PM_LEX_STATE_MID = (1 << PM_LEX_STATE_BIT_MID), - PM_LEX_STATE_FNAME = (1 << PM_LEX_STATE_BIT_FNAME), - PM_LEX_STATE_DOT = (1 << PM_LEX_STATE_BIT_DOT), - PM_LEX_STATE_CLASS = (1 << PM_LEX_STATE_BIT_CLASS), - PM_LEX_STATE_LABEL = (1 << PM_LEX_STATE_BIT_LABEL), - PM_LEX_STATE_LABELED = (1 << PM_LEX_STATE_BIT_LABELED), - PM_LEX_STATE_FITEM = (1 << PM_LEX_STATE_BIT_FITEM), - PM_LEX_STATE_BEG_ANY = PM_LEX_STATE_BEG | PM_LEX_STATE_MID | PM_LEX_STATE_CLASS, - PM_LEX_STATE_ARG_ANY = PM_LEX_STATE_ARG | PM_LEX_STATE_CMDARG, - PM_LEX_STATE_END_ANY = PM_LEX_STATE_END | PM_LEX_STATE_ENDARG | PM_LEX_STATE_ENDFN -} pm_lex_state_t; - -/** - * The type of quote that a heredoc uses. - */ -typedef enum { - PM_HEREDOC_QUOTE_NONE, - PM_HEREDOC_QUOTE_SINGLE = '\'', - PM_HEREDOC_QUOTE_DOUBLE = '"', - PM_HEREDOC_QUOTE_BACKTICK = '`', -} pm_heredoc_quote_t; - -/** - * The type of indentation that a heredoc uses. - */ -typedef enum { - PM_HEREDOC_INDENT_NONE, - PM_HEREDOC_INDENT_DASH, - PM_HEREDOC_INDENT_TILDE, -} pm_heredoc_indent_t; - -/** - * When lexing Ruby source, the lexer has a small amount of state to tell which - * kind of token it is currently lexing. For example, when we find the start of - * a string, the first token that we return is a TOKEN_STRING_BEGIN token. After - * that the lexer is now in the PM_LEX_STRING mode, and will return tokens that - * are found as part of a string. - */ -typedef struct pm_lex_mode { - /** The type of this lex mode. */ - enum { - /** This state is used when any given token is being lexed. */ - PM_LEX_DEFAULT, - - /** - * This state is used when we're lexing as normal but inside an embedded - * expression of a string. - */ - PM_LEX_EMBEXPR, - - /** - * This state is used when we're lexing a variable that is embedded - * directly inside of a string with the # shorthand. - */ - PM_LEX_EMBVAR, - - /** This state is used when you are inside the content of a heredoc. */ - PM_LEX_HEREDOC, - - /** - * This state is used when we are lexing a list of tokens, as in a %w - * word list literal or a %i symbol list literal. - */ - PM_LEX_LIST, - - /** - * This state is used when a regular expression has been begun and we - * are looking for the terminator. - */ - PM_LEX_REGEXP, - - /** - * This state is used when we are lexing a string or a string-like - * token, as in string content with either quote or an xstring. - */ - PM_LEX_STRING - } mode; - - /** The data associated with this type of lex mode. */ - union { - struct { - /** This keeps track of the nesting level of the list. */ - size_t nesting; - - /** Whether or not interpolation is allowed in this list. */ - bool interpolation; - - /** - * When lexing a list, it takes into account balancing the - * terminator if the terminator is one of (), [], {}, or <>. - */ - uint8_t incrementor; - - /** This is the terminator of the list literal. */ - uint8_t terminator; - - /** - * This is the character set that should be used to delimit the - * tokens within the list. - */ - uint8_t breakpoints[11]; - } list; - - struct { - /** - * This keeps track of the nesting level of the regular expression. - */ - size_t nesting; - - /** - * When lexing a regular expression, it takes into account balancing - * the terminator if the terminator is one of (), [], {}, or <>. - */ - uint8_t incrementor; - - /** This is the terminator of the regular expression. */ - uint8_t terminator; - - /** - * This is the character set that should be used to delimit the - * tokens within the regular expression. - */ - uint8_t breakpoints[7]; - } regexp; - - struct { - /** This keeps track of the nesting level of the string. */ - size_t nesting; - - /** Whether or not interpolation is allowed in this string. */ - bool interpolation; - - /** - * Whether or not at the end of the string we should allow a :, - * which would indicate this was a dynamic symbol instead of a - * string. - */ - bool label_allowed; - - /** - * When lexing a string, it takes into account balancing the - * terminator if the terminator is one of (), [], {}, or <>. - */ - uint8_t incrementor; - - /** - * This is the terminator of the string. It is typically either a - * single or double quote. - */ - uint8_t terminator; - - /** - * This is the character set that should be used to delimit the - * tokens within the string. - */ - uint8_t breakpoints[7]; - } string; - - struct { - /** A pointer to the start of the heredoc identifier. */ - const uint8_t *ident_start; - - /** The length of the heredoc identifier. */ - size_t ident_length; - - /** The type of quote that the heredoc uses. */ - pm_heredoc_quote_t quote; - - /** The type of indentation that the heredoc uses. */ - pm_heredoc_indent_t indent; - - /** - * This is the pointer to the character where lexing should resume - * once the heredoc has been completely processed. - */ - const uint8_t *next_start; - - /** - * This is used to track the amount of common whitespace on each - * line so that we know how much to dedent each line in the case of - * a tilde heredoc. - */ - size_t common_whitespace; - - /** True if the previous token ended with a line continuation. */ - bool line_continuation; - } heredoc; - } as; - - /** The previous lex state so that it knows how to pop. */ - struct pm_lex_mode *prev; -} pm_lex_mode_t; - -/** - * We pre-allocate a certain number of lex states in order to avoid having to - * call malloc too many times while parsing. You really shouldn't need more than - * this because you only really nest deeply when doing string interpolation. - */ -#define PM_LEX_STACK_SIZE 4 - -/** - * The parser used to parse Ruby source. - */ -typedef struct pm_parser pm_parser_t; - -/** - * While parsing, we keep track of a stack of contexts. This is helpful for - * error recovery so that we can pop back to a previous context when we hit a - * token that is understood by a parent context but not by the current context. - */ -typedef enum { - /** a null context, used for returning a value from a function */ - PM_CONTEXT_NONE = 0, - - /** a begin statement */ - PM_CONTEXT_BEGIN, - - /** an ensure statement with an explicit begin */ - PM_CONTEXT_BEGIN_ENSURE, - - /** a rescue else statement with an explicit begin */ - PM_CONTEXT_BEGIN_ELSE, - - /** a rescue statement with an explicit begin */ - PM_CONTEXT_BEGIN_RESCUE, - - /** expressions in block arguments using braces */ - PM_CONTEXT_BLOCK_BRACES, - - /** expressions in block arguments using do..end */ - PM_CONTEXT_BLOCK_KEYWORDS, - - /** an ensure statement within a do..end block */ - PM_CONTEXT_BLOCK_ENSURE, - - /** a rescue else statement within a do..end block */ - PM_CONTEXT_BLOCK_ELSE, - - /** a rescue statement within a do..end block */ - PM_CONTEXT_BLOCK_RESCUE, - - /** a case when statements */ - PM_CONTEXT_CASE_WHEN, - - /** a case in statements */ - PM_CONTEXT_CASE_IN, - - /** a class declaration */ - PM_CONTEXT_CLASS, - - /** an ensure statement within a class statement */ - PM_CONTEXT_CLASS_ENSURE, - - /** a rescue else statement within a class statement */ - PM_CONTEXT_CLASS_ELSE, - - /** a rescue statement within a class statement */ - PM_CONTEXT_CLASS_RESCUE, - - /** a method definition */ - PM_CONTEXT_DEF, - - /** an ensure statement within a method definition */ - PM_CONTEXT_DEF_ENSURE, - - /** a rescue else statement within a method definition */ - PM_CONTEXT_DEF_ELSE, - - /** a rescue statement within a method definition */ - PM_CONTEXT_DEF_RESCUE, - - /** a method definition's parameters */ - PM_CONTEXT_DEF_PARAMS, - - /** a defined? expression */ - PM_CONTEXT_DEFINED, - - /** a method definition's default parameter */ - PM_CONTEXT_DEFAULT_PARAMS, - - /** an else clause */ - PM_CONTEXT_ELSE, - - /** an elsif clause */ - PM_CONTEXT_ELSIF, - - /** an interpolated expression */ - PM_CONTEXT_EMBEXPR, - - /** a for loop */ - PM_CONTEXT_FOR, - - /** a for loop's index */ - PM_CONTEXT_FOR_INDEX, - - /** an if statement */ - PM_CONTEXT_IF, - - /** a lambda expression with braces */ - PM_CONTEXT_LAMBDA_BRACES, - - /** a lambda expression with do..end */ - PM_CONTEXT_LAMBDA_DO_END, - - /** an ensure statement within a lambda expression */ - PM_CONTEXT_LAMBDA_ENSURE, - - /** a rescue else statement within a lambda expression */ - PM_CONTEXT_LAMBDA_ELSE, - - /** a rescue statement within a lambda expression */ - PM_CONTEXT_LAMBDA_RESCUE, - - /** the top level context */ - PM_CONTEXT_MAIN, - - /** a module declaration */ - PM_CONTEXT_MODULE, - - /** an ensure statement within a module statement */ - PM_CONTEXT_MODULE_ENSURE, - - /** a rescue else statement within a module statement */ - PM_CONTEXT_MODULE_ELSE, - - /** a rescue statement within a module statement */ - PM_CONTEXT_MODULE_RESCUE, - - /** a parenthesized expression */ - PM_CONTEXT_PARENS, - - /** an END block */ - PM_CONTEXT_POSTEXE, - - /** a predicate inside an if/elsif/unless statement */ - PM_CONTEXT_PREDICATE, - - /** a BEGIN block */ - PM_CONTEXT_PREEXE, - - /** a modifier rescue clause */ - PM_CONTEXT_RESCUE_MODIFIER, - - /** a singleton class definition */ - PM_CONTEXT_SCLASS, - - /** an ensure statement with a singleton class */ - PM_CONTEXT_SCLASS_ENSURE, - - /** a rescue else statement with a singleton class */ - PM_CONTEXT_SCLASS_ELSE, - - /** a rescue statement with a singleton class */ - PM_CONTEXT_SCLASS_RESCUE, - - /** a ternary expression */ - PM_CONTEXT_TERNARY, - - /** an unless statement */ - PM_CONTEXT_UNLESS, - - /** an until statement */ - PM_CONTEXT_UNTIL, - - /** a while statement */ - PM_CONTEXT_WHILE, -} pm_context_t; - -/** This is a node in a linked list of contexts. */ -typedef struct pm_context_node { - /** The context that this node represents. */ - pm_context_t context; - - /** A pointer to the previous context in the linked list. */ - struct pm_context_node *prev; -} pm_context_node_t; - -/** This is the type of a comment that we've found while parsing. */ -typedef enum { - PM_COMMENT_INLINE, - PM_COMMENT_EMBDOC -} pm_comment_type_t; - -/** - * This is a node in the linked list of comments that we've found while parsing. - * - * @extends pm_list_node_t - */ -typedef struct pm_comment { - /** The embedded base node. */ - pm_list_node_t node; - - /** The location of the comment in the source. */ - pm_location_t location; - - /** The type of comment that we've found. */ - pm_comment_type_t type; -} pm_comment_t; - -/** - * This is a node in the linked list of magic comments that we've found while - * parsing. - * - * @extends pm_list_node_t - */ -typedef struct { - /** The embedded base node. */ - pm_list_node_t node; - - /** A pointer to the start of the key in the source. */ - const uint8_t *key_start; - - /** A pointer to the start of the value in the source. */ - const uint8_t *value_start; - - /** The length of the key in the source. */ - uint32_t key_length; - - /** The length of the value in the source. */ - uint32_t value_length; -} pm_magic_comment_t; - -/** - * When the encoding that is being used to parse the source is changed by prism, - * we provide the ability here to call out to a user-defined function. - */ -typedef void (*pm_encoding_changed_callback_t)(pm_parser_t *parser); - -/** - * When you are lexing through a file, the lexer needs all of the information - * that the parser additionally provides (for example, the local table). So if - * you want to properly lex Ruby, you need to actually lex it in the context of - * the parser. In order to provide this functionality, we optionally allow a - * struct to be attached to the parser that calls back out to a user-provided - * callback when each token is lexed. - */ -typedef struct { - /** - * This opaque pointer is used to provide whatever information the user - * deemed necessary to the callback. In our case we use it to pass the array - * that the tokens get appended into. - */ - void *data; - - /** - * This is the callback that is called when a token is lexed. It is passed - * the opaque data pointer, the parser, and the token that was lexed. - */ - void (*callback)(void *data, pm_parser_t *parser, pm_token_t *token); -} pm_lex_callback_t; - -/** The type of shareable constant value that can be set. */ -typedef uint8_t pm_shareable_constant_value_t; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_NONE = 0x0; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_LITERAL = 0x1; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_EVERYTHING = 0x2; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_COPY = 0x4; - -/** - * This tracks an individual local variable in a certain lexical context, as - * well as the number of times is it read. - */ -typedef struct { - /** The name of the local variable. */ - pm_constant_id_t name; - - /** The location of the local variable in the source. */ - pm_location_t location; - - /** The index of the local variable in the local table. */ - uint32_t index; - - /** The number of times the local variable is read. */ - uint32_t reads; - - /** The hash of the local variable. */ - uint32_t hash; -} pm_local_t; - -/** - * This is a set of local variables in a certain lexical context (method, class, - * module, etc.). We need to track how many times these variables are read in - * order to warn if they only get written. - */ -typedef struct pm_locals { - /** The number of local variables in the set. */ - uint32_t size; - - /** The capacity of the local variables set. */ - uint32_t capacity; - - /** The nullable allocated memory for the local variables in the set. */ - pm_local_t *locals; -} pm_locals_t; - -/** - * This struct represents a node in a linked list of scopes. Some scopes can see - * into their parent scopes, while others cannot. - */ -typedef struct pm_scope { - /** A pointer to the previous scope in the linked list. */ - struct pm_scope *previous; - - /** The IDs of the locals in the given scope. */ - pm_locals_t locals; - - /** - * This is a bitfield that indicates the parameters that are being used in - * this scope. It is a combination of the PM_SCOPE_PARAMS_* constants. There - * are three different kinds of parameters that can be used in a scope: - * - * - Ordinary parameters (e.g., def foo(bar); end) - * - Numbered parameters (e.g., def foo; _1; end) - * - The it parameter (e.g., def foo; it; end) - * - * If ordinary parameters are being used, then certain parameters can be - * forwarded to another method/structure. Those are indicated by four - * additional bits in the params field. For example, some combinations of: - * - * - def foo(*); end - * - def foo(**); end - * - def foo(&); end - * - def foo(...); end - */ - uint8_t parameters; - - /** - * An integer indicating the number of numbered parameters on this scope. - * This is necessary to determine if child blocks are allowed to use - * numbered parameters, and to pass information to consumers of the AST - * about how many numbered parameters exist. - */ - int8_t numbered_parameters; - - /** - * The current state of constant shareability for this scope. This is - * changed by magic shareable_constant_value comments. - */ - pm_shareable_constant_value_t shareable_constant; - - /** - * A boolean indicating whether or not this scope can see into its parent. - * If closed is true, then the scope cannot see into its parent. - */ - bool closed; -} pm_scope_t; - -static const uint8_t PM_SCOPE_PARAMETERS_NONE = 0x0; -static const uint8_t PM_SCOPE_PARAMETERS_ORDINARY = 0x1; -static const uint8_t PM_SCOPE_PARAMETERS_NUMBERED = 0x2; -static const uint8_t PM_SCOPE_PARAMETERS_IT = 0x4; -static const uint8_t PM_SCOPE_PARAMETERS_TYPE_MASK = 0x7; - -static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS = 0x8; -static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_KEYWORDS = 0x10; -static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_BLOCK = 0x20; -static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_ALL = 0x40; - -static const int8_t PM_SCOPE_NUMBERED_PARAMETERS_DISALLOWED = -1; -static const int8_t PM_SCOPE_NUMBERED_PARAMETERS_NONE = 0; - -/** - * A struct that represents a stack of boolean values. - */ -typedef uint32_t pm_state_stack_t; - -/** - * This struct represents the overall parser. It contains a reference to the - * source file, as well as pointers that indicate where in the source it's - * currently parsing. It also contains the most recent and current token that - * it's considering. - */ -struct pm_parser { - /** The current state of the lexer. */ - pm_lex_state_t lex_state; - - /** Tracks the current nesting of (), [], and {}. */ - int enclosure_nesting; - - /** - * Used to temporarily track the nesting of enclosures to determine if a { - * is the beginning of a lambda following the parameters of a lambda. - */ - int lambda_enclosure_nesting; - - /** - * Used to track the nesting of braces to ensure we get the correct value - * when we are interpolating blocks with braces. - */ - int brace_nesting; - - /** - * The stack used to determine if a do keyword belongs to the predicate of a - * while, until, or for loop. - */ - pm_state_stack_t do_loop_stack; - - /** - * The stack used to determine if a do keyword belongs to the beginning of a - * block. - */ - pm_state_stack_t accepts_block_stack; - - /** A stack of lex modes. */ - struct { - /** The current mode of the lexer. */ - pm_lex_mode_t *current; - - /** The stack of lexer modes. */ - pm_lex_mode_t stack[PM_LEX_STACK_SIZE]; - - /** The current index into the lexer mode stack. */ - size_t index; - } lex_modes; - - /** The pointer to the start of the source. */ - const uint8_t *start; - - /** The pointer to the end of the source. */ - const uint8_t *end; - - /** The previous token we were considering. */ - pm_token_t previous; - - /** The current token we're considering. */ - pm_token_t current; - - /** - * This is a special field set on the parser when we need the parser to jump - * to a specific location when lexing the next token, as opposed to just - * using the end of the previous token. Normally this is NULL. - */ - const uint8_t *next_start; - - /** - * This field indicates the end of a heredoc whose identifier was found on - * the current line. If another heredoc is found on the same line, then this - * will be moved forward to the end of that heredoc. If no heredocs are - * found on a line then this is NULL. - */ - const uint8_t *heredoc_end; - - /** The list of comments that have been found while parsing. */ - pm_list_t comment_list; - - /** The list of magic comments that have been found while parsing. */ - pm_list_t magic_comment_list; - - /** - * An optional location that represents the location of the __END__ marker - * and the rest of the content of the file. This content is loaded into the - * DATA constant when the file being parsed is the main file being executed. - */ - pm_location_t data_loc; - - /** The list of warnings that have been found while parsing. */ - pm_list_t warning_list; - - /** The list of errors that have been found while parsing. */ - pm_list_t error_list; - - /** The current local scope. */ - pm_scope_t *current_scope; - - /** The current parsing context. */ - pm_context_node_t *current_context; - - /** - * The hash keys for the hash that is currently being parsed. This is not - * usually necessary because it can pass it down the various call chains, - * but in the event that you're parsing a hash that is being directly - * pushed into another hash with **, we need to share the hash keys so that - * we can warn for the nested hash as well. - */ - pm_static_literals_t *current_hash_keys; - - /** - * The encoding functions for the current file is attached to the parser as - * it's parsing so that it can change with a magic comment. - */ - const pm_encoding_t *encoding; - - /** - * When the encoding that is being used to parse the source is changed by - * prism, we provide the ability here to call out to a user-defined - * function. - */ - pm_encoding_changed_callback_t encoding_changed_callback; - - /** - * This pointer indicates where a comment must start if it is to be - * considered an encoding comment. - */ - const uint8_t *encoding_comment_start; - - /** - * This is an optional callback that can be attached to the parser that will - * be called whenever a new token is lexed by the parser. - */ - pm_lex_callback_t *lex_callback; - - /** - * This is the path of the file being parsed. We use the filepath when - * constructing SourceFileNodes. - */ - pm_string_t filepath; - - /** - * This constant pool keeps all of the constants defined throughout the file - * so that we can reference them later. - */ - pm_constant_pool_t constant_pool; - - /** This is the list of newline offsets in the source file. */ - pm_newline_list_t newline_list; - - /** - * We want to add a flag to integer nodes that indicates their base. We only - * want to parse these once, but we don't have space on the token itself to - * communicate this information. So we store it here and pass it through - * when we find tokens that we need it for. - */ - pm_node_flags_t integer_base; - - /** - * This string is used to pass information from the lexer to the parser. It - * is particularly necessary because of escape sequences. - */ - pm_string_t current_string; - - /** - * The line number at the start of the parse. This will be used to offset - * the line numbers of all of the locations. - */ - int32_t start_line; - - /** - * When a string-like expression is being lexed, any byte or escape sequence - * that resolves to a value whose top bit is set (i.e., >= 0x80) will - * explicitly set the encoding to the same encoding as the source. - * Alternatively, if a unicode escape sequence is used (e.g., \\u{80}) that - * resolves to a value whose top bit is set, then the encoding will be - * explicitly set to UTF-8. - * - * The _next_ time this happens, if the encoding that is about to become the - * explicitly set encoding does not match the previously set explicit - * encoding, a mixed encoding error will be emitted. - * - * When the expression is finished being lexed, the explicit encoding - * controls the encoding of the expression. For the most part this means - * that the expression will either be encoded in the source encoding or - * UTF-8. This holds for all encodings except US-ASCII. If the source is - * US-ASCII and an explicit encoding was set that was _not_ UTF-8, then the - * expression will be encoded as ASCII-8BIT. - * - * Note that if the expression is a list, different elements within the same - * list can have different encodings, so this will get reset between each - * element. Furthermore all of this only applies to lists that support - * interpolation, because otherwise escapes that could change the encoding - * are ignored. - * - * At first glance, it may make more sense for this to live on the lexer - * mode, but we need it here to communicate back to the parser for character - * literals that do not push a new lexer mode. - */ - const pm_encoding_t *explicit_encoding; - - /** - * When parsing block exits (e.g., break, next, redo), we need to validate - * that they are in correct contexts. For the most part we can do this by - * looking at our parent contexts. However, modifier while and until - * expressions can change that context to make block exits valid. In these - * cases, we need to keep track of the block exits and then validate them - * after the expression has been parsed. - * - * We use a pointer here because we don't want to keep a whole list attached - * since this will only be used in the context of begin/end expressions. - */ - pm_node_list_t *current_block_exits; - - /** The version of prism that we should use to parse. */ - pm_options_version_t version; - - /** The command line flags given from the options. */ - uint8_t command_line; - - /** - * Whether or not we have found a frozen_string_literal magic comment with - * a true or false value. - * May be: - * - PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET - */ - int8_t frozen_string_literal; - - /** - * Whether or not we are parsing an eval string. This impacts whether or not - * we should evaluate if block exits/yields are valid. - */ - bool parsing_eval; - - /** Whether or not we're at the beginning of a command. */ - bool command_start; - - /** Whether or not we're currently recovering from a syntax error. */ - bool recovering; - - /** - * Whether or not the encoding has been changed by a magic comment. We use - * this to provide a fast path for the lexer instead of going through the - * function pointer. - */ - bool encoding_changed; - - /** - * This flag indicates that we are currently parsing a pattern matching - * expression and impacts that calculation of newlines. - */ - bool pattern_matching_newlines; - - /** This flag indicates that we are currently parsing a keyword argument. */ - bool in_keyword_arg; - - /** - * Whether or not the parser has seen a token that has semantic meaning - * (i.e., a token that is not a comment or whitespace). - */ - bool semantic_token_seen; - - /** - * True if the current regular expression being lexed contains only ASCII - * characters. - */ - bool current_regular_expression_ascii_only; -}; - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h deleted file mode 100644 index 5a52b2b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file prettyprint.h - * - * An AST node pretty-printer. - */ -#ifndef PRISM_PRETTYPRINT_H -#define PRISM_PRETTYPRINT_H - -#include "prism/defines.h" - -#ifdef PRISM_EXCLUDE_PRETTYPRINT - -void pm_prettyprint(void); - -#else - -#include - -#include "prism/ast.h" -#include "prism/parser.h" -#include "prism/util/pm_buffer.h" - -/** - * Pretty-prints the AST represented by the given node to the given buffer. - * - * @param output_buffer The buffer to write the pretty-printed AST to. - * @param parser The parser that parsed the AST. - * @param node The root node of the AST to pretty-print. - */ -PRISM_EXPORTED_FUNCTION void pm_prettyprint(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_node_t *node); - -#endif - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h deleted file mode 100644 index 59067c3..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h +++ /dev/null @@ -1,347 +0,0 @@ -/** - * @file prism.h - * - * The main header file for the prism parser. - */ -#ifndef PRISM_H -#define PRISM_H - -#include "prism/defines.h" -#include "prism/util/pm_buffer.h" -#include "prism/util/pm_char.h" -#include "prism/util/pm_integer.h" -#include "prism/util/pm_memchr.h" -#include "prism/util/pm_strncasecmp.h" -#include "prism/util/pm_strpbrk.h" -#include "prism/ast.h" -#include "prism/diagnostic.h" -#include "prism/node.h" -#include "prism/options.h" -#include "prism/pack.h" -#include "prism/parser.h" -#include "prism/prettyprint.h" -#include "prism/regexp.h" -#include "prism/static_literals.h" -#include "prism/version.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef _WIN32 -#include -#endif - -/** - * The prism version and the serialization format. - * - * @returns The prism version as a constant string. - */ -PRISM_EXPORTED_FUNCTION const char * pm_version(void); - -/** - * Initialize a parser with the given start and end pointers. - * - * @param parser The parser to initialize. - * @param source The source to parse. - * @param size The size of the source. - * @param options The optional options to use when parsing. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options); - -/** - * Register a callback that will be called whenever prism changes the encoding - * it is using to parse based on the magic comment. - * - * @param parser The parser to register the callback with. - * @param callback The callback to register. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback); - -/** - * Free any memory associated with the given parser. - * - * @param parser The parser to free. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); - -/** - * Initiate the parser with the given parser. - * - * @param parser The parser to use. - * @return The AST representing the source. - */ -PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser); - -/** - * This function is used in pm_parse_stream to retrieve a line of input from a - * stream. It closely mirrors that of fgets so that fgets can be used as the - * default implementation. - */ -typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream); - -/** - * Parse a stream of Ruby source and return the tree. - * - * @param parser The parser to use. - * @param buffer The buffer to use. - * @param stream The stream to parse. - * @param fgets The function to use to read from the stream. - * @param options The optional options to use when parsing. - * @return The AST representing the source. - */ -PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const pm_options_t *options); - -// We optionally support serializing to a binary string. For systems that don't -// want or need this functionality, it can be turned off with the -// PRISM_EXCLUDE_SERIALIZATION define. -#ifndef PRISM_EXCLUDE_SERIALIZATION - -/** - * Parse and serialize the AST represented by the source that is read out of the - * given stream into to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param stream The stream to parse. - * @param fgets The function to use to read from the stream. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const char *data); - -/** - * Serialize the given list of comments to the given buffer. - * - * @param parser The parser to serialize. - * @param list The list of comments to serialize. - * @param buffer The buffer to serialize to. - */ -void pm_serialize_comment_list(pm_parser_t *parser, pm_list_t *list, pm_buffer_t *buffer); - -/** - * Serialize the name of the encoding to the buffer. - * - * @param encoding The encoding to serialize. - * @param buffer The buffer to serialize to. - */ -void pm_serialize_encoding(const pm_encoding_t *encoding, pm_buffer_t *buffer); - -/** - * Serialize the encoding, metadata, nodes, and constant pool. - * - * @param parser The parser to serialize. - * @param node The node to serialize. - * @param buffer The buffer to serialize to. - */ -void pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer); - -/** - * Serialize the AST represented by the given node to the given buffer. - * - * @param parser The parser to serialize. - * @param node The node to serialize. - * @param buffer The buffer to serialize to. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer); - -/** - * Parse the given source to the AST and dump the AST to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -/** - * Parse and serialize the comments in the given source to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -/** - * Lex the given source and serialize to the given buffer. - * - * @param source The source to lex. - * @param size The size of the source. - * @param buffer The buffer to serialize to. - * @param data The optional data to pass to the lexer. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -/** - * Parse and serialize both the AST and the tokens represented by the given - * source to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -#endif - -/** - * Parse the source and return true if it parses without errors or warnings. - * - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - * @return True if the source parses without errors or warnings. - */ -PRISM_EXPORTED_FUNCTION bool pm_parse_success_p(const uint8_t *source, size_t size, const char *data); - -/** - * Returns a string representation of the given token type. - * - * @param token_type The token type to convert to a string. - * @return A string representation of the given token type. - */ -PRISM_EXPORTED_FUNCTION const char * pm_token_type_name(pm_token_type_t token_type); - -/** - * Returns the human name of the given token type. - * - * @param token_type The token type to convert to a human name. - * @return The human name of the given token type. - */ -const char * pm_token_type_human(pm_token_type_t token_type); - -/** - * Format the errors on the parser into the given buffer. - * - * @param parser The parser to format the errors for. - * @param error_list The list of errors to format. - * @param buffer The buffer to format the errors into. - * @param colorize Whether or not to colorize the errors with ANSI escape sequences. - * @param inline_messages Whether or not to inline the messages with the source. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_errors_format(const pm_parser_t *parser, const pm_list_t *error_list, pm_buffer_t *buffer, bool colorize, bool inline_messages); - -// We optionally support dumping to JSON. For systems that don't want or need -// this functionality, it can be turned off with the PRISM_EXCLUDE_JSON define. -#ifndef PRISM_EXCLUDE_JSON - -/** - * Dump JSON to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param parser The parser that parsed the node. - * @param node The node to serialize. - */ -PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node); - -#endif - -/** - * @mainpage - * - * Prism is a parser for the Ruby programming language. It is designed to be - * portable, error tolerant, and maintainable. It is written in C99 and has no - * dependencies. It is currently being integrated into - * [CRuby](https://github.com/ruby/ruby), - * [JRuby](https://github.com/jruby/jruby), - * [TruffleRuby](https://github.com/oracle/truffleruby), - * [Sorbet](https://github.com/sorbet/sorbet), and - * [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree). - * - * @section getting-started Getting started - * - * If you're vendoring this project and compiling it statically then as long as - * you have a C99 compiler you will be fine. If you're linking against it as - * shared library, then you should compile with `-fvisibility=hidden` and - * `-DPRISM_EXPORT_SYMBOLS` to tell prism to make only its public interface - * visible. - * - * @section parsing Parsing - * - * In order to parse Ruby code, the structures and functions that you're going - * to want to use and be aware of are: - * - * * `pm_parser_t` - the main parser structure - * * `pm_parser_init` - initialize a parser - * * `pm_parse` - parse and return the root node - * * `pm_node_destroy` - deallocate the root node returned by `pm_parse` - * * `pm_parser_free` - free the internal memory of the parser - * - * Putting all of this together would look something like: - * - * ```c - * void parse(const uint8_t *source, size_t length) { - * pm_parser_t parser; - * pm_parser_init(&parser, source, length, NULL); - * - * pm_node_t *root = pm_parse(&parser); - * printf("PARSED!\n"); - * - * pm_node_destroy(&parser, root); - * pm_parser_free(&parser); - * } - * ``` - * - * All of the nodes "inherit" from `pm_node_t` by embedding those structures as - * their first member. This means you can downcast and upcast any node in the - * tree to a `pm_node_t`. - * - * @section serializing Serializing - * - * Prism provides the ability to serialize the AST and its related metadata into - * a binary format. This format is designed to be portable to different - * languages and runtimes so that you only need to make one FFI call in order to - * parse Ruby code. The structures and functions that you're going to want to - * use and be aware of are: - * - * * `pm_buffer_t` - a small buffer object that will hold the serialized AST - * * `pm_buffer_free` - free the memory associated with the buffer - * * `pm_serialize` - serialize the AST into a buffer - * * `pm_serialize_parse` - parse and serialize the AST into a buffer - * - * Putting all of this together would look something like: - * - * ```c - * void serialize(const uint8_t *source, size_t length) { - * pm_buffer_t buffer = { 0 }; - * - * pm_serialize_parse(&buffer, source, length, NULL); - * printf("SERIALIZED!\n"); - * - * pm_buffer_free(&buffer); - * } - * ``` - * - * @section inspecting Inspecting - * - * Prism provides the ability to inspect the AST by pretty-printing nodes. You - * can do this with the `pm_prettyprint` function, which you would use like: - * - * ```c - * void prettyprint(const uint8_t *source, size_t length) { - * pm_parser_t parser; - * pm_parser_init(&parser, source, length, NULL); - * - * pm_node_t *root = pm_parse(&parser); - * pm_buffer_t buffer = { 0 }; - * - * pm_prettyprint(&buffer, &parser, root); - * printf("%*.s\n", (int) buffer.length, buffer.value); - * - * pm_buffer_free(&buffer); - * pm_node_destroy(&parser, root); - * pm_parser_free(&parser); - * } - * ``` - */ - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h deleted file mode 100644 index c5ceab1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file regexp.h - * - * A regular expression parser. - */ -#ifndef PRISM_REGEXP_H -#define PRISM_REGEXP_H - -#include "prism/defines.h" -#include "prism/parser.h" -#include "prism/encoding.h" -#include "prism/util/pm_memchr.h" -#include "prism/util/pm_string_list.h" -#include "prism/util/pm_string.h" - -#include -#include -#include - -/** - * Parse a regular expression and extract the names of all of the named capture - * groups. - * - * @param source The source code to parse. - * @param size The size of the source code. - * @param named_captures The list to add the names of the named capture groups. - * @param encoding_changed Whether or not the encoding changed from the default. - * @param encoding The encoding of the source code. - * @return Whether or not the parsing was successful. - */ -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); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h deleted file mode 100644 index 7270605..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @file static_literals.h - * - * A set of static literal nodes that can be checked for duplicates. - */ -#ifndef PRISM_STATIC_LITERALS_H -#define PRISM_STATIC_LITERALS_H - -#include "prism/defines.h" -#include "prism/ast.h" -#include "prism/util/pm_newline_list.h" - -#include -#include - -/** - * An internal hash table for a set of nodes. - */ -typedef struct { - /** The array of nodes in the hash table. */ - pm_node_t **nodes; - - /** The size of the hash table. */ - uint32_t size; - - /** The space that has been allocated in the hash table. */ - uint32_t capacity; -} pm_node_hash_t; - -/** - * Certain sets of nodes (hash keys and when clauses) check for duplicate nodes - * to alert the user of potential issues. To do this, we keep a set of the nodes - * that have been seen so far, and compare whenever we find a new node. - * - * We bucket the nodes based on their type to minimize the number of comparisons - * that need to be performed. - */ -typedef struct { - /** - * This is the set of IntegerNode and SourceLineNode instances. - */ - pm_node_hash_t integer_nodes; - - /** - * This is the set of FloatNode instances. - */ - pm_node_hash_t float_nodes; - - /** - * This is the set of RationalNode and ImaginaryNode instances. - */ - pm_node_hash_t number_nodes; - - /** - * This is the set of StringNode and SourceFileNode instances. - */ - pm_node_hash_t string_nodes; - - /** - * This is the set of RegularExpressionNode instances. - */ - pm_node_hash_t regexp_nodes; - - /** - * This is the set of SymbolNode instances. - */ - pm_node_hash_t symbol_nodes; - - /** - * A pointer to the last TrueNode instance that was inserted, or NULL. - */ - pm_node_t *true_node; - - /** - * A pointer to the last FalseNode instance that was inserted, or NULL. - */ - pm_node_t *false_node; - - /** - * A pointer to the last NilNode instance that was inserted, or NULL. - */ - pm_node_t *nil_node; - - /** - * A pointer to the last SourceEncodingNode instance that was inserted, or - * NULL. - */ - pm_node_t *source_encoding_node; -} pm_static_literals_t; - -/** - * Add a node to the set of static literals. - * - * @param newline_list The list of newline offsets to use to calculate lines. - * @param start_line The line number that the parser starts on. - * @param literals The set of static literals to add the node to. - * @param node The node to add to the set. - * @return A pointer to the node that is being overwritten, if there is one. - */ -pm_node_t * pm_static_literals_add(const pm_newline_list_t *newline_list, int32_t start_line, pm_static_literals_t *literals, pm_node_t *node); - -/** - * Free the internal memory associated with the given static literals set. - * - * @param literals The set of static literals to free. - */ -void pm_static_literals_free(pm_static_literals_t *literals); - -/** - * Create a string-based representation of the given static literal. - * - * @param buffer The buffer to write the string to. - * @param newline_list The list of newline offsets to use to calculate lines. - * @param start_line The line number that the parser starts on. - * @param encoding_name The name of the encoding of the source being parsed. - * @param node The node to create a string representation of. - */ -PRISM_EXPORTED_FUNCTION void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_newline_list_t *newline_list, int32_t start_line, const char *encoding_name, const pm_node_t *node); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h deleted file mode 100644 index 58f7b50..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h +++ /dev/null @@ -1,218 +0,0 @@ -/** - * @file pm_buffer.h - * - * A wrapper around a contiguous block of allocated memory. - */ -#ifndef PRISM_BUFFER_H -#define PRISM_BUFFER_H - -#include "prism/defines.h" -#include "prism/util/pm_char.h" - -#include -#include -#include -#include -#include - -/** - * A pm_buffer_t is a simple memory buffer that stores data in a contiguous - * block of memory. - */ -typedef struct { - /** The length of the buffer in bytes. */ - size_t length; - - /** The capacity of the buffer in bytes that has been allocated. */ - size_t capacity; - - /** A pointer to the start of the buffer. */ - char *value; -} pm_buffer_t; - -/** - * Return the size of the pm_buffer_t struct. - * - * @returns The size of the pm_buffer_t struct. - */ -PRISM_EXPORTED_FUNCTION size_t pm_buffer_sizeof(void); - -/** - * Initialize a pm_buffer_t with the given capacity. - * - * @param buffer The buffer to initialize. - * @param capacity The capacity of the buffer. - * @returns True if the buffer was initialized successfully, false otherwise. - */ -bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity); - -/** - * Initialize a pm_buffer_t with its default values. - * - * @param buffer The buffer to initialize. - * @returns True if the buffer was initialized successfully, false otherwise. - */ -PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer); - -/** - * Return the value of the buffer. - * - * @param buffer The buffer to get the value of. - * @returns The value of the buffer. - */ -PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer); - -/** - * Return the length of the buffer. - * - * @param buffer The buffer to get the length of. - * @returns The length of the buffer. - */ -PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer); - -/** - * Append the given amount of space as zeroes to the buffer. - * - * @param buffer The buffer to append to. - * @param length The amount of space to append and zero. - */ -void pm_buffer_append_zeroes(pm_buffer_t *buffer, size_t length); - -/** - * Append a formatted string to the buffer. - * - * @param buffer The buffer to append to. - * @param format The format string to append. - * @param ... The arguments to the format string. - */ -void pm_buffer_append_format(pm_buffer_t *buffer, const char *format, ...) PRISM_ATTRIBUTE_FORMAT(2, 3); - -/** - * Append a string to the buffer. - * - * @param buffer The buffer to append to. - * @param value The string to append. - * @param length The length of the string to append. - */ -void pm_buffer_append_string(pm_buffer_t *buffer, const char *value, size_t length); - -/** - * Append a list of bytes to the buffer. - * - * @param buffer The buffer to append to. - * @param value The bytes to append. - * @param length The length of the bytes to append. - */ -void pm_buffer_append_bytes(pm_buffer_t *buffer, const uint8_t *value, size_t length); - -/** - * Append a single byte to the buffer. - * - * @param buffer The buffer to append to. - * @param value The byte to append. - */ -void pm_buffer_append_byte(pm_buffer_t *buffer, uint8_t value); - -/** - * Append a 32-bit unsigned integer to the buffer as a variable-length integer. - * - * @param buffer The buffer to append to. - * @param value The integer to append. - */ -void pm_buffer_append_varuint(pm_buffer_t *buffer, uint32_t value); - -/** - * Append a 32-bit signed integer to the buffer as a variable-length integer. - * - * @param buffer The buffer to append to. - * @param value The integer to append. - */ -void pm_buffer_append_varsint(pm_buffer_t *buffer, int32_t value); - -/** - * Append a double to the buffer. - * - * @param buffer The buffer to append to. - * @param value The double to append. - */ -void pm_buffer_append_double(pm_buffer_t *buffer, double value); - -/** - * The different types of escaping that can be performed by the buffer when - * appending a slice of Ruby source code. - */ -typedef enum { - PM_BUFFER_ESCAPING_RUBY, - PM_BUFFER_ESCAPING_JSON -} pm_buffer_escaping_t; - -/** - * Append a slice of source code to the buffer. - * - * @param buffer The buffer to append to. - * @param source The source code to append. - * @param length The length of the source code to append. - * @param escaping The type of escaping to perform. - */ -void pm_buffer_append_source(pm_buffer_t *buffer, const uint8_t *source, size_t length, pm_buffer_escaping_t escaping); - -/** - * Prepend the given string to the buffer. - * - * @param buffer The buffer to prepend to. - * @param value The string to prepend. - * @param length The length of the string to prepend. - */ -void pm_buffer_prepend_string(pm_buffer_t *buffer, const char *value, size_t length); - -/** - * Concatenate one buffer onto another. - * - * @param destination The buffer to concatenate onto. - * @param source The buffer to concatenate. - */ -void pm_buffer_concat(pm_buffer_t *destination, const pm_buffer_t *source); - -/** - * Clear the buffer by reducing its size to 0. This does not free the allocated - * memory, but it does allow the buffer to be reused. - * - * @param buffer The buffer to clear. - */ -void pm_buffer_clear(pm_buffer_t *buffer); - -/** - * Strip the whitespace from the end of the buffer. - * - * @param buffer The buffer to strip. - */ -void pm_buffer_rstrip(pm_buffer_t *buffer); - -/** - * Checks if the buffer includes the given value. - * - * @param buffer The buffer to check. - * @param value The value to check for. - * @returns The index of the first occurrence of the value in the buffer, or - * SIZE_MAX if the value is not found. - */ -size_t pm_buffer_index(const pm_buffer_t *buffer, char value); - -/** - * Insert the given string into the buffer at the given index. - * - * @param buffer The buffer to insert into. - * @param index The index to insert at. - * @param value The string to insert. - * @param length The length of the string to insert. - */ -void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size_t length); - -/** - * Free the memory associated with the buffer. - * - * @param buffer The buffer to free. - */ -PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h deleted file mode 100644 index 32f698a..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h +++ /dev/null @@ -1,205 +0,0 @@ -/** - * @file pm_char.h - * - * Functions for working with characters and strings. - */ -#ifndef PRISM_CHAR_H -#define PRISM_CHAR_H - -#include "prism/defines.h" -#include "prism/util/pm_newline_list.h" - -#include -#include - -/** - * Returns the number of characters at the start of the string that are - * whitespace. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are - * whitespace. - */ -size_t pm_strspn_whitespace(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are - * whitespace while also tracking the location of each newline. Disallows - * searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param newline_list The list of newlines to populate. - * @return The number of characters at the start of the string that are - * whitespace. - */ -size_t -pm_strspn_whitespace_newlines(const uint8_t *string, ptrdiff_t length, pm_newline_list_t *newline_list); - -/** - * Returns the number of characters at the start of the string that are inline - * whitespace. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are inline - * whitespace. - */ -size_t pm_strspn_inline_whitespace(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are decimal - * digits. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are decimal - * digits. - */ -size_t pm_strspn_decimal_digit(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are - * hexadecimal digits. Disallows searching past the given maximum number of - * characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are - * hexadecimal digits. - */ -size_t pm_strspn_hexadecimal_digit(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are octal - * digits or underscores. Disallows searching past the given maximum number of - * characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are octal - * digits or underscores. - */ -size_t pm_strspn_octal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns the number of characters at the start of the string that are decimal - * digits or underscores. Disallows searching past the given maximum number of - * characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are decimal - * digits or underscores. - */ -size_t pm_strspn_decimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns the number of characters at the start of the string that are - * hexadecimal digits or underscores. Disallows searching past the given maximum - * number of characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are - * hexadecimal digits or underscores. - */ -size_t pm_strspn_hexadecimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns the number of characters at the start of the string that are regexp - * options. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are regexp - * options. - */ -size_t pm_strspn_regexp_option(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are binary - * digits or underscores. Disallows searching past the given maximum number of - * characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are binary - * digits or underscores. - */ -size_t pm_strspn_binary_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns true if the given character is a whitespace character. - * - * @param b The character to check. - * @return True if the given character is a whitespace character. - */ -bool pm_char_is_whitespace(const uint8_t b); - -/** - * Returns true if the given character is an inline whitespace character. - * - * @param b The character to check. - * @return True if the given character is an inline whitespace character. - */ -bool pm_char_is_inline_whitespace(const uint8_t b); - -/** - * Returns true if the given character is a binary digit. - * - * @param b The character to check. - * @return True if the given character is a binary digit. - */ -bool pm_char_is_binary_digit(const uint8_t b); - -/** - * Returns true if the given character is an octal digit. - * - * @param b The character to check. - * @return True if the given character is an octal digit. - */ -bool pm_char_is_octal_digit(const uint8_t b); - -/** - * Returns true if the given character is a decimal digit. - * - * @param b The character to check. - * @return True if the given character is a decimal digit. - */ -bool pm_char_is_decimal_digit(const uint8_t b); - -/** - * Returns true if the given character is a hexadecimal digit. - * - * @param b The character to check. - * @return True if the given character is a hexadecimal digit. - */ -bool pm_char_is_hexadecimal_digit(const uint8_t b); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h deleted file mode 100644 index 0fe1685..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h +++ /dev/null @@ -1,226 +0,0 @@ -/** - * @file pm_constant_pool.h - * - * A data structure that stores a set of strings. - * - * Each string is assigned a unique id, which can be used to compare strings for - * equality. This comparison ends up being much faster than strcmp, since it - * only requires a single integer comparison. - */ -#ifndef PRISM_CONSTANT_POOL_H -#define PRISM_CONSTANT_POOL_H - -#include "prism/defines.h" - -#include -#include -#include -#include -#include - -/** - * When we allocate constants into the pool, we reserve 0 to mean that the slot - * is not yet filled. This constant is reused in other places to indicate the - * lack of a constant id. - */ -#define PM_CONSTANT_ID_UNSET 0 - -/** - * A constant id is a unique identifier for a constant in the constant pool. - */ -typedef uint32_t pm_constant_id_t; - -/** - * A list of constant IDs. Usually used to represent a set of locals. - */ -typedef struct { - /** The number of constant ids in the list. */ - size_t size; - - /** The number of constant ids that have been allocated in the list. */ - size_t capacity; - - /** The constant ids in the list. */ - pm_constant_id_t *ids; -} pm_constant_id_list_t; - -/** - * Initialize a list of constant ids. - * - * @param list The list to initialize. - */ -void pm_constant_id_list_init(pm_constant_id_list_t *list); - -/** - * Initialize a list of constant ids with a given capacity. - * - * @param list The list to initialize. - * @param capacity The initial capacity of the list. - */ -void pm_constant_id_list_init_capacity(pm_constant_id_list_t *list, size_t capacity); - -/** - * Append a constant id to a list of constant ids. Returns false if any - * potential reallocations fail. - * - * @param list The list to append to. - * @param id The id to append. - * @return Whether the append succeeded. - */ -bool pm_constant_id_list_append(pm_constant_id_list_t *list, pm_constant_id_t id); - -/** - * Insert a constant id into a list of constant ids at the specified index. - * - * @param list The list to insert into. - * @param index The index at which to insert. - * @param id The id to insert. - */ -void pm_constant_id_list_insert(pm_constant_id_list_t *list, size_t index, pm_constant_id_t id); - -/** - * Checks if the current constant id list includes the given constant id. - * - * @param list The list to check. - * @param id The id to check for. - * @return Whether the list includes the given id. - */ -bool pm_constant_id_list_includes(pm_constant_id_list_t *list, pm_constant_id_t id); - -/** - * Get the memory size of a list of constant ids. - * - * @param list The list to get the memory size of. - * @return The memory size of the list. - */ -size_t pm_constant_id_list_memsize(pm_constant_id_list_t *list); - -/** - * Free the memory associated with a list of constant ids. - * - * @param list The list to free. - */ -void pm_constant_id_list_free(pm_constant_id_list_t *list); - -/** - * The type of bucket in the constant pool hash map. This determines how the - * bucket should be freed. - */ -typedef unsigned int pm_constant_pool_bucket_type_t; - -/** By default, each constant is a slice of the source. */ -static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_DEFAULT = 0; - -/** An owned constant is one for which memory has been allocated. */ -static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_OWNED = 1; - -/** A constant constant is known at compile time. */ -static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_CONSTANT = 2; - -/** A bucket in the hash map. */ -typedef struct { - /** The incremental ID used for indexing back into the pool. */ - unsigned int id: 30; - - /** The type of the bucket, which determines how to free it. */ - pm_constant_pool_bucket_type_t type: 2; - - /** The hash of the bucket. */ - uint32_t hash; -} pm_constant_pool_bucket_t; - -/** A constant in the pool which effectively stores a string. */ -typedef struct { - /** A pointer to the start of the string. */ - const uint8_t *start; - - /** The length of the string. */ - size_t length; -} pm_constant_t; - -/** The overall constant pool, which stores constants found while parsing. */ -typedef struct { - /** The buckets in the hash map. */ - pm_constant_pool_bucket_t *buckets; - - /** The constants that are stored in the buckets. */ - pm_constant_t *constants; - - /** The number of buckets in the hash map. */ - uint32_t size; - - /** The number of buckets that have been allocated in the hash map. */ - uint32_t capacity; -} pm_constant_pool_t; - -/** - * Initialize a new constant pool with a given capacity. - * - * @param pool The pool to initialize. - * @param capacity The initial capacity of the pool. - * @return Whether the initialization succeeded. - */ -bool pm_constant_pool_init(pm_constant_pool_t *pool, uint32_t capacity); - -/** - * Return a pointer to the constant indicated by the given constant id. - * - * @param pool The pool to get the constant from. - * @param constant_id The id of the constant to get. - * @return A pointer to the constant. - */ -pm_constant_t * pm_constant_pool_id_to_constant(const pm_constant_pool_t *pool, pm_constant_id_t constant_id); - -/** - * Find a constant in a constant pool. Returns the id of the constant, or 0 if - * the constant is not found. - * - * @param pool The pool to find the constant in. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_find(const pm_constant_pool_t *pool, const uint8_t *start, size_t length); - -/** - * Insert a constant into a constant pool that is a slice of a source string. - * Returns the id of the constant, or 0 if any potential calls to resize fail. - * - * @param pool The pool to insert the constant into. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_insert_shared(pm_constant_pool_t *pool, const uint8_t *start, size_t length); - -/** - * Insert a constant into a constant pool from memory that is now owned by the - * constant pool. Returns the id of the constant, or 0 if any potential calls to - * resize fail. - * - * @param pool The pool to insert the constant into. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_insert_owned(pm_constant_pool_t *pool, uint8_t *start, size_t length); - -/** - * Insert a constant into a constant pool from memory that is constant. Returns - * the id of the constant, or 0 if any potential calls to resize fail. - * - * @param pool The pool to insert the constant into. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_insert_constant(pm_constant_pool_t *pool, const uint8_t *start, size_t length); - -/** - * Free the memory associated with a constant pool. - * - * @param pool The pool to free. - */ -void pm_constant_pool_free(pm_constant_pool_t *pool); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h deleted file mode 100644 index 7f17298..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file pm_integer.h - * - * This module provides functions for working with arbitrary-sized integers. - */ -#ifndef PRISM_NUMBER_H -#define PRISM_NUMBER_H - -#include "prism/defines.h" -#include "prism/util/pm_buffer.h" - -#include -#include -#include -#include - -/** - * A structure represents an arbitrary-sized integer. - */ -typedef struct { - /** - * Embedded value for small integer. This value is set to 0 if the value - * does not fit into uint32_t. - */ - uint32_t value; - - /** - * The number of allocated values. length is set to 0 if the integer fits - * into uint32_t. - */ - size_t length; - - /** - * List of 32-bit integers. Set to NULL if the integer fits into uint32_t. - */ - uint32_t *values; - - /** - * Whether or not the integer is negative. It is stored this way so that a - * zeroed pm_integer_t is always positive zero. - */ - bool negative; -} pm_integer_t; - -/** - * An enum controlling the base of an integer. It is expected that the base is - * already known before parsing the integer, even though it could be derived - * from the string itself. - */ -typedef enum { - /** The binary base, indicated by a 0b or 0B prefix. */ - PM_INTEGER_BASE_BINARY, - - /** The octal base, indicated by a 0, 0o, or 0O prefix. */ - PM_INTEGER_BASE_OCTAL, - - /** The decimal base, indicated by a 0d, 0D, or empty prefix. */ - PM_INTEGER_BASE_DECIMAL, - - /** The hexadecimal base, indicated by a 0x or 0X prefix. */ - PM_INTEGER_BASE_HEXADECIMAL, - - /** - * An unknown base, in which case pm_integer_parse will derive it based on - * the content of the string. This is less efficient and does more - * comparisons, so if callers know the base ahead of time, they should use - * that instead. - */ - PM_INTEGER_BASE_UNKNOWN -} pm_integer_base_t; - -/** - * Parse an integer from a string. This assumes that the format of the integer - * has already been validated, as internal validation checks are not performed - * here. - * - * @param integer The integer to parse into. - * @param base The base of the integer. - * @param start The start of the string. - * @param end The end of the string. - */ -PRISM_EXPORTED_FUNCTION void pm_integer_parse(pm_integer_t *integer, pm_integer_base_t base, const uint8_t *start, const uint8_t *end); - -/** - * Return the memory size of the integer. - * - * @param integer The integer to get the memory size of. - * @return The size of the memory associated with the integer. - */ -size_t pm_integer_memsize(const pm_integer_t *integer); - -/** - * Compare two integers. This function returns -1 if the left integer is less - * than the right integer, 0 if they are equal, and 1 if the left integer is - * greater than the right integer. - * - * @param left The left integer to compare. - * @param right The right integer to compare. - * @return The result of the comparison. - */ -int pm_integer_compare(const pm_integer_t *left, const pm_integer_t *right); - -/** - * Convert an integer to a decimal string. - * - * @param buffer The buffer to append the string to. - * @param integer The integer to convert to a string. - */ -PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer); - -/** - * Free the internal memory of an integer. This memory will only be allocated if - * the integer exceeds the size of a single node in the linked list. - * - * @param integer The integer to free. - */ -PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h deleted file mode 100644 index 3512dee..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file pm_list.h - * - * An abstract linked list. - */ -#ifndef PRISM_LIST_H -#define PRISM_LIST_H - -#include "prism/defines.h" - -#include -#include -#include -#include - -/** - * This struct represents an abstract linked list that provides common - * functionality. It is meant to be used any time a linked list is necessary to - * store data. - * - * The linked list itself operates off a set of pointers. Because the pointers - * are not necessarily sequential, they can be of any size. We use this fact to - * allow the consumer of this linked list to extend the node struct to include - * any data they want. This is done by using the pm_list_node_t as the first - * member of the struct. - * - * For example, if we want to store a list of integers, we can do the following: - * - * ```c - * typedef struct { - * pm_list_node_t node; - * int value; - * } pm_int_node_t; - * - * pm_list_t list = { 0 }; - * pm_int_node_t *node = xmalloc(sizeof(pm_int_node_t)); - * node->value = 5; - * - * pm_list_append(&list, &node->node); - * ``` - * - * The pm_list_t struct is used to represent the overall linked list. It - * contains a pointer to the head and tail of the list. This allows for easy - * iteration and appending of new nodes. - */ -typedef struct pm_list_node { - /** A pointer to the next node in the list. */ - struct pm_list_node *next; -} pm_list_node_t; - -/** - * This represents the overall linked list. It keeps a pointer to the head and - * tail so that iteration is easy and pushing new nodes is easy. - */ -typedef struct { - /** The size of the list. */ - size_t size; - - /** A pointer to the head of the list. */ - pm_list_node_t *head; - - /** A pointer to the tail of the list. */ - pm_list_node_t *tail; -} pm_list_t; - -/** - * Returns true if the given list is empty. - * - * @param list The list to check. - * @return True if the given list is empty, otherwise false. - */ -PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list); - -/** - * Returns the size of the list. - * - * @param list The list to check. - * @return The size of the list. - */ -PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list); - -/** - * Append a node to the given list. - * - * @param list The list to append to. - * @param node The node to append. - */ -void pm_list_append(pm_list_t *list, pm_list_node_t *node); - -/** - * Deallocate the internal state of the given list. - * - * @param list The list to free. - */ -PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h deleted file mode 100644 index e0671ea..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file pm_memchr.h - * - * A custom memchr implementation. - */ -#ifndef PRISM_MEMCHR_H -#define PRISM_MEMCHR_H - -#include "prism/defines.h" -#include "prism/encoding.h" - -#include - -/** - * We need to roll our own memchr to handle cases where the encoding changes and - * we need to search for a character in a buffer that could be the trailing byte - * of a multibyte character. - * - * @param source The source string. - * @param character The character to search for. - * @param number The maximum number of bytes to search. - * @param encoding_changed Whether the encoding changed. - * @param encoding A pointer to the encoding. - * @return A pointer to the first occurrence of the character in the source - * string, or NULL if no such character exists. - */ -void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h deleted file mode 100644 index 7ae9b6b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file pm_newline_list.h - * - * A list of byte offsets of newlines in a string. - * - * When compiling the syntax tree, it's necessary to know the line and column - * of many nodes. This is necessary to support things like error messages, - * tracepoints, etc. - * - * It's possible that we could store the start line, start column, end line, and - * end column on every node in addition to the offsets that we already store, - * but that would be quite a lot of memory overhead. - */ -#ifndef PRISM_NEWLINE_LIST_H -#define PRISM_NEWLINE_LIST_H - -#include "prism/defines.h" - -#include -#include -#include -#include - -/** - * A list of offsets of newlines in a string. The offsets are assumed to be - * sorted/inserted in ascending order. - */ -typedef struct { - /** A pointer to the start of the source string. */ - const uint8_t *start; - - /** The number of offsets in the list. */ - size_t size; - - /** The capacity of the list that has been allocated. */ - size_t capacity; - - /** The list of offsets. */ - size_t *offsets; -} pm_newline_list_t; - -/** - * A line and column in a string. - */ -typedef struct { - /** The line number. */ - int32_t line; - - /** The column number. */ - uint32_t column; -} pm_line_column_t; - -/** - * Initialize a new newline list with the given capacity. Returns true if the - * allocation of the offsets succeeds, otherwise returns false. - * - * @param list The list to initialize. - * @param start A pointer to the start of the source string. - * @param capacity The initial capacity of the list. - * @return True if the allocation of the offsets succeeds, otherwise false. - */ -bool pm_newline_list_init(pm_newline_list_t *list, const uint8_t *start, size_t capacity); - -/** - * Clear out the newlines that have been appended to the list. - * - * @param list The list to clear. - */ -void -pm_newline_list_clear(pm_newline_list_t *list); - -/** - * Append a new offset to the newline list. Returns true if the reallocation of - * the offsets succeeds (if one was necessary), otherwise returns false. - * - * @param list The list to append to. - * @param cursor A pointer to the offset to append. - * @return True if the reallocation of the offsets succeeds (if one was - * necessary), otherwise false. - */ -bool pm_newline_list_append(pm_newline_list_t *list, const uint8_t *cursor); - -/** - * Returns the line and column of the given offset. If the offset is not in the - * list, the line and column of the closest offset less than the given offset - * are returned. - * - * @param list The list to search. - * @param cursor A pointer to the offset to search for. - * @param start_line The line to start counting from. - * @return The line and column of the given offset. - */ -pm_line_column_t pm_newline_list_line_column(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line); - -/** - * Free the internal memory allocated for the newline list. - * - * @param list The list to free. - */ -void pm_newline_list_free(pm_newline_list_t *list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h deleted file mode 100644 index a68e2a7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * @file pm_string.h - * - * A generic string type that can have various ownership semantics. - */ -#ifndef PRISM_STRING_H -#define PRISM_STRING_H - -#include "prism/defines.h" - -#include -#include -#include -#include -#include - -// The following headers are necessary to read files using demand paging. -#ifdef _WIN32 -#include -#elif defined(_POSIX_MAPPED_FILES) -#include -#include -#include -#endif - -/** - * A generic string type that can have various ownership semantics. - */ -typedef struct { - /** A pointer to the start of the string. */ - const uint8_t *source; - - /** The length of the string in bytes of memory. */ - size_t length; - - /** The type of the string. This field determines how the string should be freed. */ - enum { - /** This string is a constant string, and should not be freed. */ - PM_STRING_CONSTANT, - - /** This is a slice of another string, and should not be freed. */ - PM_STRING_SHARED, - - /** This string owns its memory, and should be freed using `pm_string_free`. */ - PM_STRING_OWNED, - -#ifdef PRISM_HAS_MMAP - /** This string is a memory-mapped file, and should be freed using `pm_string_free`. */ - PM_STRING_MAPPED -#endif - } type; -} pm_string_t; - -/** - * Returns the size of the pm_string_t struct. This is necessary to allocate the - * correct amount of memory in the FFI backend. - * - * @return The size of the pm_string_t struct. - */ -PRISM_EXPORTED_FUNCTION size_t pm_string_sizeof(void); - -/** - * Defines an empty string. This is useful for initializing a string that will - * be filled in later. - */ -#define PM_STRING_EMPTY ((pm_string_t) { .type = PM_STRING_CONSTANT, .source = NULL, .length = 0 }) - -/** - * Initialize a shared string that is based on initial input. - * - * @param string The string to initialize. - * @param start The start of the string. - * @param end The end of the string. - */ -void pm_string_shared_init(pm_string_t *string, const uint8_t *start, const uint8_t *end); - -/** - * Initialize an owned string that is responsible for freeing allocated memory. - * - * @param string The string to initialize. - * @param source The source of the string. - * @param length The length of the string. - */ -void pm_string_owned_init(pm_string_t *string, uint8_t *source, size_t length); - -/** - * Initialize a constant string that doesn't own its memory source. - * - * @param string The string to initialize. - * @param source The source of the string. - * @param length The length of the string. - */ -void pm_string_constant_init(pm_string_t *string, const char *source, size_t length); - -/** - * Read the file indicated by the filepath parameter into source and load its - * contents and size into the given `pm_string_t`. The given `pm_string_t` - * should be freed using `pm_string_free` when it is no longer used. - * - * We want to use demand paging as much as possible in order to avoid having to - * read the entire file into memory (which could be detrimental to performance - * for large files). This means that if we're on windows we'll use - * `MapViewOfFile`, on POSIX systems that have access to `mmap` we'll use - * `mmap`, and on other POSIX systems we'll use `read`. - * - * @param string The string to initialize. - * @param filepath The filepath to read. - * @return Whether or not the file was successfully mapped. - */ -PRISM_EXPORTED_FUNCTION bool pm_string_mapped_init(pm_string_t *string, const char *filepath); - -/** - * Read the file indicated by the filepath parameter into source and load its - * contents and size into the given `pm_string_t`. The given `pm_string_t` - * should be freed using `pm_string_free` when it is no longer used. - * - * @param string The string to initialize. - * @param filepath The filepath to read. - * @return Whether or not the file was successfully read. - */ -PRISM_EXPORTED_FUNCTION bool pm_string_file_init(pm_string_t *string, const char *filepath); - -/** - * Returns the memory size associated with the string. - * - * @param string The string to get the memory size of. - * @return The size of the memory associated with the string. - */ -size_t pm_string_memsize(const pm_string_t *string); - -/** - * Ensure the string is owned. If it is not, then reinitialize it as owned and - * copy over the previous source. - * - * @param string The string to ensure is owned. - */ -void pm_string_ensure_owned(pm_string_t *string); - -/** - * Compare the underlying lengths and bytes of two strings. Returns 0 if the - * strings are equal, a negative number if the left string is less than the - * right string, and a positive number if the left string is greater than the - * right string. - * - * @param left The left string to compare. - * @param right The right string to compare. - * @return The comparison result. - */ -int pm_string_compare(const pm_string_t *left, const pm_string_t *right); - -/** - * Returns the length associated with the string. - * - * @param string The string to get the length of. - * @return The length of the string. - */ -PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string); - -/** - * Returns the start pointer associated with the string. - * - * @param string The string to get the start pointer of. - * @return The start pointer of the string. - */ -PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *string); - -/** - * Free the associated memory of the given string. - * - * @param string The string to free. - */ -PRISM_EXPORTED_FUNCTION void pm_string_free(pm_string_t *string); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h deleted file mode 100644 index 0d406cc..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file pm_string_list.h - * - * A list of strings. - */ -#ifndef PRISM_STRING_LIST_H -#define PRISM_STRING_LIST_H - -#include "prism/defines.h" -#include "prism/util/pm_string.h" - -#include -#include - -/** - * A list of strings. - */ -typedef struct { - /** The length of the string list. */ - size_t length; - - /** The capacity of the string list that has been allocated. */ - size_t capacity; - - /** A pointer to the start of the string list. */ - pm_string_t *strings; -} pm_string_list_t; - -/** - * Append a pm_string_t to the given string list. - * - * @param string_list The string list to append to. - * @param string The string to append. - */ -void pm_string_list_append(pm_string_list_t *string_list, pm_string_t *string); - -/** - * Free the memory associated with the string list. - * - * @param string_list The string list to free. - */ -PRISM_EXPORTED_FUNCTION void pm_string_list_free(pm_string_list_t *string_list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h deleted file mode 100644 index 5cb88cb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file pm_strncasecmp.h - * - * A custom strncasecmp implementation. - */ -#ifndef PRISM_STRNCASECMP_H -#define PRISM_STRNCASECMP_H - -#include "prism/defines.h" - -#include -#include -#include - -/** - * Compare two strings, ignoring case, up to the given length. Returns 0 if the - * strings are equal, a negative number if string1 is less than string2, or a - * positive number if string1 is greater than string2. - * - * Note that this is effectively our own implementation of strncasecmp, but it's - * not available on all of the platforms we want to support so we're rolling it - * here. - * - * @param string1 The first string to compare. - * @param string2 The second string to compare - * @param length The maximum number of characters to compare. - * @return 0 if the strings are equal, a negative number if string1 is less than - * string2, or a positive number if string1 is greater than string2. - */ -int pm_strncasecmp(const uint8_t *string1, const uint8_t *string2, size_t length); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h deleted file mode 100644 index f387bd5..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file pm_strpbrk.h - * - * A custom strpbrk implementation. - */ -#ifndef PRISM_STRPBRK_H -#define PRISM_STRPBRK_H - -#include "prism/defines.h" -#include "prism/diagnostic.h" -#include "prism/parser.h" - -#include -#include - -/** - * Here we have rolled our own version of strpbrk. The standard library strpbrk - * has undefined behavior when the source string is not null-terminated. We want - * to support strings that are not null-terminated because pm_parse does not - * have the contract that the string is null-terminated. (This is desirable - * because it means the extension can call pm_parse with the result of a call to - * mmap). - * - * The standard library strpbrk also does not support passing a maximum length - * to search. We want to support this for the reason mentioned above, but we - * also don't want it to stop on null bytes. Ruby actually allows null bytes - * within strings, comments, regular expressions, etc. So we need to be able to - * skip past them. - * - * Finally, we want to support encodings wherein the charset could contain - * characters that are trailing bytes of multi-byte characters. For example, in - * Shift-JIS, the backslash character can be a trailing byte. In that case we - * need to take a slower path and iterate one multi-byte character at a time. - * - * @param parser The parser. - * @param source The source to search. - * @param charset The charset to search for. - * @param length The maximum number of bytes to search. - * @param validate Whether to validate that the source string is valid in the - * current encoding of the parser. - * @return A pointer to the first character in the source string that is in the - * charset, or NULL if no such character exists. - */ -const uint8_t * pm_strpbrk(pm_parser_t *parser, const uint8_t *source, const uint8_t *charset, ptrdiff_t length, bool validate); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h deleted file mode 100644 index 154e967..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file version.h - * - * The version of the Prism library. - */ -#ifndef PRISM_VERSION_H -#define PRISM_VERSION_H - -/** - * The major version of the Prism library as an int. - */ -#define PRISM_VERSION_MAJOR 0 - -/** - * The minor version of the Prism library as an int. - */ -#define PRISM_VERSION_MINOR 29 - -/** - * The patch version of the Prism library as an int. - */ -#define PRISM_VERSION_PATCH 0 - -/** - * The version of the Prism library as a constant string. - */ -#define PRISM_VERSION "0.29.0" - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h deleted file mode 100644 index 0f82782..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h +++ /dev/null @@ -1,88 +0,0 @@ -#include "prism/prism.h" -#include "ruby/encoding.h" - -/** - * the getlocal and setlocal instructions require two parameters. level is how - * many hops up the iseq stack one needs to go before finding the correct local - * table. The index is the index in that table where our variable is. - * - * Because these are always calculated and used together, we'll bind them - * together as a tuple. - */ -typedef struct pm_local_index_struct { - int index, level; -} pm_local_index_t; - -// A declaration for the struct that lives in compile.c. -struct iseq_link_anchor; - -// ScopeNodes are helper nodes, and will never be part of the AST. We manually -// declare them here to avoid generating them. -typedef struct pm_scope_node { - pm_node_t base; - struct pm_scope_node *previous; - pm_node_t *ast_node; - pm_node_t *parameters; - pm_node_t *body; - pm_constant_id_list_t locals; - - const pm_parser_t *parser; - rb_encoding *encoding; - - /** - * This is the encoding of the actual filepath object that will be used when - * a __FILE__ node is compiled or when the path has to be set on a syntax - * error. - */ - rb_encoding *filepath_encoding; - - // The size of the local table - // on the iseq which includes - // locals and hidden variables - int local_table_for_iseq_size; - - ID *constants; - st_table *index_lookup_table; - - /** - * This will only be set on the top-level scope node. It will contain all of - * the instructions pertaining to BEGIN{} nodes. - */ - struct iseq_link_anchor *pre_execution_anchor; -} pm_scope_node_t; - -void pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_t *previous); -void pm_scope_node_destroy(pm_scope_node_t *scope_node); -bool *rb_ruby_prism_ptr(void); - -typedef struct { - /** The parser that will do the actual parsing. */ - pm_parser_t parser; - - /** The options that will be passed to the parser. */ - pm_options_t options; - - /** The input that represents the source to be parsed. */ - pm_string_t input; - - /** The resulting scope node that will hold the generated AST. */ - pm_scope_node_t node; - - /** Whether or not this parse result has performed its parsing yet. */ - bool parsed; -} pm_parse_result_t; - -VALUE pm_load_file(pm_parse_result_t *result, VALUE filepath, bool load_error); -VALUE pm_parse_file(pm_parse_result_t *result, VALUE filepath); -VALUE pm_load_parse_file(pm_parse_result_t *result, VALUE filepath); -VALUE pm_parse_string(pm_parse_result_t *result, VALUE source, VALUE filepath); -VALUE pm_parse_stdin(pm_parse_result_t *result); -void pm_parse_result_free(pm_parse_result_t *result); - -rb_iseq_t *pm_iseq_new(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type); -rb_iseq_t *pm_iseq_new_top(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent); -rb_iseq_t *pm_iseq_new_main(pm_scope_node_t *node, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt); -rb_iseq_t *pm_iseq_new_eval(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth); -rb_iseq_t *pm_iseq_new_with_opt(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth, enum rb_iseq_type, const rb_compile_option_t*); - -VALUE pm_iseq_compile_node(rb_iseq_t *iseq, pm_scope_node_t *node); diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h deleted file mode 100644 index 16d81b9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef RUBY_PROBES_HELPER_H -#define RUBY_PROBES_HELPER_H - -#include "ruby/ruby.h" - -struct ruby_dtrace_method_hook_args { - const char *classname; - const char *methodname; - const char *filename; - int line_no; - volatile VALUE klass; - volatile VALUE name; -}; - -NOINLINE(int rb_dtrace_setup(rb_execution_context_t *, VALUE, ID, struct ruby_dtrace_method_hook_args *)); - -#define RUBY_DTRACE_METHOD_HOOK(name, ec, klazz, id) \ -do { \ - if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \ - struct ruby_dtrace_method_hook_args args; \ - if (rb_dtrace_setup(ec, klazz, id, &args)) { \ - RUBY_DTRACE_##name(args.classname, \ - args.methodname, \ - args.filename, \ - args.line_no); \ - } \ - } \ -} while (0) - -#define RUBY_DTRACE_METHOD_ENTRY_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(METHOD_ENTRY, ec, klass, id) - -#define RUBY_DTRACE_METHOD_RETURN_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(METHOD_RETURN, ec, klass, id) - -#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(CMETHOD_ENTRY, ec, klass, id) - -#define RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(CMETHOD_RETURN, ec, klass, id) - -#endif /* RUBY_PROBES_HELPER_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h deleted file mode 100644 index 36c0e91..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h +++ /dev/null @@ -1,393 +0,0 @@ -#include "internal/gc.h" -#include "ruby/ruby.h" -#include "ruby/ractor.h" -#include "vm_core.h" -#include "id_table.h" -#include "vm_debug.h" - -#ifndef RACTOR_CHECK_MODE -#define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE) -#endif - -enum rb_ractor_basket_type { - // basket is empty - basket_type_none, - - // value is available - basket_type_ref, - basket_type_copy, - basket_type_move, - basket_type_will, - - // basket should be deleted - basket_type_deleted, - - // basket is reserved - basket_type_reserved, - - // take_basket is available - basket_type_take_basket, - - // basket is keeping by yielding ractor - basket_type_yielding, -}; - -// per ractor taking configuration -struct rb_ractor_selector_take_config { - bool closed; - bool oneshot; -}; - -struct rb_ractor_basket { - union { - enum rb_ractor_basket_type e; - rb_atomic_t atomic; - } type; - VALUE sender; - - union { - struct { - VALUE v; - bool exception; - } send; - - struct { - struct rb_ractor_basket *basket; - struct rb_ractor_selector_take_config *config; - } take; - } p; // payload -}; - -static inline bool -basket_type_p(struct rb_ractor_basket *b, enum rb_ractor_basket_type type) -{ - return b->type.e == type; -} - -static inline bool -basket_none_p(struct rb_ractor_basket *b) -{ - return basket_type_p(b, basket_type_none); -} - -struct rb_ractor_queue { - struct rb_ractor_basket *baskets; - int start; - int cnt; - int size; - unsigned int serial; - unsigned int reserved_cnt; -}; - -enum rb_ractor_wait_status { - wait_none = 0x00, - wait_receiving = 0x01, - wait_taking = 0x02, - wait_yielding = 0x04, - wait_moving = 0x08, -}; - -enum rb_ractor_wakeup_status { - wakeup_none, - wakeup_by_send, - wakeup_by_yield, - wakeup_by_take, - wakeup_by_close, - wakeup_by_interrupt, - wakeup_by_retry, -}; - -struct rb_ractor_sync { - // ractor lock - rb_nativethread_lock_t lock; -#if RACTOR_CHECK_MODE > 0 - VALUE locked_by; -#endif - - bool incoming_port_closed; - bool outgoing_port_closed; - - // All sent messages will be pushed into recv_queue - struct rb_ractor_queue recv_queue; - - // The following ractors waiting for the yielding by this ractor - struct rb_ractor_queue takers_queue; - - // Enabled if the ractor already terminated and not taken yet. - struct rb_ractor_basket will_basket; - - struct ractor_wait { - enum rb_ractor_wait_status status; - enum rb_ractor_wakeup_status wakeup_status; - rb_thread_t *waiting_thread; - } wait; - -#ifndef RUBY_THREAD_PTHREAD_H - rb_nativethread_cond_t cond; -#endif -}; - -// created -// | ready to run -// ====================== inserted to vm->ractor -// v -// blocking <---+ all threads are blocking -// | | -// v | -// running -----+ -// | all threads are terminated. -// ====================== removed from vm->ractor -// v -// terminated -// -// status is protected by VM lock (global state) -enum ractor_status { - ractor_created, - ractor_running, - ractor_blocking, - ractor_terminated, -}; - -struct rb_ractor_struct { - struct rb_ractor_pub pub; - - struct rb_ractor_sync sync; - VALUE receiving_mutex; - - // vm wide barrier synchronization - rb_nativethread_cond_t barrier_wait_cond; - - // thread management - struct { - struct ccan_list_head set; - unsigned int cnt; - unsigned int blocking_cnt; - unsigned int sleeper; - struct rb_thread_sched sched; - rb_execution_context_t *running_ec; - rb_thread_t *main; - } threads; - VALUE thgroup_default; - - VALUE name; - VALUE loc; - - enum ractor_status status_; - - struct ccan_list_node vmlr_node; - - // ractor local data - - st_table *local_storage; - struct rb_id_table *idkey_local_storage; - - VALUE r_stdin; - VALUE r_stdout; - VALUE r_stderr; - VALUE verbose; - VALUE debug; - - rb_ractor_newobj_cache_t newobj_cache; - - // gc.c rb_objspace_reachable_objects_from - struct gc_mark_func_data_struct { - void *data; - void (*mark_func)(VALUE v, void *data); - } *mfd; -}; // rb_ractor_t is defined in vm_core.h - - -static inline VALUE -rb_ractor_self(const rb_ractor_t *r) -{ - return r->pub.self; -} - -rb_ractor_t *rb_ractor_main_alloc(void); -void rb_ractor_main_setup(rb_vm_t *vm, rb_ractor_t *main_ractor, rb_thread_t *main_thread); -void rb_ractor_atexit(rb_execution_context_t *ec, VALUE result); -void rb_ractor_atexit_exception(rb_execution_context_t *ec); -void rb_ractor_teardown(rb_execution_context_t *ec); -void rb_ractor_receive_parameters(rb_execution_context_t *ec, rb_ractor_t *g, int len, VALUE *ptr); -void rb_ractor_send_parameters(rb_execution_context_t *ec, rb_ractor_t *g, VALUE args); - -VALUE rb_thread_create_ractor(rb_ractor_t *g, VALUE args, VALUE proc); // defined in thread.c - -int rb_ractor_living_thread_num(const rb_ractor_t *); -VALUE rb_ractor_thread_list(void); -bool rb_ractor_p(VALUE rv); - -void rb_ractor_living_threads_init(rb_ractor_t *r); -void rb_ractor_living_threads_insert(rb_ractor_t *r, rb_thread_t *th); -void rb_ractor_living_threads_remove(rb_ractor_t *r, rb_thread_t *th); -void rb_ractor_blocking_threads_inc(rb_ractor_t *r, const char *file, int line); // TODO: file, line only for RUBY_DEBUG_LOG -void rb_ractor_blocking_threads_dec(rb_ractor_t *r, const char *file, int line); // TODO: file, line only for RUBY_DEBUG_LOG - -void rb_ractor_vm_barrier_interrupt_running_thread(rb_ractor_t *r); -void rb_ractor_terminate_interrupt_main_thread(rb_ractor_t *r); -void rb_ractor_terminate_all(void); -bool rb_ractor_main_p_(void); -void rb_ractor_finish_marking(void); -void rb_ractor_atfork(rb_vm_t *vm, rb_thread_t *th); - -VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name); - -RUBY_SYMBOL_EXPORT_BEGIN -bool rb_ractor_shareable_p_continue(VALUE obj); - -// THIS FUNCTION SHOULD NOT CALL WHILE INCREMENTAL MARKING!! -// This function is for T_DATA::free_func -void rb_ractor_local_storage_delkey(rb_ractor_local_key_t key); - -RUBY_SYMBOL_EXPORT_END - -static inline bool -rb_ractor_main_p(void) -{ - if (ruby_single_main_ractor) { - return true; - } - else { - return rb_ractor_main_p_(); - } -} - -static inline bool -rb_ractor_status_p(rb_ractor_t *r, enum ractor_status status) -{ - return r->status_ == status; -} - -static inline void -rb_ractor_sleeper_threads_inc(rb_ractor_t *r) -{ - r->threads.sleeper++; -} - -static inline void -rb_ractor_sleeper_threads_dec(rb_ractor_t *r) -{ - r->threads.sleeper--; -} - -static inline void -rb_ractor_sleeper_threads_clear(rb_ractor_t *r) -{ - r->threads.sleeper = 0; -} - -static inline int -rb_ractor_sleeper_thread_num(rb_ractor_t *r) -{ - return r->threads.sleeper; -} - -static inline void -rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th) -{ - RUBY_DEBUG_LOG("th:%d->%u%s", - cr->threads.running_ec ? (int)rb_th_serial(cr->threads.running_ec->thread_ptr) : -1, - rb_th_serial(th), cr->threads.running_ec == th->ec ? " (same)" : ""); - - if (cr->threads.running_ec != th->ec) { - if (0) { - ruby_debug_printf("rb_ractor_thread_switch ec:%p->%p\n", - (void *)cr->threads.running_ec, (void *)th->ec); - } - } - else { - return; - } - - if (cr->threads.running_ec != th->ec) { - th->running_time_us = 0; - } - - cr->threads.running_ec = th->ec; - - VM_ASSERT(cr == GET_RACTOR()); -} - -#define rb_ractor_set_current_ec(cr, ec) rb_ractor_set_current_ec_(cr, ec, __FILE__, __LINE__) - -static inline void -rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line) -{ -#ifdef RB_THREAD_LOCAL_SPECIFIER - -# ifdef __APPLE__ - rb_current_ec_set(ec); -# else - ruby_current_ec = ec; -# endif - -#else - native_tls_set(ruby_current_ec_key, ec); -#endif - RUBY_DEBUG_LOG2(file, line, "ec:%p->%p", (void *)cr->threads.running_ec, (void *)ec); - VM_ASSERT(ec == NULL || cr->threads.running_ec != ec); - cr->threads.running_ec = ec; -} - -void rb_vm_ractor_blocking_cnt_inc(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line); -void rb_vm_ractor_blocking_cnt_dec(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line); - -static inline uint32_t -rb_ractor_id(const rb_ractor_t *r) -{ - return r->pub.id; -} - -#if RACTOR_CHECK_MODE > 0 -# define RACTOR_BELONGING_ID(obj) (*(uint32_t *)(((uintptr_t)(obj)) + rb_gc_obj_slot_size(obj))) - -uint32_t rb_ractor_current_id(void); - -static inline void -rb_ractor_setup_belonging_to(VALUE obj, uint32_t rid) -{ - RACTOR_BELONGING_ID(obj) = rid; -} - -static inline void -rb_ractor_setup_belonging(VALUE obj) -{ - rb_ractor_setup_belonging_to(obj, rb_ractor_current_id()); -} - -static inline uint32_t -rb_ractor_belonging(VALUE obj) -{ - if (SPECIAL_CONST_P(obj) || RB_OBJ_SHAREABLE_P(obj)) { - return 0; - } - else { - return RACTOR_BELONGING_ID(obj); - } -} - -static inline VALUE -rb_ractor_confirm_belonging(VALUE obj) -{ - uint32_t id = rb_ractor_belonging(obj); - - if (id == 0) { - if (UNLIKELY(!rb_ractor_shareable_p(obj))) { - rp(obj); - rb_bug("id == 0 but not shareable"); - } - } - else if (UNLIKELY(id != rb_ractor_current_id())) { - if (rb_ractor_shareable_p(obj)) { - // ok - } - else { - rp(obj); - rb_bug("rb_ractor_confirm_belonging object-ractor id:%u, current-ractor id:%u", id, rb_ractor_current_id()); - } - } - return obj; -} -#else -#define rb_ractor_confirm_belonging(obj) obj -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h deleted file mode 100644 index 352a8d7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef ONIGMO_REGENC_H -#define ONIGMO_REGENC_H -/********************************************************************** - regenc.h - Onigmo (Oniguruma-mod) (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2008 K.Kosako - * Copyright (c) 2011-2016 K.Takata - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if !defined(RUBY) && (defined(RUBY_EXPORT) || defined(ONIG_ENC_REGISTER)) -# define RUBY -#endif -#ifdef RUBY -# ifndef ONIGMO_REGINT_H -# ifndef RUBY_EXTERN -# include "ruby/config.h" -# include "ruby/defines.h" -# endif -# endif -# include "ruby.h" -#else /* RUBY */ -# ifndef PACKAGE -/* PACKAGE is defined in config.h */ -# include "config.h" -# endif -#endif /* RUBY */ - -#ifdef ONIG_ESCAPE_UCHAR_COLLISION -# undef ONIG_ESCAPE_UCHAR_COLLISION -#endif - -#ifdef RUBY -# include "ruby/onigmo.h" -#else -# include "onigmo.h" -#endif - -RUBY_SYMBOL_EXPORT_BEGIN - -typedef struct { - OnigCodePoint from; - OnigCodePoint to; -} OnigPairCaseFoldCodes; - - -#ifndef NULL -# define NULL ((void* )0) -#endif - -#ifndef TRUE -# define TRUE 1 -#endif - -#ifndef FALSE -# define FALSE 0 -#endif - -#ifndef ARG_UNUSED -# if defined(__GNUC__) -# define ARG_UNUSED __attribute__ ((unused)) -# else -# define ARG_UNUSED -# endif -#endif - -#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0) -#define ONIG_IS_NOT_NULL(p) (((void*)(p)) != (void*)0) -#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL -#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val) - -#define enclen(enc,p,e) ((enc->max_enc_len == enc->min_enc_len) ? (p < e ? enc->min_enc_len : 0) : ONIGENC_MBC_ENC_LEN(enc,p,e)) - -/* character types bit flag */ -#define BIT_CTYPE_NEWLINE (1<< ONIGENC_CTYPE_NEWLINE) -#define BIT_CTYPE_ALPHA (1<< ONIGENC_CTYPE_ALPHA) -#define BIT_CTYPE_BLANK (1<< ONIGENC_CTYPE_BLANK) -#define BIT_CTYPE_CNTRL (1<< ONIGENC_CTYPE_CNTRL) -#define BIT_CTYPE_DIGIT (1<< ONIGENC_CTYPE_DIGIT) -#define BIT_CTYPE_GRAPH (1<< ONIGENC_CTYPE_GRAPH) -#define BIT_CTYPE_LOWER (1<< ONIGENC_CTYPE_LOWER) -#define BIT_CTYPE_PRINT (1<< ONIGENC_CTYPE_PRINT) -#define BIT_CTYPE_PUNCT (1<< ONIGENC_CTYPE_PUNCT) -#define BIT_CTYPE_SPACE (1<< ONIGENC_CTYPE_SPACE) -#define BIT_CTYPE_UPPER (1<< ONIGENC_CTYPE_UPPER) -#define BIT_CTYPE_XDIGIT (1<< ONIGENC_CTYPE_XDIGIT) -#define BIT_CTYPE_WORD (1<< ONIGENC_CTYPE_WORD) -#define BIT_CTYPE_ALNUM (1<< ONIGENC_CTYPE_ALNUM) -#define BIT_CTYPE_ASCII (1<< ONIGENC_CTYPE_ASCII) - -#define CTYPE_TO_BIT(ctype) (1<<(ctype)) -#define CTYPE_IS_WORD_GRAPH_PRINT(ctype) \ - ((ctype) == ONIGENC_CTYPE_WORD || (ctype) == ONIGENC_CTYPE_GRAPH ||\ - (ctype) == ONIGENC_CTYPE_PRINT) - - -typedef struct { - short int len; - const UChar name[6]; - int ctype; -} PosixBracketEntryType; - -#define POSIX_BRACKET_ENTRY_INIT(name, ctype) \ - {(short int )(sizeof(name) - 1), name, (ctype)} - -#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#define roomof(x, y) (((x) + (y) - 1) / (y)) -#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) - -#define USE_CRNL_AS_LINE_TERMINATOR -#define USE_UNICODE_PROPERTIES -#define USE_UNICODE_AGE_PROPERTIES -/* #define USE_UNICODE_CASE_FOLD_TURKISH_AZERI */ -/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTS #18 */ - - -#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII - -/* for encoding system implementation (internal) */ -ONIG_EXTERN int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc); -ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc); -ONIG_EXTERN int onigenc_apply_all_case_fold_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg); -ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]); -ONIG_EXTERN int onigenc_not_support_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc); -ONIG_EXTERN int onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc); - - -/* methods for single byte encoding */ -ONIG_EXTERN int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc); -ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_code_to_mbclen(OnigCodePoint code, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc); -ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc); - -/* methods for multi byte encoding */ -ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end); -ONIG_EXTERN int onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower); -ONIG_EXTERN int onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc); -ONIG_EXTERN int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf); -ONIG_EXTERN int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end); -ONIG_EXTERN int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end); -ONIG_EXTERN int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype); -ONIG_EXTERN int onigenc_mb4_code_to_mbclen(OnigCodePoint code, OnigEncoding enc); -ONIG_EXTERN int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf); -ONIG_EXTERN int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype); - -ONIG_EXTERN int onigenc_unicode_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc); - - -/* in enc/unicode.c */ -ONIG_EXTERN int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc); -ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc); -ONIG_EXTERN int onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]); -ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]); -ONIG_EXTERN int onigenc_unicode_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold); -ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc); - - -#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8) -#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc) -#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8) -#define UNICODE_VALID_CODEPOINT_P(c) ( \ - ((c) <= 0x10ffff) && \ - !((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8))) - -#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \ - OnigEncISO_8859_1_ToLowerCaseTable[c] -#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \ - OnigEncISO_8859_1_ToUpperCaseTable[c] - -ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[]; -ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[]; - -ONIG_EXTERN int -onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n); -ONIG_EXTERN int -onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n); -ONIG_EXTERN UChar* -onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n); - -/* defined in regexec.c, but used in enc/xxx.c */ -extern int onig_is_in_code_range(const UChar* p, OnigCodePoint code); - -ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding; -ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[]; -ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[]; -ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[]; - -#define ONIGENC_IS_ASCII_CODE(code) ((code) < 0x80) -#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c] -#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c] -#define ONIGENC_IS_ASCII_CODE_CTYPE(code,ctype) \ - ((OnigEncAsciiCtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) -#define ONIGENC_IS_ASCII_CODE_CASE_AMBIG(code) \ - (ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_UPPER) ||\ - ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER)) - -/* Check if the code is in the range. (from <= code && code <= to) */ -#define ONIGENC_IS_IN_RANGE(code, from, to) \ - ((OnigCodePoint )((code) - (from)) <= (OnigCodePoint )((to) - (from))) - - -#ifdef ONIG_ENC_REGISTER -extern int ONIG_ENC_REGISTER(const char *, OnigEncoding); -# define OnigEncodingName(n) encoding_##n -# define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n) -# define OnigEncodingDefine(f,n) \ - OnigEncodingDeclare(n); \ - void Init_##f(void) { \ - ONIG_ENC_REGISTER(OnigEncodingName(n).name, \ - &OnigEncodingName(n)); \ - } \ - OnigEncodingDeclare(n) -#else -# define OnigEncodingName(n) OnigEncoding##n -# define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n) -# define OnigEncodingDefine(f,n) OnigEncodingDeclare(n) -#endif - -/* macros for define replica encoding and encoding alias */ -#define ENC_REPLICATE(name, orig) -#define ENC_ALIAS(name, orig) -#define ENC_DUMMY(name) - -RUBY_SYMBOL_EXPORT_END - -#endif /* ONIGMO_REGENC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h deleted file mode 100644 index 57cbb81..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h +++ /dev/null @@ -1,1010 +0,0 @@ -#ifndef ONIGMO_REGINT_H -#define ONIGMO_REGINT_H -/********************************************************************** - regint.h - Onigmo (Oniguruma-mod) (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2013 K.Kosako - * Copyright (c) 2011-2016 K.Takata - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* for debug */ -/* #define ONIG_DEBUG_PARSE_TREE */ -/* #define ONIG_DEBUG_COMPILE */ -/* #define ONIG_DEBUG_SEARCH */ -/* #define ONIG_DEBUG_MATCH */ -/* #define ONIG_DEBUG_MATCH_CACHE */ -/* #define ONIG_DEBUG_MEMLEAK */ -/* #define ONIG_DONT_OPTIMIZE */ - -/* for byte-code statistical data. */ -/* #define ONIG_DEBUG_STATISTICS */ - -/* enable the match optimization by using a cache. */ -#define USE_MATCH_CACHE - -#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \ - defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \ - defined(ONIG_DEBUG_STATISTICS) || defined(ONIG_DEBUG_MEMLEAK) -# ifndef ONIG_DEBUG -# define ONIG_DEBUG -# endif -#endif - -/* __POWERPC__ added to accommodate Darwin case. */ -#ifndef UNALIGNED_WORD_ACCESS -# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ - defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \ - defined(__powerpc64__) || defined(__POWERPC__) || defined(__aarch64__) || \ - defined(__mc68020__) -# define UNALIGNED_WORD_ACCESS 1 -# else -# define UNALIGNED_WORD_ACCESS 0 -# endif -#endif - -#if UNALIGNED_WORD_ACCESS -# define PLATFORM_UNALIGNED_WORD_ACCESS -#endif - -/* config */ -/* spec. config */ -#define USE_NAMED_GROUP -#define USE_SUBEXP_CALL -#define USE_PERL_SUBEXP_CALL -#define USE_CAPITAL_P_NAMED_GROUP -#define USE_BACKREF_WITH_LEVEL /* \k, \k */ -#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */ -#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */ -#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR -/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */ -#define USE_NO_INVALID_QUANTIFIER - -/* internal config */ -/* #define USE_OP_PUSH_OR_JUMP_EXACT */ -#define USE_QTFR_PEEK_NEXT -#define USE_ST_LIBRARY -#define USE_SUNDAY_QUICK_SEARCH - -#define INIT_MATCH_STACK_SIZE 160 -#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */ -#define DEFAULT_PARSE_DEPTH_LIMIT 4096 - -#define OPT_EXACT_MAXLEN 24 - -/* check config */ -#if defined(USE_PERL_SUBEXP_CALL) || defined(USE_CAPITAL_P_NAMED_GROUP) -# if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL) -# error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined. -# endif -#endif - -#if defined(__GNUC__) -# define ARG_UNUSED __attribute__ ((unused)) -#else -# define ARG_UNUSED -#endif - -#if !defined(RUBY) && defined(RUBY_EXPORT) -# define RUBY -#endif -#ifdef RUBY -# ifndef RUBY_DEFINES_H -# include "ruby/ruby.h" -# undef xmalloc -# undef xrealloc -# undef xcalloc -# undef xfree -# endif -#else /* RUBY */ -# include "config.h" -# if SIZEOF_LONG_LONG > 0 -# define LONG_LONG long long -# endif -#endif /* RUBY */ - -#include - -/* */ -/* escape other system UChar definition */ -#ifdef ONIG_ESCAPE_UCHAR_COLLISION -# undef ONIG_ESCAPE_UCHAR_COLLISION -#endif - -#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */ -#ifdef RUBY -# undef USE_CAPTURE_HISTORY -#else -# define USE_CAPTURE_HISTORY -#endif -#define USE_VARIABLE_META_CHARS -#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE -/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */ - - -#ifndef xmalloc -# define xmalloc malloc -# define xrealloc realloc -# define xcalloc calloc -# define xfree free -#endif - -#ifdef RUBY - -# define CHECK_INTERRUPT_IN_MATCH_AT do { \ - msa->counter++; \ - if (msa->counter >= 128) { \ - msa->counter = 0; \ - if (rb_reg_timeout_p(reg, &msa->end_time)) { \ - goto timeout; \ - } \ - rb_thread_check_ints(); \ - } \ -} while(0) -# define HANDLE_REG_TIMEOUT_IN_MATCH_AT do { \ - rb_reg_raise_timeout(); \ -} while (0) -# define onig_st_init_table st_init_table -# define onig_st_init_table_with_size st_init_table_with_size -# define onig_st_init_numtable st_init_numtable -# define onig_st_init_numtable_with_size st_init_numtable_with_size -# define onig_st_init_strtable st_init_strtable -# define onig_st_init_strtable_with_size st_init_strtable_with_size -# define onig_st_delete st_delete -# define onig_st_delete_safe st_delete_safe -# define onig_st_insert st_insert -# define onig_st_lookup st_lookup -# define onig_st_foreach st_foreach -# define onig_st_add_direct st_add_direct -# define onig_st_free_table st_free_table -# define onig_st_cleanup_safe st_cleanup_safe -# define onig_st_copy st_copy -# define onig_st_nothing_key_clone st_nothing_key_clone -# define onig_st_nothing_key_free st_nothing_key_free -# define onig_st_is_member st_is_member - -# define USE_UPPER_CASE_TABLE -#else /* RUBY */ - -# define CHECK_INTERRUPT_IN_MATCH_AT - -# define st_init_table onig_st_init_table -# define st_init_table_with_size onig_st_init_table_with_size -# define st_init_numtable onig_st_init_numtable -# define st_init_numtable_with_size onig_st_init_numtable_with_size -# define st_init_strtable onig_st_init_strtable -# define st_init_strtable_with_size onig_st_init_strtable_with_size -# define st_delete onig_st_delete -# define st_delete_safe onig_st_delete_safe -# define st_insert onig_st_insert -# define st_lookup onig_st_lookup -# define st_foreach onig_st_foreach -# define st_add_direct onig_st_add_direct -# define st_free_table onig_st_free_table -# define st_cleanup_safe onig_st_cleanup_safe -# define st_copy onig_st_copy -# define st_nothing_key_clone onig_st_nothing_key_clone -# define st_nothing_key_free onig_st_nothing_key_free -/* */ -# define onig_st_is_member st_is_member - -#endif /* RUBY */ - -#define STATE_CHECK_STRING_THRESHOLD_LEN 7 -#define STATE_CHECK_BUFF_MAX_SIZE 0x4000 - -#define xmemset memset -#define xmemcpy memcpy -#define xmemmove memmove - -#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \ - || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \ - && !defined(__GNUC__) -# define xalloca _alloca -# define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args) -# define xsnprintf sprintf_s -# define xstrcat(dest,src,size) strcat_s(dest,size,src) -#else -# define xalloca alloca -# define xvsnprintf vsnprintf -# define xsnprintf snprintf -# define xstrcat(dest,src,size) strcat(dest,src) -#endif - -#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER) -# define _CRTDBG_MAP_ALLOC -# include -# include -#endif - -#include - -#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__)) -# include -#endif - -#include - -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#ifdef HAVE_STDINT_H -# include -#endif - -#ifdef HAVE_INTTYPES_H -# include -#endif - -#include - -#ifdef _WIN32 -# include /* for alloca() */ -#endif - -#ifdef ONIG_DEBUG -# include -#endif - -#ifdef _WIN32 -# if defined(_MSC_VER) && (_MSC_VER < 1300) -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -typedef int intptr_t; -# endif -# ifndef _UINTPTR_T_DEFINED -# define _UINTPTR_T_DEFINED -typedef unsigned int uintptr_t; -# endif -# endif -#endif /* _WIN32 */ - -#ifndef PRIdPTR -# ifdef _WIN64 -# define PRIdPTR "I64d" -# define PRIuPTR "I64u" -# define PRIxPTR "I64x" -# else -# define PRIdPTR "ld" -# define PRIuPTR "lu" -# define PRIxPTR "lx" -# endif -#endif - -#ifndef PRIdPTRDIFF -# define PRIdPTRDIFF PRIdPTR -#endif - -#include "regenc.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#ifdef MIN -# undef MIN -#endif -#ifdef MAX -# undef MAX -#endif -#define MIN(a,b) (((a)>(b))?(b):(a)) -#define MAX(a,b) (((a)<(b))?(b):(a)) - -#define IS_NULL(p) (((void*)(p)) == (void*)0) -#define IS_NOT_NULL(p) (((void*)(p)) != (void*)0) -#define CHECK_NULL_RETURN(p) if (IS_NULL(p)) return NULL -#define CHECK_NULL_RETURN_MEMERR(p) if (IS_NULL(p)) return ONIGERR_MEMORY -#define NULL_UCHARP ((UChar* )0) - -#define ONIG_LAST_CODE_POINT (~((OnigCodePoint )0)) - -#define PLATFORM_GET_INC_ARGUMENTS_ASSERT(val, type) \ - ((void)sizeof(char[2 * (sizeof(val) == sizeof(type)) - 1])) - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - -# define PLATFORM_GET_INC(val,p,type) do{\ - PLATFORM_GET_INC_ARGUMENTS_ASSERT(val, type);\ - val = *(type* )p;\ - (p) += sizeof(type);\ -} while(0) - -#else - -# define PLATFORM_GET_INC(val,p,type) do{\ - PLATFORM_GET_INC_ARGUMENTS_ASSERT(val, type);\ - type platform_get_value;\ - xmemcpy(&platform_get_value, (p), sizeof(type));\ - val = platform_get_value;\ - (p) += sizeof(type);\ -} while(0) - -/* sizeof(OnigCodePoint) */ -# define WORD_ALIGNMENT_SIZE SIZEOF_LONG - -# define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\ - (pad_size) = WORD_ALIGNMENT_SIZE \ - - ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\ - if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\ -} while (0) - -# define ALIGNMENT_RIGHT(addr) do {\ - (addr) += (WORD_ALIGNMENT_SIZE - 1);\ - (addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\ -} while (0) - -#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ - -/* stack pop level */ -#define STACK_POP_LEVEL_FREE 0 -#define STACK_POP_LEVEL_MEM_START 1 -#define STACK_POP_LEVEL_ALL 2 - -/* optimize flags */ -#define ONIG_OPTIMIZE_NONE 0 -#define ONIG_OPTIMIZE_EXACT 1 /* Slow Search */ -#define ONIG_OPTIMIZE_EXACT_BM 2 /* Boyer Moore Search */ -#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV 3 /* BM (applied to a multibyte string) */ -#define ONIG_OPTIMIZE_EXACT_IC 4 /* Slow Search (ignore case) */ -#define ONIG_OPTIMIZE_MAP 5 /* char map */ -#define ONIG_OPTIMIZE_EXACT_BM_IC 6 /* BM (ignore case) */ -#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC 7 /* BM (applied to a multibyte string) (ignore case) */ - -/* bit status */ -typedef unsigned int BitStatusType; - -#define BIT_STATUS_BITS_NUM (sizeof(BitStatusType) * 8) -#define BIT_STATUS_CLEAR(stats) (stats) = 0 -#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0) -#define BIT_STATUS_AT(stats,n) \ - ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & ((BitStatusType )1 << n)) : ((stats) & 1)) - -#define BIT_STATUS_ON_AT(stats,n) do {\ - if ((n) < (int )BIT_STATUS_BITS_NUM)\ - (stats) |= (1 << (n));\ - else\ - (stats) |= 1;\ -} while (0) - -#define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\ - if ((n) < (int )BIT_STATUS_BITS_NUM)\ - (stats) |= (1 << (n));\ -} while (0) - - -#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1) -#define LONG_MAX_LIMIT ((1UL << (SIZEOF_LONG * 8 - 1)) - 1) - -#define DIGITVAL(code) ((code) - '0') -#define ODIGITVAL(code) DIGITVAL(code) -#define XDIGITVAL(enc,code) \ - (ONIGENC_IS_CODE_DIGIT(enc,code) ? DIGITVAL(code) \ - : (ONIGENC_IS_CODE_UPPER(enc,code) ? (code) - 'A' + 10 : (code) - 'a' + 10)) - -#define IS_SINGLELINE(option) ((option) & ONIG_OPTION_SINGLELINE) -#define IS_MULTILINE(option) ((option) & ONIG_OPTION_MULTILINE) -#define IS_IGNORECASE(option) ((option) & ONIG_OPTION_IGNORECASE) -#define IS_EXTEND(option) ((option) & ONIG_OPTION_EXTEND) -#define IS_FIND_LONGEST(option) ((option) & ONIG_OPTION_FIND_LONGEST) -#define IS_FIND_NOT_EMPTY(option) ((option) & ONIG_OPTION_FIND_NOT_EMPTY) -#define IS_FIND_CONDITION(option) ((option) & \ - (ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY)) -#define IS_NOTBOL(option) ((option) & ONIG_OPTION_NOTBOL) -#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL) -#define IS_NOTBOS(option) ((option) & ONIG_OPTION_NOTBOS) -#define IS_NOTEOS(option) ((option) & ONIG_OPTION_NOTEOS) -#define IS_ASCII_RANGE(option) ((option) & ONIG_OPTION_ASCII_RANGE) -#define IS_POSIX_BRACKET_ALL_RANGE(option) ((option) & ONIG_OPTION_POSIX_BRACKET_ALL_RANGE) -#define IS_WORD_BOUND_ALL_RANGE(option) ((option) & ONIG_OPTION_WORD_BOUND_ALL_RANGE) -#define IS_NEWLINE_CRLF(option) ((option) & ONIG_OPTION_NEWLINE_CRLF) - -/* OP_SET_OPTION is required for these options. -#define IS_DYNAMIC_OPTION(option) \ - (((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0) -*/ -/* ignore-case and multibyte status are included in compiled code. */ -#define IS_DYNAMIC_OPTION(option) 0 - -#define DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag) \ - ((case_fold_flag) & ~INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) - -#define REPEAT_INFINITE -1 -#define IS_REPEAT_INFINITE(n) ((n) == REPEAT_INFINITE) - -/* bitset */ -#define BITS_PER_BYTE 8 -#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE) -#define BITS_IN_ROOM ((int )sizeof(Bits) * BITS_PER_BYTE) -#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM) - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS -typedef unsigned int Bits; -#else -typedef unsigned char Bits; -#endif -typedef Bits BitSet[BITSET_SIZE]; -typedef Bits* BitSetRef; - -#define SIZE_BITSET (int )sizeof(BitSet) - -#define BITSET_CLEAR(bs) do {\ - int i;\ - for (i = 0; i < BITSET_SIZE; i++) { (bs)[i] = 0; } \ -} while (0) - -#define BS_ROOM(bs,pos) (bs)[(int )(pos) / BITS_IN_ROOM] -#define BS_BIT(pos) (1U << ((int )(pos) % BITS_IN_ROOM)) - -#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos)) -#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos) -#define BITSET_CLEAR_BIT(bs, pos) BS_ROOM(bs,pos) &= ~(BS_BIT(pos)) -#define BITSET_INVERT_BIT(bs, pos) BS_ROOM(bs,pos) ^= BS_BIT(pos) - -/* bytes buffer */ -typedef struct _BBuf { - UChar* p; - unsigned int used; - unsigned int alloc; -} BBuf; - -#define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size)) - -#define BBUF_SIZE_INC(buf,inc) do{\ - UChar *tmp;\ - (buf)->alloc += (inc);\ - tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ - (buf)->p = tmp;\ -} while (0) - -#define BBUF_EXPAND(buf,low) do{\ - UChar *tmp;\ - do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\ - tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ - (buf)->p = tmp;\ -} while (0) - -#define BBUF_ENSURE_SIZE(buf,size) do{\ - unsigned int new_alloc = (buf)->alloc;\ - while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\ - if ((buf)->alloc != new_alloc) {\ - UChar *tmp;\ - tmp = (UChar* )xrealloc((buf)->p, new_alloc);\ - if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ - (buf)->p = tmp;\ - (buf)->alloc = new_alloc;\ - }\ -} while (0) - -#define BBUF_WRITE(buf,pos,bytes,n) do{\ - int used = (pos) + (int )(n);\ - if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\ - xmemcpy((buf)->p + (pos), (bytes), (n));\ - if ((buf)->used < (unsigned int )used) (buf)->used = used;\ -} while (0) - -#define BBUF_WRITE1(buf,pos,byte) do{\ - int used = (pos) + 1;\ - if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\ - (buf)->p[(pos)] = (UChar )(byte);\ - if ((buf)->used < (unsigned int )used) (buf)->used = used;\ -} while (0) - -#define BBUF_ADD(buf,bytes,n) BBUF_WRITE((buf),(buf)->used,(bytes),(n)) -#define BBUF_ADD1(buf,byte) BBUF_WRITE1((buf),(buf)->used,(byte)) -#define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used) -#define BBUF_GET_OFFSET_POS(buf) ((buf)->used) - -/* from < to */ -#define BBUF_MOVE_RIGHT(buf,from,to,n) do {\ - if ((unsigned int )((to)+(n)) > (buf)->alloc) BBUF_EXPAND((buf),(to) + (n));\ - xmemmove((buf)->p + (to), (buf)->p + (from), (n));\ - if ((unsigned int )((to)+(n)) > (buf)->used) (buf)->used = (to) + (n);\ -} while (0) - -/* from > to */ -#define BBUF_MOVE_LEFT(buf,from,to,n) do {\ - xmemmove((buf)->p + (to), (buf)->p + (from), (n));\ -} while (0) - -/* from > to */ -#define BBUF_MOVE_LEFT_REDUCE(buf,from,to) do {\ - xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from));\ - (buf)->used -= (from - to);\ -} while (0) - -#define BBUF_INSERT(buf,pos,bytes,n) do {\ - if (pos >= (buf)->used) {\ - BBUF_WRITE(buf,pos,bytes,n);\ - }\ - else {\ - BBUF_MOVE_RIGHT((buf),(pos),(pos) + (n),((buf)->used - (pos)));\ - xmemcpy((buf)->p + (pos), (bytes), (n));\ - }\ -} while (0) - -#define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)] - - -#define ANCHOR_BEGIN_BUF (1<<0) -#define ANCHOR_BEGIN_LINE (1<<1) -#define ANCHOR_BEGIN_POSITION (1<<2) -#define ANCHOR_END_BUF (1<<3) -#define ANCHOR_SEMI_END_BUF (1<<4) -#define ANCHOR_END_LINE (1<<5) - -#define ANCHOR_WORD_BOUND (1<<6) -#define ANCHOR_NOT_WORD_BOUND (1<<7) -#define ANCHOR_WORD_BEGIN (1<<8) -#define ANCHOR_WORD_END (1<<9) -#define ANCHOR_PREC_READ (1<<10) -#define ANCHOR_PREC_READ_NOT (1<<11) -#define ANCHOR_LOOK_BEHIND (1<<12) -#define ANCHOR_LOOK_BEHIND_NOT (1<<13) - -#define ANCHOR_ANYCHAR_STAR (1<<14) /* ".*" optimize info */ -#define ANCHOR_ANYCHAR_STAR_ML (1<<15) /* ".*" optimize info (multi-line) */ - -#define ANCHOR_KEEP (1<<16) - -/* operation code */ -enum OpCode { - OP_FINISH = 0, /* matching process terminator (no more alternative) */ - OP_END = 1, /* pattern code terminator (success end) */ - - OP_EXACT1 = 2, /* single byte, N = 1 */ - OP_EXACT2, /* single byte, N = 2 */ - OP_EXACT3, /* single byte, N = 3 */ - OP_EXACT4, /* single byte, N = 4 */ - OP_EXACT5, /* single byte, N = 5 */ - OP_EXACTN, /* single byte */ - OP_EXACTMB2N1, /* mb-length = 2 N = 1 */ - OP_EXACTMB2N2, /* mb-length = 2 N = 2 */ - OP_EXACTMB2N3, /* mb-length = 2 N = 3 */ - OP_EXACTMB2N, /* mb-length = 2 */ - OP_EXACTMB3N, /* mb-length = 3 */ - OP_EXACTMBN, /* other length */ - - OP_EXACT1_IC, /* single byte, N = 1, ignore case */ - OP_EXACTN_IC, /* single byte, ignore case */ - - OP_CCLASS, - OP_CCLASS_MB, - OP_CCLASS_MIX, - OP_CCLASS_NOT, - OP_CCLASS_MB_NOT, - OP_CCLASS_MIX_NOT, - - OP_ANYCHAR, /* "." */ - OP_ANYCHAR_ML, /* "." multi-line */ - OP_ANYCHAR_STAR, /* ".*" */ - OP_ANYCHAR_ML_STAR, /* ".*" multi-line */ - OP_ANYCHAR_STAR_PEEK_NEXT, - OP_ANYCHAR_ML_STAR_PEEK_NEXT, - - OP_WORD, - OP_NOT_WORD, - OP_WORD_BOUND, - OP_NOT_WORD_BOUND, - OP_WORD_BEGIN, - OP_WORD_END, - - OP_ASCII_WORD, - OP_NOT_ASCII_WORD, - OP_ASCII_WORD_BOUND, - OP_NOT_ASCII_WORD_BOUND, - OP_ASCII_WORD_BEGIN, - OP_ASCII_WORD_END, - - OP_BEGIN_BUF, - OP_END_BUF, - OP_BEGIN_LINE, - OP_END_LINE, - OP_SEMI_END_BUF, - OP_BEGIN_POSITION, - - OP_BACKREF1, - OP_BACKREF2, - OP_BACKREFN, - OP_BACKREFN_IC, - OP_BACKREF_MULTI, - OP_BACKREF_MULTI_IC, - OP_BACKREF_WITH_LEVEL, /* \k, \k */ - - OP_MEMORY_START, - OP_MEMORY_START_PUSH, /* push back-tracker to stack */ - OP_MEMORY_END_PUSH, /* push back-tracker to stack */ - OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */ - OP_MEMORY_END, - OP_MEMORY_END_REC, /* push marker to stack */ - - OP_KEEP, - - OP_FAIL, /* pop stack and move */ - OP_JUMP, - OP_PUSH, - OP_POP, - OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */ - OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */ - OP_REPEAT, /* {n,m} */ - OP_REPEAT_NG, /* {n,m}? (non greedy) */ - OP_REPEAT_INC, - OP_REPEAT_INC_NG, /* non greedy */ - OP_REPEAT_INC_SG, /* search and get in stack */ - OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */ - OP_NULL_CHECK_START, /* null loop checker start */ - OP_NULL_CHECK_END, /* null loop checker end */ - OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */ - OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */ - - OP_PUSH_POS, /* (?=...) start */ - OP_POP_POS, /* (?=...) end */ - OP_PUSH_POS_NOT, /* (?!...) start */ - OP_FAIL_POS, /* (?!...) end */ - OP_PUSH_STOP_BT, /* (?>...) start */ - OP_POP_STOP_BT, /* (?>...) end */ - OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */ - OP_PUSH_LOOK_BEHIND_NOT, /* (? */ - OP_RETURN, - - OP_CONDITION, - - OP_STATE_CHECK_PUSH, /* combination explosion check and push */ - OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */ - OP_STATE_CHECK, /* check only */ - OP_STATE_CHECK_ANYCHAR_STAR, - OP_STATE_CHECK_ANYCHAR_ML_STAR, - - /* no need: IS_DYNAMIC_OPTION() == 0 */ - OP_SET_OPTION_PUSH, /* set option and push recover option */ - OP_SET_OPTION /* set option */ -}; - -typedef int RelAddrType; -typedef int AbsAddrType; -typedef int LengthType; -typedef int RepeatNumType; -typedef short int MemNumType; -typedef short int StateCheckNumType; -typedef void* PointerType; - -#define SIZE_OPCODE 1 -#define SIZE_RELADDR (int )sizeof(RelAddrType) -#define SIZE_ABSADDR (int )sizeof(AbsAddrType) -#define SIZE_LENGTH (int )sizeof(LengthType) -#define SIZE_MEMNUM (int )sizeof(MemNumType) -#define SIZE_STATE_CHECK_NUM (int )sizeof(StateCheckNumType) -#define SIZE_REPEATNUM (int )sizeof(RepeatNumType) -#define SIZE_OPTION (int )sizeof(OnigOptionType) -#define SIZE_CODE_POINT (int )sizeof(OnigCodePoint) -#define SIZE_POINTER (int )sizeof(PointerType) - - -#define GET_RELADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, RelAddrType) -#define GET_ABSADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, AbsAddrType) -#define GET_LENGTH_INC(len,p) PLATFORM_GET_INC(len, p, LengthType) -#define GET_MEMNUM_INC(num,p) PLATFORM_GET_INC(num, p, MemNumType) -#define GET_REPEATNUM_INC(num,p) PLATFORM_GET_INC(num, p, RepeatNumType) -#define GET_OPTION_INC(option,p) PLATFORM_GET_INC(option, p, OnigOptionType) -#define GET_POINTER_INC(ptr,p) PLATFORM_GET_INC(ptr, p, PointerType) -#define GET_STATE_CHECK_NUM_INC(num,p) PLATFORM_GET_INC(num, p, StateCheckNumType) - -/* code point's address must be aligned address. */ -#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p)) -#define GET_BYTE_INC(byte,p) do{\ - byte = *(p);\ - (p)++;\ -} while(0) - - -/* op-code + arg size */ -#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE -#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1) -#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_POP SIZE_OPCODE -#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1) -#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1) -#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_PUSH_POS SIZE_OPCODE -#define SIZE_OP_PUSH_POS_NOT (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_POP_POS SIZE_OPCODE -#define SIZE_OP_FAIL_POS SIZE_OPCODE -#define SIZE_OP_SET_OPTION (SIZE_OPCODE + SIZE_OPTION) -#define SIZE_OP_SET_OPTION_PUSH (SIZE_OPCODE + SIZE_OPTION) -#define SIZE_OP_FAIL SIZE_OPCODE -#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_PUSH_STOP_BT SIZE_OPCODE -#define SIZE_OP_POP_STOP_BT SIZE_OPCODE -#define SIZE_OP_NULL_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_NULL_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH) -#define SIZE_OP_PUSH_LOOK_BEHIND_NOT (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH) -#define SIZE_OP_FAIL_LOOK_BEHIND_NOT SIZE_OPCODE -#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR) -#define SIZE_OP_RETURN SIZE_OPCODE -#define SIZE_OP_CONDITION (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR) -#define SIZE_OP_PUSH_ABSENT_POS SIZE_OPCODE -#define SIZE_OP_ABSENT (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_ABSENT_END SIZE_OPCODE - -#ifdef USE_COMBINATION_EXPLOSION_CHECK -# define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) -# define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR) -# define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR) -# define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) -#endif - -#define MC_ESC(syn) (syn)->meta_char_table.esc -#define MC_ANYCHAR(syn) (syn)->meta_char_table.anychar -#define MC_ANYTIME(syn) (syn)->meta_char_table.anytime -#define MC_ZERO_OR_ONE_TIME(syn) (syn)->meta_char_table.zero_or_one_time -#define MC_ONE_OR_MORE_TIME(syn) (syn)->meta_char_table.one_or_more_time -#define MC_ANYCHAR_ANYTIME(syn) (syn)->meta_char_table.anychar_anytime - -#define IS_MC_ESC_CODE(code, syn) \ - ((code) == MC_ESC(syn) && \ - !IS_SYNTAX_OP2((syn), ONIG_SYN_OP2_INEFFECTIVE_ESCAPE)) - - -#define SYN_POSIX_COMMON_OP \ - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET | \ - ONIG_SYN_OP_DECIMAL_BACKREF | \ - ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_ASTERISK_ZERO_INF | \ - ONIG_SYN_OP_LINE_ANCHOR | \ - ONIG_SYN_OP_ESC_CONTROL_CHARS ) - -#define SYN_GNU_REGEX_OP \ - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | \ - ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_DECIMAL_BACKREF | \ - ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_LPAREN_SUBEXP | \ - ONIG_SYN_OP_VBAR_ALT | \ - ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF | \ - ONIG_SYN_OP_QMARK_ZERO_ONE | \ - ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR | ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR | \ - ONIG_SYN_OP_ESC_W_WORD | \ - ONIG_SYN_OP_ESC_B_WORD_BOUND | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | \ - ONIG_SYN_OP_ESC_S_WHITE_SPACE | ONIG_SYN_OP_ESC_D_DIGIT | \ - ONIG_SYN_OP_LINE_ANCHOR ) - -#define SYN_GNU_REGEX_BV \ - ( ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | \ - ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | ONIG_SYN_ALLOW_INVALID_INTERVAL | \ - ONIG_SYN_BACKSLASH_ESCAPE_IN_CC | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC ) - - -#define NCCLASS_FLAGS(cc) ((cc)->flags) -#define NCCLASS_FLAG_SET(cc,flag) (NCCLASS_FLAGS(cc) |= (flag)) -#define NCCLASS_FLAG_CLEAR(cc,flag) (NCCLASS_FLAGS(cc) &= ~(flag)) -#define IS_NCCLASS_FLAG_ON(cc,flag) ((NCCLASS_FLAGS(cc) & (flag)) != 0) - -/* cclass node */ -#define FLAG_NCCLASS_NOT (1<<0) - -#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT) -#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT) -#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT) - -typedef struct { - int type; - /* struct _Node* next; */ - /* unsigned int flags; */ -} NodeBase; - -typedef struct { - NodeBase base; - unsigned int flags; - BitSet bs; - BBuf* mbuf; /* multi-byte info or NULL */ -} CClassNode; - -typedef intptr_t OnigStackIndex; - -typedef struct _OnigStackType { - unsigned int type; - OnigStackIndex null_check; - union { - struct { - UChar *pcode; /* byte code position */ - UChar *pstr; /* string position */ - UChar *pstr_prev; /* previous char position of pstr */ -#ifdef USE_COMBINATION_EXPLOSION_CHECK - unsigned int state_check; -#endif - UChar *pkeep; /* keep pattern position */ - } state; - struct { - int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */ - UChar *pcode; /* byte code position (head of repeated target) */ - int num; /* repeat id */ - } repeat; - struct { - OnigStackIndex si; /* index of stack */ - } repeat_inc; - struct { - int num; /* memory num */ - UChar *pstr; /* start/end position */ - /* Following information is set, if this stack type is MEM-START */ - OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */ - OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */ - } mem; - struct { - int num; /* null check id */ - UChar *pstr; /* start position */ - } null_check; -#ifdef USE_SUBEXP_CALL - struct { - UChar *ret_addr; /* byte code position */ - int num; /* null check id */ - UChar *pstr; /* string position */ - } call_frame; -#endif - struct { - UChar *abs_pstr; /* absent start position */ - const UChar *end_pstr; /* end position */ - } absent_pos; -#ifdef USE_MATCH_CACHE - struct { - long index; /* index of the match cache buffer */ - uint8_t mask; /* bit-mask for the match cache buffer */ - } match_cache_point; -#endif - } u; -} OnigStackType; - -#ifdef USE_MATCH_CACHE -typedef struct { - UChar *addr; - long cache_point; - int outer_repeat_mem; - long num_cache_points_at_outer_repeat; - long num_cache_points_in_outer_repeat; - int lookaround_nesting; - UChar *match_addr; -} OnigCacheOpcode; -#endif - -typedef struct { - void* stack_p; - size_t stack_n; - OnigOptionType options; - OnigRegion* region; - const UChar* start; /* search start position */ - const UChar* gpos; /* global position (for \G: BEGIN_POSITION) */ -#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE - OnigPosition best_len; /* for ONIG_OPTION_FIND_LONGEST */ - UChar* best_s; -#endif -#ifdef USE_COMBINATION_EXPLOSION_CHECK - void* state_check_buff; - int state_check_buff_size; -#endif - int counter; - /* rb_hrtime_t from hrtime.h */ -#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL - int128_t end_time; -#else - uint64_t end_time; -#endif -#ifdef USE_MATCH_CACHE - int match_cache_status; - long num_fails; - long num_cache_opcodes; - OnigCacheOpcode* cache_opcodes; - long num_cache_points; - uint8_t* match_cache_buf; -#endif -} OnigMatchArg; - -#define NUM_CACHE_OPCODES_UNINIT 1 -#define NUM_CACHE_OPCODES_IMPOSSIBLE -1 - -#define MATCH_CACHE_STATUS_UNINIT 1 -#define MATCH_CACHE_STATUS_INIT 2 -#define MATCH_CACHE_STATUS_DISABLED -1 -#define MATCH_CACHE_STATUS_ENABLED 0 - -#define IS_CODE_SB_WORD(enc,code) \ - (ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code)) - -typedef struct OnigEndCallListItem { - struct OnigEndCallListItem* next; - void (*func)(void); -} OnigEndCallListItemType; - -extern void onig_add_end_call(void (*func)(void)); - - -#ifdef ONIG_DEBUG - -typedef struct { - short int opcode; - const char* name; - short int arg_type; -} OnigOpInfoType; - -extern OnigOpInfoType OnigOpInfo[]; - - -extern void onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc); - -# ifdef ONIG_DEBUG_STATISTICS -extern void onig_statistics_init(void); -extern void onig_print_statistics(FILE* f); -# endif -#endif - -#ifndef PRINTF_ARGS -#define PRINTF_ARGS(func, fmt, vargs) func -#endif - -extern UChar* onig_error_code_to_format(OnigPosition code); -PRINTF_ARGS(extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, va_list args), 6, 0); -PRINTF_ARGS(extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, ...), 6, 7); -extern int onig_bbuf_init(BBuf* buf, OnigDistance size); -extern int onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo); -#ifdef RUBY -extern int onig_compile_ruby(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo, const char *sourcefile, int sourceline); -#endif -extern void onig_transfer(regex_t* to, regex_t* from); -extern int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc); -extern int onig_is_code_in_cc_len(int enclen, OnigCodePoint code, CClassNode* cc); - -/* strend hash */ -typedef void hash_table_type; -#ifdef RUBY -# include "ruby/st.h" -#else -# include "st.h" -#endif -typedef st_data_t hash_data_type; - -extern hash_table_type* onig_st_init_strend_table_with_size(st_index_t size); -extern int onig_st_lookup_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value); -extern int onig_st_insert_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value); - -#ifdef RUBY -extern size_t onig_memsize(const regex_t *reg); -extern size_t onig_region_memsize(const struct re_registers *regs); -bool rb_reg_timeout_p(regex_t *reg, void *end_time); -NORETURN(void rb_reg_raise_timeout(void)); -#endif - -RUBY_SYMBOL_EXPORT_END - -#endif /* ONIGMO_REGINT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h deleted file mode 100644 index de980d0..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h +++ /dev/null @@ -1,371 +0,0 @@ -#ifndef ONIGMO_REGPARSE_H -#define ONIGMO_REGPARSE_H -/********************************************************************** - regparse.h - Onigmo (Oniguruma-mod) (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2007 K.Kosako - * Copyright (c) 2011-2016 K.Takata - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "regint.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -/* node type */ -#define NT_STR 0 -#define NT_CCLASS 1 -#define NT_CTYPE 2 -#define NT_CANY 3 -#define NT_BREF 4 -#define NT_QTFR 5 -#define NT_ENCLOSE 6 -#define NT_ANCHOR 7 -#define NT_LIST 8 -#define NT_ALT 9 -#define NT_CALL 10 - -/* node type bit */ -#define NTYPE2BIT(type) (1<<(type)) - -#define BIT_NT_STR NTYPE2BIT(NT_STR) -#define BIT_NT_CCLASS NTYPE2BIT(NT_CCLASS) -#define BIT_NT_CTYPE NTYPE2BIT(NT_CTYPE) -#define BIT_NT_CANY NTYPE2BIT(NT_CANY) -#define BIT_NT_BREF NTYPE2BIT(NT_BREF) -#define BIT_NT_QTFR NTYPE2BIT(NT_QTFR) -#define BIT_NT_ENCLOSE NTYPE2BIT(NT_ENCLOSE) -#define BIT_NT_ANCHOR NTYPE2BIT(NT_ANCHOR) -#define BIT_NT_LIST NTYPE2BIT(NT_LIST) -#define BIT_NT_ALT NTYPE2BIT(NT_ALT) -#define BIT_NT_CALL NTYPE2BIT(NT_CALL) - -#define IS_NODE_TYPE_SIMPLE(type) \ - ((NTYPE2BIT(type) & (BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE |\ - BIT_NT_CANY | BIT_NT_BREF)) != 0) - -#define NTYPE(node) ((node)->u.base.type) -#define SET_NTYPE(node, ntype) \ - do { \ - int value = ntype; \ - memcpy(&((node)->u.base.type), &value, sizeof(int)); \ - } while (0) - -#define NSTR(node) (&((node)->u.str)) -#define NCCLASS(node) (&((node)->u.cclass)) -#define NCTYPE(node) (&((node)->u.ctype)) -#define NBREF(node) (&((node)->u.bref)) -#define NQTFR(node) (&((node)->u.qtfr)) -#define NENCLOSE(node) (&((node)->u.enclose)) -#define NANCHOR(node) (&((node)->u.anchor)) -#define NCONS(node) (&((node)->u.cons)) -#define NCALL(node) (&((node)->u.call)) - -#define NCAR(node) (NCONS(node)->car) -#define NCDR(node) (NCONS(node)->cdr) - - - -#define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML) -#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF) - -#define ENCLOSE_MEMORY (1<<0) -#define ENCLOSE_OPTION (1<<1) -#define ENCLOSE_STOP_BACKTRACK (1<<2) -#define ENCLOSE_CONDITION (1<<3) -#define ENCLOSE_ABSENT (1<<4) - -#define NODE_STR_MARGIN 16 -#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */ -#define NODE_BACKREFS_SIZE 6 - -#define NSTR_RAW (1<<0) /* by backslashed number */ -#define NSTR_AMBIG (1<<1) -#define NSTR_DONT_GET_OPT_INFO (1<<2) - -#define NSTRING_LEN(node) (OnigDistance )((node)->u.str.end - (node)->u.str.s) -#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW -#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW -#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG -#define NSTRING_SET_DONT_GET_OPT_INFO(node) \ - (node)->u.str.flag |= NSTR_DONT_GET_OPT_INFO -#define NSTRING_IS_RAW(node) (((node)->u.str.flag & NSTR_RAW) != 0) -#define NSTRING_IS_AMBIG(node) (((node)->u.str.flag & NSTR_AMBIG) != 0) -#define NSTRING_IS_DONT_GET_OPT_INFO(node) \ - (((node)->u.str.flag & NSTR_DONT_GET_OPT_INFO) != 0) - -#define BACKREFS_P(br) \ - (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static); - -#define NQ_TARGET_ISNOT_EMPTY 0 -#define NQ_TARGET_IS_EMPTY 1 -#define NQ_TARGET_IS_EMPTY_MEM 2 -#define NQ_TARGET_IS_EMPTY_REC 3 - -/* status bits */ -#define NST_MIN_FIXED (1<<0) -#define NST_MAX_FIXED (1<<1) -#define NST_CLEN_FIXED (1<<2) -#define NST_MARK1 (1<<3) -#define NST_MARK2 (1<<4) -#define NST_MEM_BACKREFED (1<<5) -#define NST_STOP_BT_SIMPLE_REPEAT (1<<6) -#define NST_RECURSION (1<<7) -#define NST_CALLED (1<<8) -#define NST_ADDR_FIXED (1<<9) -#define NST_NAMED_GROUP (1<<10) -#define NST_NAME_REF (1<<11) -#define NST_IN_REPEAT (1<<12) /* STK_REPEAT is nested in stack. */ -#define NST_NEST_LEVEL (1<<13) -#define NST_BY_NUMBER (1<<14) /* {n,m} */ - -#define SET_ENCLOSE_STATUS(node,f) (node)->u.enclose.state |= (f) -#define CLEAR_ENCLOSE_STATUS(node,f) (node)->u.enclose.state &= ~(f) - -#define IS_ENCLOSE_CALLED(en) (((en)->state & NST_CALLED) != 0) -#define IS_ENCLOSE_ADDR_FIXED(en) (((en)->state & NST_ADDR_FIXED) != 0) -#define IS_ENCLOSE_RECURSION(en) (((en)->state & NST_RECURSION) != 0) -#define IS_ENCLOSE_MARK1(en) (((en)->state & NST_MARK1) != 0) -#define IS_ENCLOSE_MARK2(en) (((en)->state & NST_MARK2) != 0) -#define IS_ENCLOSE_MIN_FIXED(en) (((en)->state & NST_MIN_FIXED) != 0) -#define IS_ENCLOSE_MAX_FIXED(en) (((en)->state & NST_MAX_FIXED) != 0) -#define IS_ENCLOSE_CLEN_FIXED(en) (((en)->state & NST_CLEN_FIXED) != 0) -#define IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(en) \ - (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0) -#define IS_ENCLOSE_NAMED_GROUP(en) (((en)->state & NST_NAMED_GROUP) != 0) -#define IS_ENCLOSE_NAME_REF(en) (((en)->state & NST_NAME_REF) != 0) - -#define SET_CALL_RECURSION(node) (node)->u.call.state |= NST_RECURSION -#define IS_CALL_RECURSION(cn) (((cn)->state & NST_RECURSION) != 0) -#define IS_CALL_NAME_REF(cn) (((cn)->state & NST_NAME_REF) != 0) -#define IS_BACKREF_NAME_REF(bn) (((bn)->state & NST_NAME_REF) != 0) -#define IS_BACKREF_NEST_LEVEL(bn) (((bn)->state & NST_NEST_LEVEL) != 0) -#define IS_QUANTIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0) -#define IS_QUANTIFIER_BY_NUMBER(qn) (((qn)->state & NST_BY_NUMBER) != 0) - -#define CALLNODE_REFNUM_UNDEF -1 - -typedef struct { - NodeBase base; - UChar* s; - UChar* end; - unsigned int flag; - int capa; /* (allocated size - 1) or 0: use buf[] */ - UChar buf[NODE_STR_BUF_SIZE]; -} StrNode; - -typedef struct { - NodeBase base; - int state; - struct _Node* target; - int lower; - int upper; - int greedy; - int target_empty_info; - struct _Node* head_exact; - struct _Node* next_head_exact; - int is_referred; /* include called node. don't eliminate even if {0} */ -#ifdef USE_COMBINATION_EXPLOSION_CHECK - int comb_exp_check_num; /* 1,2,3...: check, 0: no check */ -#endif -} QtfrNode; - -typedef struct { - NodeBase base; - int state; - int type; - int regnum; - OnigOptionType option; - AbsAddrType call_addr; - struct _Node* target; - /* for multiple call reference */ - OnigDistance min_len; /* min length (byte) */ - OnigDistance max_len; /* max length (byte) */ - int char_len; /* character length */ - int opt_count; /* referenced count in optimize_node_left() */ -} EncloseNode; - -#ifdef USE_SUBEXP_CALL - -typedef struct { - int offset; - struct _Node* target; -} UnsetAddr; - -typedef struct { - int num; - int alloc; - UnsetAddr* us; -} UnsetAddrList; - -typedef struct { - NodeBase base; - int state; - int group_num; - UChar* name; - UChar* name_end; - struct _Node* target; /* EncloseNode : ENCLOSE_MEMORY */ - UnsetAddrList* unset_addr_list; -} CallNode; - -#endif - -typedef struct { - NodeBase base; - int state; - int back_num; - int back_static[NODE_BACKREFS_SIZE]; - int* back_dynamic; - int nest_level; -} BRefNode; - -typedef struct { - NodeBase base; - int type; - struct _Node* target; - int char_len; - int ascii_range; -} AnchorNode; - -typedef struct { - NodeBase base; - struct _Node* car; - struct _Node* cdr; -} ConsAltNode; - -typedef struct { - NodeBase base; - int ctype; - int not; - int ascii_range; -} CtypeNode; - -typedef struct _Node { - union { - NodeBase base; - StrNode str; - CClassNode cclass; - QtfrNode qtfr; - EncloseNode enclose; - BRefNode bref; - AnchorNode anchor; - ConsAltNode cons; - CtypeNode ctype; -#ifdef USE_SUBEXP_CALL - CallNode call; -#endif - } u; -} Node; - - -#define NULL_NODE ((Node* )0) - -#define SCANENV_MEMNODES_SIZE 8 -#define SCANENV_MEM_NODES(senv) \ - (IS_NOT_NULL((senv)->mem_nodes_dynamic) ? \ - (senv)->mem_nodes_dynamic : (senv)->mem_nodes_static) - -typedef struct { - OnigOptionType option; - OnigCaseFoldType case_fold_flag; - OnigEncoding enc; - const OnigSyntaxType* syntax; - BitStatusType capture_history; - BitStatusType bt_mem_start; - BitStatusType bt_mem_end; - BitStatusType backrefed_mem; - UChar* pattern; - UChar* pattern_end; - UChar* error; - UChar* error_end; - regex_t* reg; /* for reg->names only */ -#ifdef USE_SUBEXP_CALL - UnsetAddrList* unset_addr_list; -#endif - int num_call; - int num_mem; -#ifdef USE_NAMED_GROUP - int num_named; -#endif - int mem_alloc; - Node* mem_nodes_static[SCANENV_MEMNODES_SIZE]; - Node** mem_nodes_dynamic; -#ifdef USE_COMBINATION_EXPLOSION_CHECK - int num_comb_exp_check; - int comb_exp_max_regnum; - int curr_max_regnum; - int has_recursion; -#endif - unsigned int parse_depth; - int warnings_flag; -#ifdef RUBY - const char* sourcefile; - int sourceline; -#endif -} ScanEnv; - - -#define IS_SYNTAX_OP(syn, opm) (((syn)->op & (opm)) != 0) -#define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0) -#define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0) - -#ifdef USE_NAMED_GROUP -typedef struct { - int new_val; -} GroupNumRemap; - -extern int onig_renumber_name_table(regex_t* reg, GroupNumRemap* map); -#endif - -extern int onig_strncmp(const UChar* s1, const UChar* s2, size_t n); -extern void onig_strcpy(UChar* dest, const UChar* src, const UChar* end); -extern void onig_scan_env_set_error_string(ScanEnv* env, int ecode, UChar* arg, UChar* arg_end); -extern int onig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc); -extern void onig_reduce_nested_quantifier(Node* pnode, Node* cnode); -extern void onig_node_conv_to_str_node(Node* node, int raw); -extern int onig_node_str_cat(Node* node, const UChar* s, const UChar* end); -extern int onig_node_str_set(Node* node, const UChar* s, const UChar* end); -extern void onig_node_free(Node* node); -extern Node* onig_node_new_enclose(int type); -extern Node* onig_node_new_anchor(int type); -extern Node* onig_node_new_str(const UChar* s, const UChar* end); -extern Node* onig_node_new_list(Node* left, Node* right); -extern Node* onig_node_list_add(Node* list, Node* x); -extern Node* onig_node_new_alt(Node* left, Node* right); -extern void onig_node_str_clear(Node* node); -extern int onig_names_free(regex_t* reg); -extern int onig_names_copy(regex_t* reg, regex_t* oreg); -extern int onig_parse_make_tree(Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env); -extern int onig_free_shared_cclass_table(void); - -#ifdef ONIG_DEBUG -# ifdef USE_NAMED_GROUP -extern int onig_print_names(FILE*, regex_t*); -# endif -#endif - -RUBY_SYMBOL_EXPORT_END - -#endif /* ONIGMO_REGPARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h deleted file mode 100644 index 4a40e3f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +++ /dev/null @@ -1,5 +0,0 @@ -#define RUBY_REVISION "9d69619623" -#define RUBY_FULL_REVISION "9d69619623ec6b86c464b7cac911b7201f74dab7" -#define RUBY_RELEASE_YEAR 2024 -#define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 16 diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h deleted file mode 100644 index 26d1d67..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef RUBY_RJIT_H -#define RUBY_RJIT_H 1 -/********************************************************************** - - rjit.h - Interface to RJIT - - Copyright (C) 2023 Takashi Kokubun . - -**********************************************************************/ - -#include "ruby/internal/config.h" // defines USE_RJIT -#include "ruby/internal/stdbool.h" -#include "vm_core.h" - -# if USE_RJIT - -#include "ruby.h" -#include "vm_core.h" - -// RJIT options which can be defined on the MRI command line. -struct rb_rjit_options { - // Converted from "rjit" feature flag to tell the enablement - // information to ruby_show_version(). - bool on; - // Size of executable memory block in MiB - unsigned int exec_mem_size; - // Number of calls to trigger JIT compilation - unsigned int call_threshold; - // Collect RJIT statistics - bool stats; - // Do not start RJIT until RJIT.enable is called - bool disable; - // Allow TracePoint during JIT compilation - bool trace; - // Trace side exit locations - bool trace_exits; - // Enable disasm of all JIT code - bool dump_disasm; - // Verify context objects - bool verify_ctx; -}; - -RUBY_SYMBOL_EXPORT_BEGIN -RUBY_EXTERN struct rb_rjit_options rb_rjit_opts; -RUBY_EXTERN bool rb_rjit_call_p; - -#define rb_rjit_call_threshold() rb_rjit_opts.call_threshold - -extern void rb_rjit_compile(const rb_iseq_t *iseq); -RUBY_SYMBOL_EXPORT_END - -extern void rb_rjit_cancel_all(const char *reason); -extern void rb_rjit_init(const struct rb_rjit_options *opts); -extern void rb_rjit_free_iseq(const rb_iseq_t *iseq); -extern void rb_rjit_iseq_update_references(struct rb_iseq_constant_body *const body); -extern void rb_rjit_mark(void); -extern void rb_rjit_iseq_mark(VALUE rjit_blocks); -extern void rjit_notify_waitpid(int exit_code); - -extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -extern void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme); -extern void rb_rjit_before_ractor_spawn(void); -extern void rb_rjit_constant_state_changed(ID id); -extern void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); -extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); - -extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -extern void rb_rjit_before_ractor_spawn(void); -extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); -extern void rb_rjit_collect_vm_usage_insn(int insn); - -extern bool rb_rjit_enabled; -extern bool rb_rjit_stats_enabled; -extern bool rb_rjit_trace_exits_enabled; - -# else // USE_RJIT - -static inline void rb_rjit_compile(const rb_iseq_t *iseq){} - -static inline void rb_rjit_cancel_all(const char *reason){} -static inline void rb_rjit_free_iseq(const rb_iseq_t *iseq){} -static inline void rb_rjit_mark(void){} - -static inline void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} -static inline void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme) {} -static inline void rb_rjit_before_ractor_spawn(void) {} -static inline void rb_rjit_constant_state_changed(ID id) {} -static inline void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {} -static inline void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events) {} - -#define rb_rjit_enabled false -#define rb_rjit_call_p false -#define rb_rjit_stats_enabled false -#define rb_rjit_trace_exits_enabled false - -#define rb_rjit_call_threshold() UINT_MAX - -static inline void rb_rjit_collect_vm_usage_insn(int insn) {} - -# endif // USE_RJIT -#endif // RUBY_RJIT_H diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h deleted file mode 100644 index 029f811..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h +++ /dev/null @@ -1,165 +0,0 @@ -// This file is parsed by tool/rjit/generate.rb to generate rjit_c.rb -#ifndef RJIT_C_H -#define RJIT_C_H - -#include "ruby/internal/config.h" -#include "internal/string.h" -#include "internal/struct.h" -#include "internal/variable.h" -#include "vm_core.h" -#include "vm_callinfo.h" -#include "builtin.h" -#include "ccan/list/list.h" -#include "rjit.h" -#include "shape.h" - -extern uint8_t *rb_rjit_mem_block; - -#define RJIT_RUNTIME_COUNTERS(...) struct rb_rjit_runtime_counters { size_t __VA_ARGS__; }; -RJIT_RUNTIME_COUNTERS( - rjit_insns_count, - - send_args_splat_kw_splat, - send_args_splat, - send_args_splat_not_array, - send_args_splat_length_not_equal, - send_args_splat_cfunc_var_args, - send_args_splat_arity_error, - send_args_splat_ruby2_hash, - send_args_splat_cfunc_zuper, - send_args_splat_cfunc_ruby2_keywords, - send_kw_splat, - send_kwarg, - send_klass_megamorphic, - send_missing_cme, - send_private, - send_protected_check_failed, - send_tailcall, - send_notimplemented, - send_missing, - send_bmethod, - send_alias, - send_undef, - send_zsuper, - send_refined, - send_stackoverflow, - send_arity, - send_c_tracing, - send_is_a_class_mismatch, - send_instance_of_class_mismatch, - send_keywords, - - send_blockiseq, - send_block_handler, - send_block_setup, - send_block_not_nil, - send_block_not_proxy, - send_block_arg, - - send_iseq_kwparam, - send_iseq_accepts_no_kwarg, - send_iseq_has_opt, - send_iseq_has_kwrest, - send_iseq_ruby2_keywords, - send_iseq_has_rest_and_captured, - send_iseq_has_rest_and_kw_supplied, - send_iseq_has_no_kw, - send_iseq_zsuper, - send_iseq_materialized_block, - send_iseq_has_rest, - send_iseq_block_arg0_splat, - send_iseq_kw_call, - send_iseq_kw_splat, - send_iseq_splat, - send_iseq_has_rest_and_optional, - send_iseq_arity_error, - send_iseq_missing_optional_kw, - send_iseq_too_many_kwargs, - send_iseq_kwargs_mismatch, - send_iseq_splat_with_kw, - send_iseq_splat_arity_error, - send_iseq_has_rest_and_splat_not_equal, - - send_cfunc_variadic, - send_cfunc_too_many_args, - send_cfunc_ruby_array_varg, - send_cfunc_splat_with_kw, - send_cfunc_tracing, - send_cfunc_argc_mismatch, - send_cfunc_toomany_args, - - send_attrset_splat, - send_attrset_kwarg, - send_attrset_method, - - send_ivar_splat, - send_ivar_opt_send, - - send_optimized_send_no_args, - send_optimized_send_not_sym_or_str, - send_optimized_send_mid_class_changed, - send_optimized_send_mid_id_changed, - send_optimized_send_null_mid, - send_optimized_send_send, - send_optimized_call_block, - send_optimized_call_kwarg, - send_optimized_call_splat, - send_optimized_struct_aref_error, - - send_optimized_block_call, - send_optimized_struct_aset, - - send_bmethod_not_iseq, - send_bmethod_blockarg, - - invokesuper_me_changed, - invokesuper_block, - - invokeblock_none, - invokeblock_symbol, - invokeblock_proc, - invokeblock_tag_changed, - invokeblock_iseq_block_changed, - invokeblock_iseq_arity, - invokeblock_iseq_arg0_splat, - invokeblock_ifunc_args_splat, - invokeblock_ifunc_kw_splat, - invokeblock_iseq_arg0_args_splat, - invokeblock_iseq_arg0_has_kw, - - getivar_megamorphic, - getivar_not_heap, - getivar_special_const, - getivar_too_complex, - - optaref_arg_not_fixnum, - optaref_argc_not_one, - optaref_recv_not_array, - optaref_recv_not_hash, - optaref_send, - - optgetconst_not_cached, - optgetconst_cref, - optgetconst_cache_miss, - - setivar_frozen, - setivar_not_heap, - setivar_megamorphic, - setivar_too_complex, - - expandarray_splat, - expandarray_postarg, - expandarray_not_array, - expandarray_rhs_too_small, - - getblockpp_block_param_modified, - getblockpp_block_handler_none, - getblockpp_not_gc_guarded, - getblockpp_not_iseq_block, - - compiled_block_count -) -#undef RJIT_RUNTIME_COUNTERS -extern struct rb_rjit_runtime_counters rb_rjit_counters; - -#endif /* RJIT_C_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h deleted file mode 100644 index d8f7ddd..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef RUBY_TOPLEVEL_ASSERT_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_TOPLEVEL_ASSERT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ -#include "ruby/assert.h" -#undef assert -#define assert RUBY_ASSERT_NDEBUG - -#endif /* RUBY_TOPLEVEL_ASSERT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h deleted file mode 100644 index 57d3410..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h +++ /dev/null @@ -1,23 +0,0 @@ -#include "ruby/atomic.h" - -/* shim macros only */ -#define ATOMIC_ADD(var, val) RUBY_ATOMIC_ADD(var, val) -#define ATOMIC_CAS(var, oldval, newval) RUBY_ATOMIC_CAS(var, oldval, newval) -#define ATOMIC_DEC(var) RUBY_ATOMIC_DEC(var) -#define ATOMIC_EXCHANGE(var, val) RUBY_ATOMIC_EXCHANGE(var, val) -#define ATOMIC_FETCH_ADD(var, val) RUBY_ATOMIC_FETCH_ADD(var, val) -#define ATOMIC_FETCH_SUB(var, val) RUBY_ATOMIC_FETCH_SUB(var, val) -#define ATOMIC_INC(var) RUBY_ATOMIC_INC(var) -#define ATOMIC_OR(var, val) RUBY_ATOMIC_OR(var, val) -#define ATOMIC_PTR_CAS(var, oldval, newval) RUBY_ATOMIC_PTR_CAS(var, oldval, newval) -#define ATOMIC_PTR_EXCHANGE(var, val) RUBY_ATOMIC_PTR_EXCHANGE(var, val) -#define ATOMIC_SET(var, val) RUBY_ATOMIC_SET(var, val) -#define ATOMIC_SIZE_ADD(var, val) RUBY_ATOMIC_SIZE_ADD(var, val) -#define ATOMIC_SIZE_CAS(var, oldval, newval) RUBY_ATOMIC_SIZE_CAS(var, oldval, newval) -#define ATOMIC_SIZE_DEC(var) RUBY_ATOMIC_SIZE_DEC(var) -#define ATOMIC_SIZE_EXCHANGE(var, val) RUBY_ATOMIC_SIZE_EXCHANGE(var, val) -#define ATOMIC_SIZE_INC(var) RUBY_ATOMIC_SIZE_INC(var) -#define ATOMIC_SIZE_SUB(var, val) RUBY_ATOMIC_SIZE_SUB(var, val) -#define ATOMIC_SUB(var, val) RUBY_ATOMIC_SUB(var, val) -#define ATOMIC_VALUE_CAS(var, oldval, val) RUBY_ATOMIC_VALUE_CAS(var, oldval, val) -#define ATOMIC_VALUE_EXCHANGE(var, val) RUBY_ATOMIC_VALUE_EXCHANGE(var, val) diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h deleted file mode 100644 index fc8be96..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h +++ /dev/null @@ -1,1430 +0,0 @@ -#ifndef RUBY_RUBYPARSER_H -#define RUBY_RUBYPARSER_H 1 -/* - * This is a header file for librubyparser interface - */ - -#include /* for va_list */ -#include - -#ifdef UNIVERSAL_PARSER - -#define rb_encoding const void -#define OnigCodePoint unsigned int -#include "parser_st.h" -#ifndef RUBY_RUBY_H -#include "parser_value.h" -#endif - -#else - -#include "ruby/encoding.h" - -#endif - -#ifndef FLEX_ARY_LEN -/* From internal/compilers.h */ -/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define FLEX_ARY_LEN /* VALUE ary[]; */ -#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) -# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */ -#else -# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */ -#endif -#endif - -#if defined(__GNUC__) -# if defined(__MINGW_PRINTF_FORMAT) -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index))) -# else -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index))) -# endif -#elif defined(__clang__) -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index))) -#else -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) -#endif - -/* - * Parser String - */ -enum rb_parser_string_coderange_type { - /** The object's coderange is unclear yet. */ - RB_PARSER_ENC_CODERANGE_UNKNOWN = 0, - RB_PARSER_ENC_CODERANGE_7BIT = 1, - RB_PARSER_ENC_CODERANGE_VALID = 2, - RB_PARSER_ENC_CODERANGE_BROKEN = 3 -}; - -typedef struct rb_parser_string { - enum rb_parser_string_coderange_type coderange; - rb_encoding *enc; - /* Length of the string, not including terminating NUL character. */ - long len; - /* Pointer to the contents of the string. */ - char *ptr; -} rb_parser_string_t; - -enum rb_parser_shareability { - rb_parser_shareable_none, - rb_parser_shareable_literal, - rb_parser_shareable_copy, - rb_parser_shareable_everything, -}; - -typedef void* rb_parser_input_data; - -/* - * AST Node - */ -enum node_type { - NODE_SCOPE, - NODE_BLOCK, - NODE_IF, - NODE_UNLESS, - NODE_CASE, - NODE_CASE2, - NODE_CASE3, - NODE_WHEN, - NODE_IN, - NODE_WHILE, - NODE_UNTIL, - NODE_ITER, - NODE_FOR, - NODE_FOR_MASGN, - NODE_BREAK, - NODE_NEXT, - NODE_REDO, - NODE_RETRY, - NODE_BEGIN, - NODE_RESCUE, - NODE_RESBODY, - NODE_ENSURE, - NODE_AND, - NODE_OR, - NODE_MASGN, - NODE_LASGN, - NODE_DASGN, - NODE_GASGN, - NODE_IASGN, - NODE_CDECL, - NODE_CVASGN, - NODE_OP_ASGN1, - NODE_OP_ASGN2, - NODE_OP_ASGN_AND, - NODE_OP_ASGN_OR, - NODE_OP_CDECL, - NODE_CALL, - NODE_OPCALL, - NODE_FCALL, - NODE_VCALL, - NODE_QCALL, - NODE_SUPER, - NODE_ZSUPER, - NODE_LIST, - NODE_ZLIST, - NODE_HASH, - NODE_RETURN, - NODE_YIELD, - NODE_LVAR, - NODE_DVAR, - NODE_GVAR, - NODE_IVAR, - NODE_CONST, - NODE_CVAR, - NODE_NTH_REF, - NODE_BACK_REF, - NODE_MATCH, - NODE_MATCH2, - NODE_MATCH3, - NODE_INTEGER, - NODE_FLOAT, - NODE_RATIONAL, - NODE_IMAGINARY, - NODE_STR, - NODE_DSTR, - NODE_XSTR, - NODE_DXSTR, - NODE_EVSTR, - NODE_REGX, - NODE_DREGX, - NODE_ONCE, - NODE_ARGS, - NODE_ARGS_AUX, - NODE_OPT_ARG, - NODE_KW_ARG, - NODE_POSTARG, - NODE_ARGSCAT, - NODE_ARGSPUSH, - NODE_SPLAT, - NODE_BLOCK_PASS, - NODE_DEFN, - NODE_DEFS, - NODE_ALIAS, - NODE_VALIAS, - NODE_UNDEF, - NODE_CLASS, - NODE_MODULE, - NODE_SCLASS, - NODE_COLON2, - NODE_COLON3, - NODE_DOT2, - NODE_DOT3, - NODE_FLIP2, - NODE_FLIP3, - NODE_SELF, - NODE_NIL, - NODE_TRUE, - NODE_FALSE, - NODE_ERRINFO, - NODE_DEFINED, - NODE_POSTEXE, - NODE_SYM, - NODE_DSYM, - NODE_ATTRASGN, - NODE_LAMBDA, - NODE_ARYPTN, - NODE_HSHPTN, - NODE_FNDPTN, - NODE_ERROR, - NODE_LINE, - NODE_FILE, - NODE_ENCODING, - NODE_LAST -}; - -typedef struct rb_ast_id_table { - int size; - ID ids[FLEX_ARY_LEN]; -} rb_ast_id_table_t; - -typedef struct rb_code_position_struct { - int lineno; - int column; -} rb_code_position_t; - -typedef struct rb_code_location_struct { - rb_code_position_t beg_pos; - rb_code_position_t end_pos; -} rb_code_location_t; -#define YYLTYPE rb_code_location_t -#define YYLTYPE_IS_DECLARED 1 - -typedef struct rb_parser_ast_token { - int id; - const char *type_name; - rb_parser_string_t *str; - rb_code_location_t loc; -} rb_parser_ast_token_t; - -/* - * Array-like object for parser - */ -typedef void* rb_parser_ary_data; - -enum rb_parser_ary_data_type { - PARSER_ARY_DATA_AST_TOKEN, - PARSER_ARY_DATA_SCRIPT_LINE -}; - -typedef struct rb_parser_ary { - enum rb_parser_ary_data_type data_type; - rb_parser_ary_data *data; - long len; // current size - long capa; // capacity -} rb_parser_ary_t; - -/* Header part of AST Node */ -typedef struct RNode { - VALUE flags; - rb_code_location_t nd_loc; - int node_id; -} NODE; - -typedef struct RNode_SCOPE { - NODE node; - - rb_ast_id_table_t *nd_tbl; - struct RNode *nd_body; - struct RNode_ARGS *nd_args; -} rb_node_scope_t; - -typedef struct RNode_BLOCK { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_end; - struct RNode *nd_next; -} rb_node_block_t; - -typedef struct RNode_IF { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - struct RNode *nd_else; -} rb_node_if_t; - -typedef struct RNode_UNLESS { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - struct RNode *nd_else; -} rb_node_unless_t; - -typedef struct RNode_CASE { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_case_t; - -typedef struct RNode_CASE2 { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_case2_t; - -typedef struct RNode_CASE3 { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_case3_t; - -typedef struct RNode_WHEN { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - struct RNode *nd_next; -} rb_node_when_t; - -typedef struct RNode_IN { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - struct RNode *nd_next; -} rb_node_in_t; - -/* RNode_WHILE and RNode_UNTIL should be same structure */ -typedef struct RNode_WHILE { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - long nd_state; -} rb_node_while_t; - -typedef struct RNode_UNTIL { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - long nd_state; -} rb_node_until_t; - -/* RNode_ITER and RNode_FOR should be same structure */ -typedef struct RNode_ITER { - NODE node; - - struct RNode *nd_body; - struct RNode *nd_iter; -} rb_node_iter_t; - -typedef struct RNode_FOR { - NODE node; - - struct RNode *nd_body; - struct RNode *nd_iter; -} rb_node_for_t; - -typedef struct RNode_FOR_MASGN { - NODE node; - - struct RNode *nd_var; -} rb_node_for_masgn_t; - -/* RNode_BREAK, RNode_NEXT and RNode_REDO should be same structure */ -typedef struct RNode_BREAK { - NODE node; - - struct RNode *nd_chain; - struct RNode *nd_stts; -} rb_node_break_t; - -typedef struct RNode_NEXT { - NODE node; - - struct RNode *nd_chain; - struct RNode *nd_stts; -} rb_node_next_t; - -typedef struct RNode_REDO { - NODE node; - - struct RNode *nd_chain; -} rb_node_redo_t; - -typedef struct RNode_RETRY { - NODE node; -} rb_node_retry_t; - -typedef struct RNode_BEGIN { - NODE node; - - struct RNode *nd_body; -} rb_node_begin_t; - -typedef struct RNode_RESCUE { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_resq; - struct RNode *nd_else; -} rb_node_rescue_t; - -typedef struct RNode_RESBODY { - NODE node; - - struct RNode *nd_args; - struct RNode *nd_body; - struct RNode *nd_next; -} rb_node_resbody_t; - -typedef struct RNode_ENSURE { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_ensr; -} rb_node_ensure_t; - -/* RNode_AND and RNode_OR should be same structure */ -typedef struct RNode_AND { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; -} rb_node_and_t; - -typedef struct RNode_OR { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; -} rb_node_or_t; - -typedef struct RNode_MASGN { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; - struct RNode *nd_args; -} rb_node_masgn_t; - -typedef struct RNode_LASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_lasgn_t; - -typedef struct RNode_DASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_dasgn_t; - -typedef struct RNode_GASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_gasgn_t; - -typedef struct RNode_IASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_iasgn_t; - -typedef struct RNode_CDECL { - NODE node; - - ID nd_vid; - struct RNode *nd_value; - struct RNode *nd_else; - enum rb_parser_shareability shareability; -} rb_node_cdecl_t; - -typedef struct RNode_CVASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_cvasgn_t; - -typedef struct RNode_OP_ASGN1 { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_index; - struct RNode *nd_rvalue; -} rb_node_op_asgn1_t; - -typedef struct RNode_OP_ASGN2 { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_value; - ID nd_vid; - ID nd_mid; - bool nd_aid; -} rb_node_op_asgn2_t; - -typedef struct RNode_OP_ASGN_AND { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; -} rb_node_op_asgn_and_t; - -typedef struct RNode_OP_ASGN_OR { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; -} rb_node_op_asgn_or_t; - -typedef struct RNode_OP_CDECL { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; - ID nd_aid; - enum rb_parser_shareability shareability; -} rb_node_op_cdecl_t; - -typedef struct RNode_CALL { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_call_t; - -typedef struct RNode_OPCALL { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_opcall_t; - -typedef struct RNode_FCALL { - NODE node; - - ID nd_mid; - struct RNode *nd_args; -} rb_node_fcall_t; - -typedef struct RNode_VCALL { - NODE node; - - ID nd_mid; -} rb_node_vcall_t; - -typedef struct RNode_QCALL { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_qcall_t; - -typedef struct RNode_SUPER { - NODE node; - - struct RNode *nd_args; -} rb_node_super_t; - -typedef struct RNode_ZSUPER { - NODE node; -} rb_node_zsuper_t; - -/* - - Structure of LIST: - - LIST +--> LIST - * head --> element | * head - * alen (length of list) | * nd_end (point to the last LIST) - * next -----------------+ * next - - - RNode_LIST and RNode_VALUES should be same structure -*/ -typedef struct RNode_LIST { - NODE node; - - struct RNode *nd_head; /* element */ - union { - long nd_alen; - struct RNode *nd_end; /* Second list node has this structure */ - } as; - struct RNode *nd_next; /* next list node */ -} rb_node_list_t; - -typedef struct RNode_ZLIST { - NODE node; -} rb_node_zlist_t; - -typedef struct RNode_VALUES { - NODE node; - - struct RNode *nd_head; - long nd_alen; - struct RNode *nd_next; -} rb_node_values_t; - -typedef struct RNode_HASH { - NODE node; - - struct RNode *nd_head; - long nd_brace; -} rb_node_hash_t; - -typedef struct RNode_RETURN { - NODE node; - - struct RNode *nd_stts; -} rb_node_return_t; - -typedef struct RNode_YIELD { - NODE node; - - struct RNode *nd_head; -} rb_node_yield_t; - -typedef struct RNode_LVAR { - NODE node; - - ID nd_vid; -} rb_node_lvar_t; - -typedef struct RNode_DVAR { - NODE node; - - ID nd_vid; -} rb_node_dvar_t; - -typedef struct RNode_GVAR { - NODE node; - - ID nd_vid; -} rb_node_gvar_t; - -typedef struct RNode_IVAR { - NODE node; - - ID nd_vid; -} rb_node_ivar_t; - -typedef struct RNode_CONST { - NODE node; - - ID nd_vid; -} rb_node_const_t; - -typedef struct RNode_CVAR { - NODE node; - - ID nd_vid; -} rb_node_cvar_t; - -typedef struct RNode_NTH_REF { - NODE node; - - long nd_nth; -} rb_node_nth_ref_t; - -typedef struct RNode_BACK_REF { - NODE node; - - long nd_nth; -} rb_node_back_ref_t; - -/* RNode_MATCH and RNode_REGX should be same structure */ -typedef struct RNode_MATCH { - NODE node; - - struct rb_parser_string *string; - int options; -} rb_node_match_t; - -typedef struct RNode_MATCH2 { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_value; - struct RNode *nd_args; -} rb_node_match2_t; - -typedef struct RNode_MATCH3 { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_value; -} rb_node_match3_t; - -typedef struct RNode_INTEGER { - NODE node; - - char *val; - int minus; - int base; -} rb_node_integer_t; - -typedef struct RNode_FLOAT { - NODE node; - - char *val; - int minus; -} rb_node_float_t; - -typedef struct RNode_RATIONAL { - NODE node; - - char *val; - int minus; - int base; - int seen_point; -} rb_node_rational_t; - -enum rb_numeric_type { - integer_literal, - float_literal, - rational_literal -}; - -typedef struct RNode_IMAGINARY { - NODE node; - - char *val; - int minus; - int base; - int seen_point; - enum rb_numeric_type type; -} rb_node_imaginary_t; - -/* RNode_STR and RNode_XSTR should be same structure */ -typedef struct RNode_STR { - NODE node; - - struct rb_parser_string *string; -} rb_node_str_t; - -/* RNode_DSTR, RNode_DXSTR and RNode_DSYM should be same structure */ -typedef struct RNode_DSTR { - NODE node; - - struct rb_parser_string *string; - union { - long nd_alen; - struct RNode *nd_end; /* Second dstr node has this structure. See also RNode_LIST */ - } as; - struct RNode_LIST *nd_next; -} rb_node_dstr_t; - -typedef struct RNode_XSTR { - NODE node; - - struct rb_parser_string *string; -} rb_node_xstr_t; - -typedef struct RNode_DXSTR { - NODE node; - - struct rb_parser_string *string; - long nd_alen; - struct RNode_LIST *nd_next; -} rb_node_dxstr_t; - -typedef struct RNode_EVSTR { - NODE node; - - struct RNode *nd_body; -} rb_node_evstr_t; - -typedef struct RNode_REGX { - NODE node; - - struct rb_parser_string *string; - int options; -} rb_node_regx_t; - -typedef struct RNode_DREGX { - NODE node; - - struct rb_parser_string *string; - ID nd_cflag; - struct RNode_LIST *nd_next; -} rb_node_dregx_t; - -typedef struct RNode_ONCE { - NODE node; - - struct RNode *nd_body; -} rb_node_once_t; - -struct rb_args_info { - NODE *pre_init; - NODE *post_init; - - int pre_args_num; /* count of mandatory pre-arguments */ - int post_args_num; /* count of mandatory post-arguments */ - - ID first_post_arg; - - ID rest_arg; - ID block_arg; - - struct RNode_KW_ARG *kw_args; - NODE *kw_rest_arg; - - struct RNode_OPT_ARG *opt_args; - unsigned int no_kwarg: 1; - unsigned int ruby2_keywords: 1; - unsigned int forwarding: 1; -}; - -typedef struct RNode_ARGS { - NODE node; - - struct rb_args_info nd_ainfo; -} rb_node_args_t; - -typedef struct RNode_ARGS_AUX { - NODE node; - - ID nd_pid; - int nd_plen; - struct RNode *nd_next; -} rb_node_args_aux_t; - -typedef struct RNode_OPT_ARG { - NODE node; - - struct RNode *nd_body; - struct RNode_OPT_ARG *nd_next; -} rb_node_opt_arg_t; - -typedef struct RNode_KW_ARG { - NODE node; - - struct RNode *nd_body; - struct RNode_KW_ARG *nd_next; -} rb_node_kw_arg_t; - -typedef struct RNode_POSTARG { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; -} rb_node_postarg_t; - -typedef struct RNode_ARGSCAT { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_argscat_t; - -typedef struct RNode_ARGSPUSH { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_argspush_t; - -typedef struct RNode_SPLAT { - NODE node; - - struct RNode *nd_head; -} rb_node_splat_t; - -typedef struct RNode_BLOCK_PASS { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_block_pass_t; - -typedef struct RNode_DEFN { - NODE node; - - ID nd_mid; - struct RNode *nd_defn; -} rb_node_defn_t; - -typedef struct RNode_DEFS { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_defn; -} rb_node_defs_t; - -typedef struct RNode_ALIAS { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; -} rb_node_alias_t; - -typedef struct RNode_VALIAS { - NODE node; - - ID nd_alias; - ID nd_orig; -} rb_node_valias_t; - -typedef struct RNode_UNDEF { - NODE node; - - struct RNode *nd_undef; -} rb_node_undef_t; - -typedef struct RNode_CLASS { - NODE node; - - struct RNode *nd_cpath; - struct RNode *nd_body; - struct RNode *nd_super; -} rb_node_class_t; - -typedef struct RNode_MODULE { - NODE node; - - struct RNode *nd_cpath; - struct RNode *nd_body; -} rb_node_module_t; - -typedef struct RNode_SCLASS { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_body; -} rb_node_sclass_t; - -typedef struct RNode_COLON2 { - NODE node; - - struct RNode *nd_head; - ID nd_mid; -} rb_node_colon2_t; - -typedef struct RNode_COLON3 { - NODE node; - - ID nd_mid; -} rb_node_colon3_t; - -/* RNode_DOT2, RNode_DOT3, RNode_FLIP2 and RNode_FLIP3 should be same structure */ -typedef struct RNode_DOT2 { - NODE node; - - struct RNode *nd_beg; - struct RNode *nd_end; -} rb_node_dot2_t; - -typedef struct RNode_DOT3 { - NODE node; - - struct RNode *nd_beg; - struct RNode *nd_end; -} rb_node_dot3_t; - -typedef struct RNode_FLIP2 { - NODE node; - - struct RNode *nd_beg; - struct RNode *nd_end; -} rb_node_flip2_t; - -typedef struct RNode_FLIP3 { - NODE node; - - struct RNode *nd_beg; - struct RNode *nd_end; -} rb_node_flip3_t; - -typedef struct RNode_SELF { - NODE node; - - long nd_state; /* Default 1. See NEW_SELF. */ -} rb_node_self_t; - -typedef struct RNode_NIL { - NODE node; -} rb_node_nil_t; - -typedef struct RNode_TRUE { - NODE node; -} rb_node_true_t; - -typedef struct RNode_FALSE { - NODE node; -} rb_node_false_t; - -typedef struct RNode_ERRINFO { - NODE node; -} rb_node_errinfo_t; - -typedef struct RNode_DEFINED { - NODE node; - - struct RNode *nd_head; -} rb_node_defined_t; - -typedef struct RNode_POSTEXE { - NODE node; - - struct RNode *nd_body; -} rb_node_postexe_t; - -typedef struct RNode_SYM { - NODE node; - - struct rb_parser_string *string; -} rb_node_sym_t; - -typedef struct RNode_DSYM { - NODE node; - - struct rb_parser_string *string; - long nd_alen; - struct RNode_LIST *nd_next; -} rb_node_dsym_t; - -typedef struct RNode_ATTRASGN { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_attrasgn_t; - -typedef struct RNode_LAMBDA { - NODE node; - - struct RNode *nd_body; -} rb_node_lambda_t; - -typedef struct RNode_ARYPTN { - NODE node; - - struct RNode *nd_pconst; - NODE *pre_args; - NODE *rest_arg; - NODE *post_args; -} rb_node_aryptn_t; - -typedef struct RNode_HSHPTN { - NODE node; - - struct RNode *nd_pconst; - struct RNode *nd_pkwargs; - struct RNode *nd_pkwrestarg; -} rb_node_hshptn_t; - -typedef struct RNode_FNDPTN { - NODE node; - - struct RNode *nd_pconst; - NODE *pre_rest_arg; - NODE *args; - NODE *post_rest_arg; -} rb_node_fndptn_t; - -typedef struct RNode_LINE { - NODE node; -} rb_node_line_t; - -typedef struct RNode_FILE { - NODE node; - - struct rb_parser_string *path; -} rb_node_file_t; - -typedef struct RNode_ENCODING { - NODE node; - rb_encoding *enc; -} rb_node_encoding_t; - -typedef struct RNode_ERROR { - NODE node; -} rb_node_error_t; - -#define RNODE(obj) ((struct RNode *)(obj)) - -#define RNODE_SCOPE(node) ((struct RNode_SCOPE *)(node)) -#define RNODE_BLOCK(node) ((struct RNode_BLOCK *)(node)) -#define RNODE_IF(node) ((struct RNode_IF *)(node)) -#define RNODE_UNLESS(node) ((struct RNode_UNLESS *)(node)) -#define RNODE_CASE(node) ((struct RNode_CASE *)(node)) -#define RNODE_CASE2(node) ((struct RNode_CASE2 *)(node)) -#define RNODE_CASE3(node) ((struct RNode_CASE3 *)(node)) -#define RNODE_WHEN(node) ((struct RNode_WHEN *)(node)) -#define RNODE_IN(node) ((struct RNode_IN *)(node)) -#define RNODE_WHILE(node) ((struct RNode_WHILE *)(node)) -#define RNODE_UNTIL(node) ((struct RNode_UNTIL *)(node)) -#define RNODE_ITER(node) ((struct RNode_ITER *)(node)) -#define RNODE_FOR(node) ((struct RNode_FOR *)(node)) -#define RNODE_FOR_MASGN(node) ((struct RNode_FOR_MASGN *)(node)) -#define RNODE_BREAK(node) ((struct RNode_BREAK *)(node)) -#define RNODE_NEXT(node) ((struct RNode_NEXT *)(node)) -#define RNODE_REDO(node) ((struct RNode_REDO *)(node)) -#define RNODE_RETRY(node) ((struct RNode_RETRY *)(node)) -#define RNODE_BEGIN(node) ((struct RNode_BEGIN *)(node)) -#define RNODE_RESCUE(node) ((struct RNode_RESCUE *)(node)) -#define RNODE_RESBODY(node) ((struct RNode_RESBODY *)(node)) -#define RNODE_ENSURE(node) ((struct RNode_ENSURE *)(node)) -#define RNODE_AND(node) ((struct RNode_AND *)(node)) -#define RNODE_OR(node) ((struct RNode_OR *)(node)) -#define RNODE_MASGN(node) ((struct RNode_MASGN *)(node)) -#define RNODE_LASGN(node) ((struct RNode_LASGN *)(node)) -#define RNODE_DASGN(node) ((struct RNode_DASGN *)(node)) -#define RNODE_GASGN(node) ((struct RNode_GASGN *)(node)) -#define RNODE_IASGN(node) ((struct RNode_IASGN *)(node)) -#define RNODE_CDECL(node) ((struct RNode_CDECL *)(node)) -#define RNODE_CVASGN(node) ((struct RNode_CVASGN *)(node)) -#define RNODE_OP_ASGN1(node) ((struct RNode_OP_ASGN1 *)(node)) -#define RNODE_OP_ASGN2(node) ((struct RNode_OP_ASGN2 *)(node)) -#define RNODE_OP_ASGN_AND(node) ((struct RNode_OP_ASGN_AND *)(node)) -#define RNODE_OP_ASGN_OR(node) ((struct RNode_OP_ASGN_OR *)(node)) -#define RNODE_OP_CDECL(node) ((struct RNode_OP_CDECL *)(node)) -#define RNODE_CALL(node) ((struct RNode_CALL *)(node)) -#define RNODE_OPCALL(node) ((struct RNode_OPCALL *)(node)) -#define RNODE_FCALL(node) ((struct RNode_FCALL *)(node)) -#define RNODE_VCALL(node) ((struct RNode_VCALL *)(node)) -#define RNODE_QCALL(node) ((struct RNode_QCALL *)(node)) -#define RNODE_SUPER(node) ((struct RNode_SUPER *)(node)) -#define RNODE_ZSUPER(node) ((struct RNode_ZSUPER *)(node)) -#define RNODE_LIST(node) ((struct RNode_LIST *)(node)) -#define RNODE_ZLIST(node) ((struct RNode_ZLIST *)(node)) -#define RNODE_HASH(node) ((struct RNode_HASH *)(node)) -#define RNODE_RETURN(node) ((struct RNode_RETURN *)(node)) -#define RNODE_YIELD(node) ((struct RNode_YIELD *)(node)) -#define RNODE_LVAR(node) ((struct RNode_LVAR *)(node)) -#define RNODE_DVAR(node) ((struct RNode_DVAR *)(node)) -#define RNODE_GVAR(node) ((struct RNode_GVAR *)(node)) -#define RNODE_IVAR(node) ((struct RNode_IVAR *)(node)) -#define RNODE_CONST(node) ((struct RNode_CONST *)(node)) -#define RNODE_CVAR(node) ((struct RNode_CVAR *)(node)) -#define RNODE_NTH_REF(node) ((struct RNode_NTH_REF *)(node)) -#define RNODE_BACK_REF(node) ((struct RNode_BACK_REF *)(node)) -#define RNODE_MATCH(node) ((struct RNode_MATCH *)(node)) -#define RNODE_MATCH2(node) ((struct RNode_MATCH2 *)(node)) -#define RNODE_MATCH3(node) ((struct RNode_MATCH3 *)(node)) -#define RNODE_INTEGER(node) ((struct RNode_INTEGER *)(node)) -#define RNODE_FLOAT(node) ((struct RNode_FLOAT *)(node)) -#define RNODE_RATIONAL(node) ((struct RNode_RATIONAL *)(node)) -#define RNODE_IMAGINARY(node) ((struct RNode_IMAGINARY *)(node)) -#define RNODE_STR(node) ((struct RNode_STR *)(node)) -#define RNODE_DSTR(node) ((struct RNode_DSTR *)(node)) -#define RNODE_XSTR(node) ((struct RNode_XSTR *)(node)) -#define RNODE_DXSTR(node) ((struct RNode_DXSTR *)(node)) -#define RNODE_EVSTR(node) ((struct RNode_EVSTR *)(node)) -#define RNODE_REGX(node) ((struct RNode_REGX *)(node)) -#define RNODE_DREGX(node) ((struct RNode_DREGX *)(node)) -#define RNODE_ONCE(node) ((struct RNode_ONCE *)(node)) -#define RNODE_ARGS(node) ((struct RNode_ARGS *)(node)) -#define RNODE_ARGS_AUX(node) ((struct RNode_ARGS_AUX *)(node)) -#define RNODE_OPT_ARG(node) ((struct RNode_OPT_ARG *)(node)) -#define RNODE_KW_ARG(node) ((struct RNode_KW_ARG *)(node)) -#define RNODE_POSTARG(node) ((struct RNode_POSTARG *)(node)) -#define RNODE_ARGSCAT(node) ((struct RNode_ARGSCAT *)(node)) -#define RNODE_ARGSPUSH(node) ((struct RNode_ARGSPUSH *)(node)) -#define RNODE_SPLAT(node) ((struct RNode_SPLAT *)(node)) -#define RNODE_BLOCK_PASS(node) ((struct RNode_BLOCK_PASS *)(node)) -#define RNODE_DEFN(node) ((struct RNode_DEFN *)(node)) -#define RNODE_DEFS(node) ((struct RNode_DEFS *)(node)) -#define RNODE_ALIAS(node) ((struct RNode_ALIAS *)(node)) -#define RNODE_VALIAS(node) ((struct RNode_VALIAS *)(node)) -#define RNODE_UNDEF(node) ((struct RNode_UNDEF *)(node)) -#define RNODE_CLASS(node) ((struct RNode_CLASS *)(node)) -#define RNODE_MODULE(node) ((struct RNode_MODULE *)(node)) -#define RNODE_SCLASS(node) ((struct RNode_SCLASS *)(node)) -#define RNODE_COLON2(node) ((struct RNode_COLON2 *)(node)) -#define RNODE_COLON3(node) ((struct RNode_COLON3 *)(node)) -#define RNODE_DOT2(node) ((struct RNode_DOT2 *)(node)) -#define RNODE_DOT3(node) ((struct RNode_DOT3 *)(node)) -#define RNODE_FLIP2(node) ((struct RNode_FLIP2 *)(node)) -#define RNODE_FLIP3(node) ((struct RNode_FLIP3 *)(node)) -#define RNODE_SELF(node) ((struct RNode_SELF *)(node)) -#define RNODE_NIL(node) ((struct RNode_NIL *)(node)) -#define RNODE_TRUE(node) ((struct RNode_TRUE *)(node)) -#define RNODE_FALSE(node) ((struct RNode_FALSE *)(node)) -#define RNODE_ERRINFO(node) ((struct RNode_ERRINFO *)(node)) -#define RNODE_DEFINED(node) ((struct RNode_DEFINED *)(node)) -#define RNODE_POSTEXE(node) ((struct RNode_POSTEXE *)(node)) -#define RNODE_SYM(node) ((struct RNode_SYM *)(node)) -#define RNODE_DSYM(node) ((struct RNode_DSYM *)(node)) -#define RNODE_ATTRASGN(node) ((struct RNode_ATTRASGN *)(node)) -#define RNODE_LAMBDA(node) ((struct RNode_LAMBDA *)(node)) -#define RNODE_ARYPTN(node) ((struct RNode_ARYPTN *)(node)) -#define RNODE_HSHPTN(node) ((struct RNode_HSHPTN *)(node)) -#define RNODE_FNDPTN(node) ((struct RNode_FNDPTN *)(node)) -#define RNODE_LINE(node) ((struct RNode_LINE *)(node)) -#define RNODE_FILE(node) ((struct RNode_FILE *)(node)) -#define RNODE_ENCODING(node) ((struct RNode_ENCODING *)(node)) - -/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: UNUSED, 9: UNUSED, 10: EXIVAR, 11: FREEZE */ -/* NODE_FL: 0..4: UNUSED, 5: UNUSED, 6: UNUSED, 7: NODE_FL_NEWLINE, - * 8..14: nd_type, - * 15..: nd_line - */ -#define NODE_FL_NEWLINE (((VALUE)1)<<7) - -#define NODE_TYPESHIFT 8 -#define NODE_TYPEMASK (((VALUE)0x7f)<flags & NODE_FL_NEWLINE -#define nd_set_fl_newline(n) (n)->flags |= NODE_FL_NEWLINE -#define nd_unset_fl_newline(n) (n)->flags &= ~NODE_FL_NEWLINE - -#define nd_type(n) ((int) ((RNODE(n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) -#define nd_set_type(n,t) \ - rb_node_set_type(n, t) -#define nd_init_type(n,t) \ - (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<> SHAPE_ID_NUM_BITS) - -# define SHAPE_FLAG_SHIFT ((SIZEOF_VALUE * 8) - SHAPE_ID_NUM_BITS) - -# define SHAPE_MAX_VARIATIONS 8 - -# define INVALID_SHAPE_ID SHAPE_MASK -# define ROOT_SHAPE_ID 0x0 - -# define SPECIAL_CONST_SHAPE_ID (ROOT_SHAPE_ID + 1) -# define OBJ_TOO_COMPLEX_SHAPE_ID (SPECIAL_CONST_SHAPE_ID + 1) -# define FIRST_T_OBJECT_SHAPE_ID (OBJ_TOO_COMPLEX_SHAPE_ID + 1) - -typedef struct redblack_node redblack_node_t; - -struct rb_shape { - struct rb_id_table * edges; // id_table from ID (ivar) to next shape - ID edge_name; // ID (ivar) for transition from parent to rb_shape - attr_index_t next_iv_index; - uint32_t capacity; // Total capacity of the object with this shape - uint8_t type; - uint8_t size_pool_index; - shape_id_t parent_id; - redblack_node_t * ancestor_index; -}; - -typedef struct rb_shape rb_shape_t; - -struct redblack_node { - ID key; - rb_shape_t * value; - redblack_id_t l; - redblack_id_t r; -}; - -enum shape_type { - SHAPE_ROOT, - SHAPE_IVAR, - SHAPE_FROZEN, - SHAPE_T_OBJECT, - SHAPE_OBJ_TOO_COMPLEX, -}; - -typedef struct { - /* object shapes */ - rb_shape_t *shape_list; - rb_shape_t *root_shape; - shape_id_t next_shape_id; - - redblack_node_t *shape_cache; - unsigned int cache_size; -} rb_shape_tree_t; -RUBY_EXTERN rb_shape_tree_t *rb_shape_tree_ptr; - -static inline rb_shape_tree_t * -rb_current_shape_tree(void) -{ - return rb_shape_tree_ptr; -} -#define GET_SHAPE_TREE() rb_current_shape_tree() - -static inline shape_id_t -get_shape_id_from_flags(VALUE obj) -{ - RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj)); - return (shape_id_t)(SHAPE_MASK & ((RBASIC(obj)->flags) >> SHAPE_FLAG_SHIFT)); -} - -static inline void -set_shape_id_in_flags(VALUE obj, shape_id_t shape_id) -{ - // Ractors are occupying the upper 32 bits of flags, but only in debug mode - // Object shapes are occupying top bits - RBASIC(obj)->flags &= SHAPE_FLAG_MASK; - RBASIC(obj)->flags |= ((VALUE)(shape_id) << SHAPE_FLAG_SHIFT); -} - - -#if SHAPE_IN_BASIC_FLAGS -static inline shape_id_t -RBASIC_SHAPE_ID(VALUE obj) -{ - return get_shape_id_from_flags(obj); -} - -static inline void -RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id) -{ - set_shape_id_in_flags(obj, shape_id); -} -#endif - -static inline shape_id_t -ROBJECT_SHAPE_ID(VALUE obj) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - return get_shape_id_from_flags(obj); -} - -static inline void -ROBJECT_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - set_shape_id_in_flags(obj, shape_id); -} - -static inline shape_id_t -RCLASS_SHAPE_ID(VALUE obj) -{ - RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE)); - return get_shape_id_from_flags(obj); -} - -static inline void -RCLASS_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id) -{ - RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE)); - set_shape_id_in_flags(obj, shape_id); -} - -rb_shape_t * rb_shape_get_root_shape(void); -int32_t rb_shape_id_offset(void); - -rb_shape_t * rb_shape_get_parent(rb_shape_t * shape); - -RUBY_FUNC_EXPORTED rb_shape_t *rb_shape_get_shape_by_id(shape_id_t shape_id); -RUBY_FUNC_EXPORTED shape_id_t rb_shape_get_shape_id(VALUE obj); -rb_shape_t * rb_shape_get_next_iv_shape(rb_shape_t * shape, ID id); -bool rb_shape_get_iv_index(rb_shape_t * shape, ID id, attr_index_t * value); -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); -RUBY_FUNC_EXPORTED bool rb_shape_obj_too_complex(VALUE obj); - -void rb_shape_set_shape(VALUE obj, rb_shape_t* shape); -rb_shape_t* rb_shape_get_shape(VALUE obj); -int rb_shape_frozen_shape_p(rb_shape_t* shape); -rb_shape_t* rb_shape_transition_shape_frozen(VALUE obj); -bool rb_shape_transition_shape_remove_ivar(VALUE obj, ID id, rb_shape_t *shape, VALUE * removed); -rb_shape_t* rb_shape_get_next(rb_shape_t* shape, VALUE obj, ID id); - -rb_shape_t * rb_shape_rebuild_shape(rb_shape_t * initial_shape, rb_shape_t * dest_shape); - -static inline uint32_t -ROBJECT_IV_CAPACITY(VALUE obj) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - // Asking for capacity doesn't make sense when the object is using - // a hash table for storing instance variables - RUBY_ASSERT(!rb_shape_obj_too_complex(obj)); - return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->capacity; -} - -static inline st_table * -ROBJECT_IV_HASH(VALUE obj) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - return (st_table *)ROBJECT(obj)->as.heap.ivptr; -} - -static inline void -ROBJECT_SET_IV_HASH(VALUE obj, const st_table *tbl) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - ROBJECT(obj)->as.heap.ivptr = (VALUE *)tbl; -} - -size_t rb_id_table_size(const struct rb_id_table *tbl); - -static inline uint32_t -ROBJECT_IV_COUNT(VALUE obj) -{ - if (rb_shape_obj_too_complex(obj)) { - return (uint32_t)rb_st_table_size(ROBJECT_IV_HASH(obj)); - } - else { - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - RUBY_ASSERT(!rb_shape_obj_too_complex(obj)); - return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->next_iv_index; - } -} - -static inline uint32_t -RBASIC_IV_COUNT(VALUE obj) -{ - return rb_shape_get_shape_by_id(rb_shape_get_shape_id(obj))->next_iv_index; -} - -rb_shape_t *rb_shape_traverse_from_new_root(rb_shape_t *initial_shape, rb_shape_t *orig_shape); - -bool rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id); - -VALUE rb_obj_debug_shape(VALUE self, VALUE obj); - -// For ext/objspace -RUBY_SYMBOL_EXPORT_BEGIN -typedef void each_shape_callback(rb_shape_t * shape, void *data); -void rb_shape_each_shape(each_shape_callback callback, void *data); -size_t rb_shape_memsize(rb_shape_t *shape); -size_t rb_shape_edges_count(rb_shape_t *shape); -size_t rb_shape_depth(rb_shape_t *shape); -shape_id_t rb_shape_id(rb_shape_t * shape); -RUBY_SYMBOL_EXPORT_END - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h deleted file mode 100644 index f49bc51..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef SIPHASH_H -#define SIPHASH_H 1 -#include -#ifdef HAVE_STDINT_H -#include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif - -#ifndef HAVE_UINT64_T -typedef struct { - uint32_t u32[2]; -} sip_uint64_t; -#define uint64_t sip_uint64_t -#else -typedef uint64_t sip_uint64_t; -#endif - -typedef struct { - int c; - int d; - uint64_t v[4]; - uint8_t buf[sizeof(uint64_t)]; - uint8_t buflen; - uint8_t msglen_byte; -} sip_state; - -typedef struct sip_interface_st sip_interface; - -typedef struct { - sip_state state[1]; - const sip_interface *methods; -} sip_hash; - -sip_hash *sip_hash_new(const uint8_t key[16], int c, int d); -sip_hash *sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d); -int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len); -int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len); -int sip_hash_final_integer(sip_hash *h, uint64_t *digest); -int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len); -int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest); -void sip_hash_free(sip_hash *h); -void sip_hash_dump(sip_hash *h); - -NO_SANITIZE("unsigned-integer-overflow", uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h deleted file mode 100644 index 3649f12..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef RUBY_SYMBOL_H -#define RUBY_SYMBOL_H 1 -/********************************************************************** - - symbol.h - - - $Author$ - created at: Tue Jul 8 15:49:54 JST 2014 - - Copyright (C) 2014 Yukihiro Matsumoto - -**********************************************************************/ - -#include "id.h" -#include "ruby/encoding.h" - -#define DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID) -#define STATIC_ID2SYM(id) (((VALUE)(id)<tLAST_OP_ID) -#define is_local_id(id) (id_type(id)==ID_LOCAL) -#define is_global_id(id) (id_type(id)==ID_GLOBAL) -#define is_instance_id(id) (id_type(id)==ID_INSTANCE) -#define is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET) -#define is_const_id(id) (id_type(id)==ID_CONST) -#define is_class_id(id) (id_type(id)==ID_CLASS) -#define is_junk_id(id) (id_type(id)==ID_JUNK) - -static inline int -id_type(ID id) -{ - if (is_notop_id(id)) { - return (int)(id&ID_SCOPE_MASK); - } - else { - return -1; - } -} - -typedef uint32_t rb_id_serial_t; -static const uint32_t RB_ID_SERIAL_MAX = /* 256M on LP32 */ - UINT32_MAX >> - ((sizeof(ID)-sizeof(rb_id_serial_t))*CHAR_BIT < RUBY_ID_SCOPE_SHIFT ? - RUBY_ID_SCOPE_SHIFT : 0); - -typedef struct { - rb_id_serial_t last_id; - st_table *str_sym; - VALUE ids; - VALUE dsymbol_fstr_hash; -} rb_symbols_t; - -static inline rb_id_serial_t -rb_id_to_serial(ID id) -{ - if (is_notop_id(id)) { - return (rb_id_serial_t)(id >> ID_SCOPE_SHIFT); - } - else { - return (rb_id_serial_t)id; - } -} - -static inline int -sym_type(VALUE sym) -{ - ID id; - if (STATIC_SYM_P(sym)) { - id = RSHIFT(sym, RUBY_SPECIAL_SHIFT); - if (id<=tLAST_OP_ID) { - return -1; - } - } - else { - id = RSYMBOL(sym)->id; - } - return (int)(id&ID_SCOPE_MASK); -} - -#define is_local_sym(sym) (sym_type(sym)==ID_LOCAL) -#define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL) -#define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE) -#define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET) -#define is_const_sym(sym) (sym_type(sym)==ID_CONST) -#define is_class_sym(sym) (sym_type(sym)==ID_CLASS) -#define is_junk_sym(sym) (sym_type(sym)==ID_JUNK) - -RUBY_FUNC_EXPORTED const uint_least32_t ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32]; - -static inline int -is_global_name_punct(const int c) -{ - if (c <= 0x20 || 0x7e < c) return 0; - return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1; -} - -RUBY_SYMBOL_EXPORT_BEGIN - -int rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset); -size_t rb_sym_immortal_count(void); - -RUBY_SYMBOL_EXPORT_END -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h deleted file mode 100644 index ac47e52..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RUBY_THREAD_NONE_H -#define RUBY_THREAD_NONE_H - -#define RB_NATIVETHREAD_LOCK_INIT (void)(0) -#define RB_NATIVETHREAD_COND_INIT (void)(0) - -// no-thread impl doesn't use TLS but define this to avoid using tls key -// based implementation in vm.c -#define RB_THREAD_LOCAL_SPECIFIER - -struct rb_native_thread { - void *thread_id; // NULL -}; - -struct rb_thread_sched_item {}; -struct rb_thread_sched {}; - -RUBY_EXTERN struct rb_execution_context_struct *ruby_current_ec; -NOINLINE(struct rb_execution_context_struct *rb_current_ec_noinline(void)); // for assertions - -#endif /* RUBY_THREAD_NONE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h deleted file mode 100644 index 20c4b9f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef RUBY_THREAD_PTHREAD_H -#define RUBY_THREAD_PTHREAD_H -/********************************************************************** - - thread_pthread.h - - - $Author$ - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -#ifdef HAVE_PTHREAD_NP_H -#include -#endif - -#define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER -#define RB_NATIVETHREAD_COND_INIT PTHREAD_COND_INITIALIZER - -// per-Thead scheduler helper data -struct rb_thread_sched_item { - struct { - struct ccan_list_node ubf; - - // connected to ractor->threads.sched.reqdyq - // locked by ractor->threads.sched.lock - struct ccan_list_node readyq; - - // connected to vm->ractor.sched.timeslice_threads - // locked by vm->ractor.sched.lock - struct ccan_list_node timeslice_threads; - - // connected to vm->ractor.sched.running_threads - // locked by vm->ractor.sched.lock - struct ccan_list_node running_threads; - - // connected to vm->ractor.sched.zombie_threads - struct ccan_list_node zombie_threads; - } node; - - // this data should be protected by timer_th.waiting_lock - struct { - enum thread_sched_waiting_flag { - thread_sched_waiting_none = 0x00, - thread_sched_waiting_timeout = 0x01, - thread_sched_waiting_io_read = 0x02, - thread_sched_waiting_io_write = 0x08, - thread_sched_waiting_io_force = 0x40, // ignore readable - } flags; - - struct { - // should be compat with hrtime.h -#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL - int128_t timeout; -#else - uint64_t timeout; -#endif - int fd; // -1 for timeout only - int result; - } data; - - // connected to timer_th.waiting - struct ccan_list_node node; - } waiting_reason; - - bool finished; - bool malloc_stack; - void *context_stack; - struct coroutine_context *context; -}; - -struct rb_native_thread { - rb_atomic_t serial; - struct rb_vm_struct *vm; - - rb_nativethread_id_t thread_id; - -#ifdef RB_THREAD_T_HAS_NATIVE_ID - int tid; -#endif - - struct rb_thread_struct *running_thread; - - // to control native thread -#if defined(__GLIBC__) || defined(__FreeBSD__) - union -#else - /* - * assume the platform condvars are badly implemented and have a - * "memory" of which mutex they're associated with - */ - struct -#endif - { - rb_nativethread_cond_t intr; /* th->interrupt_lock */ - rb_nativethread_cond_t readyq; /* use sched->lock */ - } cond; - -#ifdef USE_SIGALTSTACK - void *altstack; -#endif - - struct coroutine_context *nt_context; - int dedicated; - - size_t machine_stack_maxsize; -}; - -#undef except -#undef try -#undef leave -#undef finally - -// per-Ractor -struct rb_thread_sched { - rb_nativethread_lock_t lock_; -#if VM_CHECK_MODE - struct rb_thread_struct *lock_owner; -#endif - struct rb_thread_struct *running; // running thread or NULL - bool is_running; - bool is_running_timeslice; - bool enable_mn_threads; - - struct ccan_list_head readyq; - int readyq_cnt; - // ractor scheduling - struct ccan_list_node grq_node; -}; - -#ifdef RB_THREAD_LOCAL_SPECIFIER - NOINLINE(void rb_current_ec_set(struct rb_execution_context_struct *)); - NOINLINE(struct rb_execution_context_struct *rb_current_ec_noinline(void)); - - # ifdef __APPLE__ - // on Darwin, TLS can not be accessed across .so - NOINLINE(struct rb_execution_context_struct *rb_current_ec(void)); - # else - RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec; - - // for RUBY_DEBUG_LOG() - RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER rb_atomic_t ruby_nt_serial; - #define RUBY_NT_SERIAL 1 - # endif -#else -typedef pthread_key_t native_tls_key_t; - -static inline void * -native_tls_get(native_tls_key_t key) -{ - // return value should be checked by caller - return pthread_getspecific(key); -} - -static inline void -native_tls_set(native_tls_key_t key, void *ptr) -{ - if (UNLIKELY(pthread_setspecific(key, ptr) != 0)) { - rb_bug("pthread_setspecific error"); - } -} - -RUBY_EXTERN native_tls_key_t ruby_current_ec_key; -#endif - -#endif /* RUBY_THREAD_PTHREAD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h deleted file mode 100644 index 23cd71f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef RUBY_THREAD_WIN32_H -#define RUBY_THREAD_WIN32_H -/********************************************************************** - - thread_win32.h - - - $Author$ - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -/* interface */ - -# ifdef __CYGWIN__ -# undef _WIN32 -# endif - -#define USE_VM_CLOCK 1 - -WINBASEAPI BOOL WINAPI -TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection); - -struct rb_native_thread { - HANDLE thread_id; - HANDLE interrupt_event; -}; - -struct rb_thread_sched_item { - void *vm_stack; -}; - -struct rb_thread_sched { - HANDLE lock; -}; - -typedef DWORD native_tls_key_t; // TLS index - -static inline void * -native_tls_get(native_tls_key_t key) -{ - // return value should be checked by caller. - return TlsGetValue(key); -} - -static inline void -native_tls_set(native_tls_key_t key, void *ptr) -{ - if (UNLIKELY(TlsSetValue(key, ptr) == 0)) { - rb_bug("TlsSetValue() error"); - } -} - -RUBY_SYMBOL_EXPORT_BEGIN -RUBY_EXTERN native_tls_key_t ruby_current_ec_key; -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_THREAD_WIN32_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h deleted file mode 100644 index d350a17..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef RUBY_TIMEV_H -#define RUBY_TIMEV_H -#include "ruby/ruby.h" - -struct vtm { - VALUE year; /* 2000 for example. Integer. */ - VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */ - VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */ - VALUE zone; /* "JST", "EST", "EDT", etc. as String */ - unsigned int yday:9; /* 1..366 */ - unsigned int mon:4; /* 1..12 */ - unsigned int mday:5; /* 1..31 */ - unsigned int hour:5; /* 0..23 */ - unsigned int min:6; /* 0..59 */ - unsigned int sec:6; /* 0..60 */ - unsigned int wday:3; /* 0:Sunday, 1:Monday, ..., 6:Saturday 7:init */ - unsigned int isdst:2; /* 0:StandardTime 1:DayLightSavingTime 3:init */ - - /* Flags for struct time_object */ - unsigned int tzmode:3; /* 0:localtime 1:utc 2:fixoff 3:uninitialized */ - unsigned int tm_got:1; -}; - -#define TIME_SCALE 1000000000 - -#ifndef TYPEOF_TIMEVAL_TV_SEC -# define TYPEOF_TIMEVAL_TV_SEC time_t -#endif -#ifndef TYPEOF_TIMEVAL_TV_USEC -# if INT_MAX >= 1000000 -# define TYPEOF_TIMEVAL_TV_USEC int -# else -# define TYPEOF_TIMEVAL_TV_USEC long -# endif -#endif - -#if SIZEOF_TIME_T == SIZEOF_LONG -typedef unsigned long unsigned_time_t; -#elif SIZEOF_TIME_T == SIZEOF_INT -typedef unsigned int unsigned_time_t; -#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG -typedef unsigned LONG_LONG unsigned_time_t; -#else -# error cannot find integer type which size is same as time_t. -#endif - -/* strftime.c */ -#ifdef RUBY_ENCODING_H -VALUE rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc, - VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt); -VALUE rb_strftime(const char *format, size_t format_len, rb_encoding *enc, - VALUE time, const struct vtm *vtm, VALUE timev, int gmt); -#endif - -/* time.c */ -VALUE rb_time_zone_abbreviation(VALUE zone, VALUE time); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h deleted file mode 100644 index 416e50d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef RUBY_TRANSCODE_DATA_H -#define RUBY_TRANSCODE_DATA_H 1 -/********************************************************************** - - transcode_data.h - - - $Author$ - created at: Mon 10 Dec 2007 14:01:47 JST 2007 - - Copyright (C) 2007 Martin Duerst - -**********************************************************************/ - -#include "ruby/ruby.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#define WORDINDEX_SHIFT_BITS 2 -#define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS) -#define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS) -#define BYTE_LOOKUP_BASE(bl) ((bl)[0]) -#define BYTE_LOOKUP_INFO(bl) ((bl)[1]) - -#define PType (unsigned int) - -#define NOMAP (PType 0x01) /* direct map */ -#define ONEbt (0x02) /* one byte payload */ -#define TWObt (0x03) /* two bytes payload */ -#define THREEbt (0x05) /* three bytes payload */ -#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */ -#define INVALID (PType 0x07) /* invalid byte sequence */ -#define UNDEF (PType 0x09) /* legal but undefined */ -#define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */ -#define FUNii (PType 0x0B) /* function from info to info */ -#define FUNsi (PType 0x0D) /* function from start to info */ -#define FUNio (PType 0x0E) /* function from info to output */ -#define FUNso (PType 0x0F) /* function from start to output */ -#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */ -#define GB4bt (PType 0x12) /* GB18030 four bytes payload */ -#define FUNsio (PType 0x13) /* function from start and info to output */ - -#define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4) -#define STR1_BYTEINDEX(w) ((w) >> 6) -#define makeSTR1(bi) (((bi) << 6) | STR1) -#define makeSTR1LEN(len) ((len)-4) - -#define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt)) -#define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|\ - (((unsigned char)(b2))<<16)|\ - TWObt)) -#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\ - (((unsigned char)(b2))<<16)|\ - (((unsigned int)(unsigned char)(b3))<<24)|\ - THREEbt)&\ - 0xffffffffU)) -#define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\ - (((unsigned char)(b2))<<16)|\ - (((unsigned int)(unsigned char)(b3))<<24)|\ - ((((unsigned char)(b0))&0x07)<<5)|\ - FOURbt)&\ - 0xffffffffU)) -#define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|\ - (((unsigned char)(b2))<<16)|\ - ((((unsigned char)(b1))&0x0f)<<24)|\ - ((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|\ - GB4bt)&\ - 0xffffffffU)) -#define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio)) - -#define getBT1(a) ((unsigned char)((a)>> 8)) -#define getBT2(a) ((unsigned char)((a)>>16)) -#define getBT3(a) ((unsigned char)((a)>>24)) -#define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */ - -#define getGB4bt0(a) ((unsigned char)((a)>> 8)) -#define getGB4bt1(a) (((unsigned char)((a)>>24)&0x0F)|0x30) -#define getGB4bt2(a) ((unsigned char)((a)>>16)) -#define getGB4bt3(a) (((unsigned char)((a)>>28)&0x0F)|0x30) - -#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii)) - -/* do we need these??? maybe not, can be done with simple tables */ -#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */ -#define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */ -#define THREETRAIL /* legal but undefined if three more trailing UTF-8 */ - -typedef enum { - asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */ - asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */ - asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */ - /* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */ -} rb_transcoder_asciicompat_type_t; - -typedef struct rb_transcoder rb_transcoder; - -/* static structure, one per supported encoding pair */ -struct rb_transcoder { - const char *src_encoding; - const char *dst_encoding; - unsigned int conv_tree_start; - const unsigned char *byte_array; - unsigned int byte_array_length; - const unsigned int *word_array; - unsigned int word_array_length; - int word_size; - int input_unit_length; - int max_input; - int max_output; - rb_transcoder_asciicompat_type_t asciicompat_type; - size_t state_size; - int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */ - int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */ - VALUE (*func_ii)(void*, VALUE); /* info -> info */ - VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */ - ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */ - ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */ - ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */ - ssize_t (*resetsize_func)(void*); /* -> len */ - ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */ - ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */ -}; - -void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib); -void rb_register_transcoder(const rb_transcoder *); - -/* - * To get rid of collision of initializer symbols in statically-linked encodings - * and transcoders - */ -#if defined(EXTSTATIC) && EXTSTATIC -# define TRANS_INIT(name) void Init_trans_ ## name(void) -#else -# define TRANS_INIT(name) void Init_ ## name(void) -#endif - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_TRANSCODE_DATA_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h deleted file mode 100644 index 1abc89e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef RUBY_TOPLEVEL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_TOPLEVEL_VARIABLE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ - -/* per-object */ - -#include "shape.h" - -struct gen_ivtbl { -#if !SHAPE_IN_BASIC_FLAGS - uint16_t shape_id; -#endif - union { - struct { - uint32_t numiv; - VALUE ivptr[1]; - } shape; - struct { - st_table *table; - } complex; - } as; -}; - -int rb_ivar_generic_ivtbl_lookup(VALUE obj, struct gen_ivtbl **); - -#if !SHAPE_IN_BASIC_FLAGS -shape_id_t rb_generic_shape_id(VALUE obj); -#endif - -void rb_free_rb_global_tbl(void); -void rb_free_generic_iv_tbl_(void); - -#endif /* RUBY_TOPLEVEL_VARIABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h deleted file mode 100644 index d53f0d5..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef RUBY_TOPLEVEL_VERSION_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_TOPLEVEL_VERSION_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ -# define RUBY_VERSION_MAJOR RUBY_API_VERSION_MAJOR -# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR -#define RUBY_VERSION_TEENY 0 -#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL -1 - -#include "ruby/version.h" -#include "ruby/internal/abi.h" - -#ifndef RUBY_REVISION -#include "revision.h" - -#ifndef TOKEN_PASTE -#define TOKEN_PASTE(x,y) x##y -#endif -#define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000 -#define WITH_ZERO_PADDING(x) TOKEN_PASTE(0,x) -#define RUBY_BIRTH_YEAR_STR STRINGIZE(RUBY_BIRTH_YEAR) -#define RUBY_RELEASE_YEAR_STR STRINGIZE(RUBY_RELEASE_YEAR) -#if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH) -#define RUBY_RELEASE_MONTH_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_MONTH)) -#else -#define RUBY_RELEASE_MONTH_STR STRINGIZE(RUBY_RELEASE_MONTH) -#endif -#if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY) -#define RUBY_RELEASE_DAY_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_DAY)) -#else -#define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY) -#endif - -#endif - -#ifdef RUBY_ABI_VERSION -# define RUBY_ABI_VERSION_SUFFIX "+"STRINGIZE(RUBY_ABI_VERSION) -#else -# define RUBY_ABI_VERSION_SUFFIX "" -#endif -#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE -# if RUBY_LIB_VERSION_STYLE == 3 -# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \ - "."STRINGIZE(RUBY_API_VERSION_TEENY) RUBY_ABI_VERSION_SUFFIX -# elif RUBY_LIB_VERSION_STYLE == 2 -# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \ - RUBY_ABI_VERSION_SUFFIX -# endif -#endif - -#if RUBY_PATCHLEVEL == -1 -# ifdef RUBY_PATCHLEVEL_NAME -# define RUBY_PATCHLEVEL_STR STRINGIZE(RUBY_PATCHLEVEL_NAME) -# else -# define RUBY_PATCHLEVEL_STR "preview1" -# endif -#elif defined RUBY_ABI_VERSION -# error RUBY_ABI_VERSION is defined in non-development branch -#else -# define RUBY_PATCHLEVEL_STR "" -#endif - -#endif /* RUBY_TOPLEVEL_VERSION_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc deleted file mode 100644 index 7bca0db..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc +++ /dev/null @@ -1,5643 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is VM main loop. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/vm.inc.erb" - or tool/insns2vm.rb - */ - -#include "vm_insnhelper.h" - -/* insn nop()()() */ -INSN_ENTRY(nop) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(nop); - DEBUG_ENTER_INSN("nop"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _nop() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(nop); -} - -/* insn getlocal(idx, level)()(val) */ -INSN_ENTRY(getlocal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getlocal); - DEBUG_ENTER_INSN("getlocal"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getlocal(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getlocal -# line 81 "insns.def" -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} -# line 95 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getlocal); -} - -/* insn setlocal(idx, level)(val)() */ -INSN_ENTRY(setlocal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setlocal); - DEBUG_ENTER_INSN("setlocal"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setlocal(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setlocal -# line 95 "insns.def" -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} -# line 140 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setlocal); -} - -/* insn getblockparam(idx, level)()(val) */ -INSN_ENTRY(getblockparam) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getblockparam); - DEBUG_ENTER_INSN("getblockparam"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getblockparam(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getblockparam -# line 107 "insns.def" -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - val = rb_vm_bh_to_procval(ec, VM_ENV_BLOCK_HANDLER(ep)); - vm_env_write(ep, -(int)idx, val); - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); - } - else { - val = *(ep - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); - } -} -# line 192 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getblockparam); -} - -/* insn setblockparam(idx, level)(val)() */ -INSN_ENTRY(setblockparam) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setblockparam); - DEBUG_ENTER_INSN("setblockparam"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setblockparam(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setblockparam -# line 129 "insns.def" -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - vm_env_write(ep, -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); - - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); -} -# line 242 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setblockparam); -} - -/* insn getblockparamproxy(idx, level)()(val) */ -INSN_ENTRY(getblockparamproxy) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getblockparamproxy); - DEBUG_ENTER_INSN("getblockparamproxy"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getblockparamproxy(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getblockparamproxy -# line 148 "insns.def" -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - VALUE block_handler = VM_ENV_BLOCK_HANDLER(ep); - - if (block_handler) { - switch (vm_block_handler_type(block_handler)) { - case block_handler_type_iseq: - case block_handler_type_ifunc: - val = rb_block_param_proxy; - break; - case block_handler_type_symbol: - val = rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler)); - goto INSN_LABEL(set); - case block_handler_type_proc: - val = VM_BH_TO_PROC(block_handler); - goto INSN_LABEL(set); - default: - VM_UNREACHABLE(getblockparamproxy); - } - } - else { - val = Qnil; - INSN_LABEL(set): - vm_env_write(ep, -(int)idx, val); - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); - } - } - else { - val = *(ep - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); - } -} -# line 315 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getblockparamproxy); -} - -/* insn getspecial(key, type)()(val) */ -INSN_ENTRY(getspecial) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getspecial); - DEBUG_ENTER_INSN("getspecial"); - - /* ### Declare and assign variables. ### */ - rb_num_t key = (rb_num_t)GET_OPERAND(1); - rb_num_t type = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getspecial(key, type) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, type); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getspecial -# line 193 "insns.def" -{ - val = vm_getspecial(ec, GET_LEP(), key, type); -} -# line 358 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getspecial); -} - -/* insn setspecial(key)(obj)() */ -INSN_ENTRY(setspecial) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setspecial); - DEBUG_ENTER_INSN("setspecial"); - - /* ### Declare and assign variables. ### */ - rb_num_t key = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setspecial(key) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE obj = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setspecial -# line 203 "insns.def" -{ - lep_svar_set(ec, GET_LEP(), key, obj); -} -# line 399 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setspecial); -} - -/* insn getinstancevariable(id, ic)()(val) */ -INSN_ENTRY(getinstancevariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getinstancevariable); - DEBUG_ENTER_INSN("getinstancevariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - IVC ic = (IVC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getinstancevariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getinstancevariable -# line 215 "insns.def" -{ - val = vm_getinstancevariable(GET_ISEQ(), GET_SELF(), id, ic); -} -# line 439 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getinstancevariable); -} - -/* insn setinstancevariable(id, ic)(val)() */ -INSN_ENTRY(setinstancevariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setinstancevariable); - DEBUG_ENTER_INSN("setinstancevariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - IVC ic = (IVC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setinstancevariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setinstancevariable -# line 226 "insns.def" -{ - vm_setinstancevariable(GET_ISEQ(), GET_SELF(), id, val, ic); -} -# line 482 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setinstancevariable); -} - -/* insn getclassvariable(id, ic)()(val) */ -INSN_ENTRY(getclassvariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getclassvariable); - DEBUG_ENTER_INSN("getclassvariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ICVARC ic = (ICVARC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getclassvariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getclassvariable -# line 238 "insns.def" -{ - rb_control_frame_t *cfp = GET_CFP(); - val = vm_getclassvariable(GET_ISEQ(), cfp, id, ic); -} -# line 523 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getclassvariable); -} - -/* insn setclassvariable(id, ic)(val)() */ -INSN_ENTRY(setclassvariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setclassvariable); - DEBUG_ENTER_INSN("setclassvariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ICVARC ic = (ICVARC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setclassvariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setclassvariable -# line 251 "insns.def" -{ - vm_ensure_not_refinement_module(GET_SELF()); - vm_setclassvariable(GET_ISEQ(), GET_CFP(), id, val, ic); -} -# line 567 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setclassvariable); -} - -/* insn opt_getconstant_path(ic)()(val) */ -INSN_ENTRY(opt_getconstant_path) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_getconstant_path); - DEBUG_ENTER_INSN("opt_getconstant_path"); - - /* ### Declare and assign variables. ### */ - IC ic = (IC)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_getconstant_path(ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_getconstant_path -# line 262 "insns.def" -{ - val = rb_vm_opt_getconstant_path(ec, GET_CFP(), ic); -} -# line 605 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_getconstant_path); -} - -/* insn getconstant(id)(klass, allow_nil)(val) */ -INSN_ENTRY(getconstant) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getconstant); - DEBUG_ENTER_INSN("getconstant"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getconstant(id) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE klass = TOPN(1); - VALUE allow_nil = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getconstant -# line 277 "insns.def" -{ - val = vm_get_ev_const(ec, klass, id, allow_nil == Qtrue, 0); -} -# line 648 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getconstant); -} - -/* insn setconstant(id)(val, cbase)() */ -INSN_ENTRY(setconstant) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setconstant); - DEBUG_ENTER_INSN("setconstant"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setconstant(id) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(1); - VALUE cbase = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setconstant -# line 293 "insns.def" -{ - vm_check_if_namespace(cbase); - vm_ensure_not_refinement_module(GET_SELF()); - rb_const_set(cbase, id, val); -} -# line 692 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setconstant); -} - -/* insn getglobal(gid)()(val) */ -INSN_ENTRY(getglobal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getglobal); - DEBUG_ENTER_INSN("getglobal"); - - /* ### Declare and assign variables. ### */ - ID gid = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getglobal(gid) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, gid); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getglobal -# line 306 "insns.def" -{ - val = rb_gvar_get(gid); -} -# line 730 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getglobal); -} - -/* insn setglobal(gid)(val)() */ -INSN_ENTRY(setglobal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setglobal); - DEBUG_ENTER_INSN("setglobal"); - - /* ### Declare and assign variables. ### */ - ID gid = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setglobal(gid) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, gid); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setglobal -# line 317 "insns.def" -{ - rb_gvar_set(gid, val); -} -# line 771 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setglobal); -} - -/* insn putnil()()(val) */ -INSN_ENTRY(putnil) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putnil); - DEBUG_ENTER_INSN("putnil"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _putnil() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putnil -# line 331 "insns.def" -{ - val = Qnil; -} -# line 807 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putnil); -} - -/* insn putself()()(val) */ -INSN_ENTRY(putself) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putself); - DEBUG_ENTER_INSN("putself"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _putself() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putself -# line 341 "insns.def" -{ - val = GET_SELF(); -} -# line 846 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putself); -} - -/* insn putobject(val)()(val) */ -INSN_ENTRY(putobject) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putobject); - DEBUG_ENTER_INSN("putobject"); - - /* ### Declare and assign variables. ### */ - VALUE val = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putobject(val) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, val); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putobject); -} - -/* insn putspecialobject(value_type)()(val) */ -INSN_ENTRY(putspecialobject) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putspecialobject); - DEBUG_ENTER_INSN("putspecialobject"); - - /* ### Declare and assign variables. ### */ - rb_num_t value_type = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putspecialobject(value_type) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, value_type); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putspecialobject -# line 364 "insns.def" -{ - enum vm_special_object_type type; - - type = (enum vm_special_object_type)value_type; - val = vm_get_special_object(GET_EP(), type); -} -# line 919 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putspecialobject); -} - -/* insn putstring(str)()(val) */ -INSN_ENTRY(putstring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putstring); - DEBUG_ENTER_INSN("putstring"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putstring(str) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putstring -# line 377 "insns.def" -{ - val = rb_ec_str_resurrect(ec, str, false); -} -# line 960 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putstring); -} - -/* insn putchilledstring(str)()(val) */ -INSN_ENTRY(putchilledstring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putchilledstring); - DEBUG_ENTER_INSN("putchilledstring"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putchilledstring(str) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putchilledstring -# line 387 "insns.def" -{ - val = rb_ec_str_resurrect(ec, str, true); -} -# line 1001 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putchilledstring); -} - -/* insn concatstrings(num)(...)(val) */ -INSN_ENTRY(concatstrings) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(concatstrings); - DEBUG_ENTER_INSN("concatstrings"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _concatstrings(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN concatstrings -# line 401 "insns.def" -{ - val = rb_str_concat_literals(num, STACK_ADDR_FROM_TOP(num)); -} -# line 1042 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(concatstrings); -} - -/* insn anytostring()(val, str)(val) */ -INSN_ENTRY(anytostring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(anytostring); - DEBUG_ENTER_INSN("anytostring"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _anytostring() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(1); - VALUE str = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN anytostring -# line 412 "insns.def" -{ - val = rb_obj_as_string_result(str, val); -} -# line 1082 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(anytostring); -} - -/* insn toregexp(opt, cnt)(...)(val) */ -INSN_ENTRY(toregexp) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(toregexp); - DEBUG_ENTER_INSN("toregexp"); - - /* ### Declare and assign variables. ### */ - rb_num_t opt = (rb_num_t)GET_OPERAND(1); - rb_num_t cnt = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _toregexp(opt, cnt) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, opt); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cnt); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN toregexp -# line 428 "insns.def" -{ - const VALUE ary = rb_ary_tmp_new_from_values(0, cnt, STACK_ADDR_FROM_TOP(cnt)); - val = rb_reg_new_ary(ary, (int)opt); - rb_ary_clear(ary); -} -# line 1127 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(toregexp); -} - -/* insn intern()(str)(sym) */ -INSN_ENTRY(intern) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(intern); - DEBUG_ENTER_INSN("intern"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _intern() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE str = TOPN(0); - VALUE sym; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN intern -# line 440 "insns.def" -{ - sym = rb_str_intern(str); -} -# line 1167 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = sym; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(intern); -} - -/* insn newarray(num)(...)(val) */ -INSN_ENTRY(newarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newarray); - DEBUG_ENTER_INSN("newarray"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newarray(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newarray -# line 451 "insns.def" -{ - val = rb_ec_ary_new_from_values(ec, num, STACK_ADDR_FROM_TOP(num)); -} -# line 1208 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newarray); -} - -/* insn newarraykwsplat(num)(...)(val) */ -INSN_ENTRY(newarraykwsplat) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newarraykwsplat); - DEBUG_ENTER_INSN("newarraykwsplat"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newarraykwsplat(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newarraykwsplat -# line 466 "insns.def" -{ - if (RHASH_EMPTY_P(*STACK_ADDR_FROM_TOP(1))) { - val = rb_ary_new4(num-1, STACK_ADDR_FROM_TOP(num)); - } - else { - val = rb_ary_new4(num, STACK_ADDR_FROM_TOP(num)); - } -} -# line 1254 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newarraykwsplat); -} - -/* insn pushtoarraykwsplat()(ary, hash)(ary) */ -INSN_ENTRY(pushtoarraykwsplat) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(pushtoarraykwsplat); - DEBUG_ENTER_INSN("pushtoarraykwsplat"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _pushtoarraykwsplat() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary = TOPN(1); - VALUE hash = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN pushtoarraykwsplat -# line 483 "insns.def" -{ - if (!RHASH_EMPTY_P(hash)) { - rb_ary_push(ary, hash); - } -} -# line 1296 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = ary; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(pushtoarraykwsplat); -} - -/* insn duparray(ary)()(val) */ -INSN_ENTRY(duparray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(duparray); - DEBUG_ENTER_INSN("duparray"); - - /* ### Declare and assign variables. ### */ - VALUE ary = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _duparray(ary) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ary); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN duparray -# line 495 "insns.def" -{ - RUBY_DTRACE_CREATE_HOOK(ARRAY, RARRAY_LEN(ary)); - val = rb_ary_resurrect(ary); -} -# line 1338 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(duparray); -} - -/* insn duphash(hash)()(val) */ -INSN_ENTRY(duphash) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(duphash); - DEBUG_ENTER_INSN("duphash"); - - /* ### Declare and assign variables. ### */ - VALUE hash = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _duphash(hash) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN duphash -# line 506 "insns.def" -{ - RUBY_DTRACE_CREATE_HOOK(HASH, RHASH_SIZE(hash) << 1); - val = rb_hash_resurrect(hash); -} -# line 1380 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(duphash); -} - -/* insn expandarray(num, flag)(..., ary)(...) */ -INSN_ENTRY(expandarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(expandarray); - DEBUG_ENTER_INSN("expandarray"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); - rb_num_t flag = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _expandarray(num, flag) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, flag); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN expandarray -# line 528 "insns.def" -{ - vm_expandarray(GET_CFP(), ary, num, (int)flag); -} -# line 1423 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(expandarray); -} - -/* insn concatarray()(ary1, ary2)(ary) */ -INSN_ENTRY(concatarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(concatarray); - DEBUG_ENTER_INSN("concatarray"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _concatarray() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary1 = TOPN(1); - VALUE ary2 = TOPN(0); - VALUE ary; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN concatarray -# line 541 "insns.def" -{ - ary = vm_concat_array(ary1, ary2); -} -# line 1459 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = ary; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(concatarray); -} - -/* insn concattoarray()(ary1, ary2)(ary) */ -INSN_ENTRY(concattoarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(concattoarray); - DEBUG_ENTER_INSN("concattoarray"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _concattoarray() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary1 = TOPN(1); - VALUE ary2 = TOPN(0); - VALUE ary; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN concattoarray -# line 555 "insns.def" -{ - ary = vm_concat_to_array(ary1, ary2); -} -# line 1500 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = ary; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(concattoarray); -} - -/* insn pushtoarray(num)(...)(val) */ -INSN_ENTRY(pushtoarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(pushtoarray); - DEBUG_ENTER_INSN("pushtoarray"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _pushtoarray(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN pushtoarray -# line 566 "insns.def" -{ - const VALUE *objp = STACK_ADDR_FROM_TOP(num); - val = rb_ary_cat(*(objp-1), objp, num); -} -# line 1542 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(pushtoarray); -} - -/* insn splatarray(flag)(ary)(obj) */ -INSN_ENTRY(splatarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(splatarray); - DEBUG_ENTER_INSN("splatarray"); - - /* ### Declare and assign variables. ### */ - VALUE flag = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _splatarray(flag) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary = TOPN(0); - VALUE obj; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN splatarray -# line 578 "insns.def" -{ - obj = vm_splat_array(flag, ary); -} -# line 1584 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = obj; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(splatarray); -} - -/* insn splatkw()(hash, block)(obj, block) */ -INSN_ENTRY(splatkw) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(splatkw); - DEBUG_ENTER_INSN("splatkw"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _splatkw() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE hash = TOPN(1); - VALUE block = TOPN(0); - VALUE obj; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN splatkw -# line 589 "insns.def" -{ - if (NIL_P(hash)) { - obj = Qnil; - } - else { - obj = rb_to_hash_type(hash); - } -} -# line 1630 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = block; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - TOPN(1) = obj; - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(splatkw); -} - -/* insn newhash(num)(...)(val) */ -INSN_ENTRY(newhash) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newhash); - DEBUG_ENTER_INSN("newhash"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newhash(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newhash -# line 606 "insns.def" -{ - RUBY_DTRACE_CREATE_HOOK(HASH, num); - - if (num) { - val = rb_hash_new_with_size(num / 2); - rb_hash_bulk_insert(num, STACK_ADDR_FROM_TOP(num), val); - } - else { - val = rb_hash_new(); - } -} -# line 1682 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newhash); -} - -/* insn newrange(flag)(low, high)(val) */ -INSN_ENTRY(newrange) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newrange); - DEBUG_ENTER_INSN("newrange"); - - /* ### Declare and assign variables. ### */ - rb_num_t flag = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newrange(flag) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE low = TOPN(1); - VALUE high = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newrange -# line 626 "insns.def" -{ - val = rb_range_new(low, high, (int)flag); -} -# line 1725 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newrange); -} - -/* insn pop()(val)() */ -INSN_ENTRY(pop) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(pop); - DEBUG_ENTER_INSN("pop"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _pop() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN pop -# line 640 "insns.def" -{ - (void)val; - /* none */ -} -# line 1765 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(pop); -} - -/* insn dup()(val)(val1, val2) */ -INSN_ENTRY(dup) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(dup); - DEBUG_ENTER_INSN("dup"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _dup() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - VALUE val1; - VALUE val2; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN dup -# line 651 "insns.def" -{ - val1 = val2 = val; -} -# line 1803 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val2; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - TOPN(1) = val1; - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(dup); -} - -/* insn dupn(n)(...)(...) */ -INSN_ENTRY(dupn) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(dupn); - DEBUG_ENTER_INSN("dupn"); - - /* ### Declare and assign variables. ### */ - rb_num_t n = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _dupn(n) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN dupn -# line 662 "insns.def" -{ - void *dst = GET_SP(); - void *src = STACK_ADDR_FROM_TOP(n); - - MEMCPY(dst, src, VALUE, n); -} -# line 1848 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(dupn); -} - -/* insn swap()(val, obj)(obj, val) */ -INSN_ENTRY(swap) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(swap); - DEBUG_ENTER_INSN("swap"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _swap() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(1); - VALUE obj = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - TOPN(1) = obj; - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(swap); -} - -/* insn opt_reverse(n)(...)(...) */ -INSN_ENTRY(opt_reverse) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_reverse); - DEBUG_ENTER_INSN("opt_reverse"); - - /* ### Declare and assign variables. ### */ - rb_num_t n = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_reverse(n) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_reverse -# line 686 "insns.def" -{ - rb_num_t i; - VALUE *sp = STACK_ADDR_FROM_TOP(n); - - for (i=0; iiseq_encoded, GET_SP(), - ISEQ_BODY(class_iseq)->local_table_size, - ISEQ_BODY(class_iseq)->stack_max); - RESTORE_REGS(); - NEXT_INSN(); -} -# line 2312 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(defineclass); -} - -/* insn definemethod(id, iseq)()() */ -INSN_ENTRY(definemethod) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(definemethod); - DEBUG_ENTER_INSN("definemethod"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ISEQ iseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _definemethod(id, iseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, iseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN definemethod -# line 844 "insns.def" -{ - vm_define_method(ec, Qnil, id, (VALUE)iseq, FALSE); -} -# line 2352 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(definemethod); -} - -/* insn definesmethod(id, iseq)(obj)() */ -INSN_ENTRY(definesmethod) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(definesmethod); - DEBUG_ENTER_INSN("definesmethod"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ISEQ iseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _definesmethod(id, iseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE obj = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, iseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN definesmethod -# line 853 "insns.def" -{ - vm_define_method(ec, obj, id, (VALUE)iseq, TRUE); -} -# line 2392 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(definesmethod); -} - -/* insn send(cd, blockiseq)(...)(val) */ -INSN_ENTRY(send) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(send); - DEBUG_ENTER_INSN("send"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); - ISEQ blockiseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _send(cd, blockiseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, blockiseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN send -# line 869 "insns.def" -{ - VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, false); - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2439 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(send); -} - -/* insn opt_send_without_block(cd)(...)(val) */ -INSN_ENTRY(opt_send_without_block) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_send_without_block); - DEBUG_ENTER_INSN("opt_send_without_block"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_send_without_block(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_send_without_block -# line 889 "insns.def" -{ - VALUE bh = VM_BLOCK_HANDLER_NONE; - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2485 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_send_without_block); -} - -/* insn objtostring(cd)(recv)(val) */ -INSN_ENTRY(objtostring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(objtostring); - DEBUG_ENTER_INSN("objtostring"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _objtostring(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN objtostring -# line 907 "insns.def" -{ - val = vm_objtostring(GET_ISEQ(), recv, cd); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 2528 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(objtostring); -} - -/* insn opt_str_freeze(str, cd)()(val) */ -INSN_ENTRY(opt_str_freeze) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_str_freeze); - DEBUG_ENTER_INSN("opt_str_freeze"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_str_freeze(str, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_str_freeze -# line 920 "insns.def" -{ - val = vm_opt_str_freeze(str, BOP_FREEZE, idFreeze); - - if (UNDEF_P(val)) { - PUSH(rb_str_resurrect(str)); - CALL_SIMPLE_METHOD(); - } -} -# line 2576 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_str_freeze); -} - -/* insn opt_nil_p(cd)(recv)(val) */ -INSN_ENTRY(opt_nil_p) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_nil_p); - DEBUG_ENTER_INSN("opt_nil_p"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_nil_p(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_nil_p -# line 935 "insns.def" -{ - val = vm_opt_nil_p(GET_ISEQ(), cd, recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 2622 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_nil_p); -} - -/* insn opt_str_uminus(str, cd)()(val) */ -INSN_ENTRY(opt_str_uminus) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_str_uminus); - DEBUG_ENTER_INSN("opt_str_uminus"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_str_uminus(str, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_str_uminus -# line 948 "insns.def" -{ - val = vm_opt_str_freeze(str, BOP_UMINUS, idUMinus); - - if (UNDEF_P(val)) { - PUSH(rb_str_resurrect(str)); - CALL_SIMPLE_METHOD(); - } -} -# line 2670 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_str_uminus); -} - -/* insn opt_newarray_send(num, method)(...)(val) */ -INSN_ENTRY(opt_newarray_send) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_newarray_send); - DEBUG_ENTER_INSN("opt_newarray_send"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); - ID method = (ID)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_newarray_send(num, method) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, method); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_newarray_send -# line 969 "insns.def" -{ - switch(method) { - case idHash: - val = vm_opt_newarray_hash(ec, num, STACK_ADDR_FROM_TOP(num)); - break; - case idMin: - val = vm_opt_newarray_min(ec, num, STACK_ADDR_FROM_TOP(num)); - break; - case idMax: - val = vm_opt_newarray_max(ec, num, STACK_ADDR_FROM_TOP(num)); - break; - default: - rb_bug("unreachable"); - } -} -# line 2725 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_newarray_send); -} - -/* insn invokesuper(cd, blockiseq)(...)(val) */ -INSN_ENTRY(invokesuper) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokesuper); - DEBUG_ENTER_INSN("invokesuper"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); - ISEQ blockiseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _invokesuper(cd, blockiseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, blockiseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokesuper -# line 993 "insns.def" -{ - VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, true); - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2776 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokesuper); -} - -/* insn invokeblock(cd)(...)(val) */ -INSN_ENTRY(invokeblock) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokeblock); - DEBUG_ENTER_INSN("invokeblock"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _invokeblock(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokeblock -# line 1013 "insns.def" -{ - VALUE bh = VM_BLOCK_HANDLER_NONE; - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_invokeblock); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2822 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokeblock); -} - -/* insn leave()(val)(val) */ -INSN_ENTRY(leave) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(leave); - DEBUG_ENTER_INSN("leave"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _leave() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN leave -# line 1035 "insns.def" -{ - if (OPT_CHECKED_RUN) { - const VALUE *const bp = vm_base_ptr(GET_CFP()); - if (GET_SP() != bp) { - vm_stack_consistency_error(ec, GET_CFP(), bp); - } - } - - if (vm_pop_frame(ec, GET_CFP(), GET_EP())) { -# if OPT_CALL_THREADED_CODE - rb_ec_thread_ptr(ec)->retval = val; - return 0; -# else - return val; -# endif - } - else { - RESTORE_REGS(); - } -} -# line 2876 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(leave); -} - -/* insn throw(throw_state)(throwobj)(val) */ -INSN_ENTRY(throw) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(throw); - DEBUG_ENTER_INSN("throw"); - - /* ### Declare and assign variables. ### */ - rb_num_t throw_state = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _throw(throw_state) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE throwobj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, throw_state); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN throw -# line 1068 "insns.def" -{ - val = vm_throw(ec, GET_CFP(), throw_state, throwobj); - THROW_EXCEPTION(val); - /* unreachable */ -} -# line 2917 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(throw); -} - -/* insn jump(dst)()() */ -INSN_ENTRY(jump) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(jump); - DEBUG_ENTER_INSN("jump"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _jump(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN jump -# line 1086 "insns.def" -{ - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); -} -# line 2958 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(jump); -} - -/* insn branchif(dst)(val)() */ -INSN_ENTRY(branchif) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(branchif); - DEBUG_ENTER_INSN("branchif"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _branchif(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN branchif -# line 1099 "insns.def" -{ - if (RTEST(val)) { - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); - } -} -# line 2999 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(branchif); -} - -/* insn branchunless(dst)(val)() */ -INSN_ENTRY(branchunless) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(branchunless); - DEBUG_ENTER_INSN("branchunless"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _branchunless(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN branchunless -# line 1114 "insns.def" -{ - if (!RTEST(val)) { - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); - } -} -# line 3040 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(branchunless); -} - -/* insn branchnil(dst)(val)() */ -INSN_ENTRY(branchnil) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(branchnil); - DEBUG_ENTER_INSN("branchnil"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _branchnil(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN branchnil -# line 1129 "insns.def" -{ - if (NIL_P(val)) { - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); - } -} -# line 3081 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(branchnil); -} - -/* insn once(iseq, ise)()(val) */ -INSN_ENTRY(once) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(once); - DEBUG_ENTER_INSN("once"); - - /* ### Declare and assign variables. ### */ - ISEQ iseq = (ISEQ)GET_OPERAND(1); - ISE ise = (ISE)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _once(iseq, ise) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, iseq); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ise); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN once -# line 1146 "insns.def" -{ - val = vm_once_dispatch(ec, iseq, ise); -} -# line 3122 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(once); -} - -/* insn opt_case_dispatch(hash, else_offset)(..., key)() */ -INSN_ENTRY(opt_case_dispatch) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_case_dispatch); - DEBUG_ENTER_INSN("opt_case_dispatch"); - - /* ### Declare and assign variables. ### */ - CDHASH hash = (CDHASH)GET_OPERAND(1); - OFFSET else_offset = (OFFSET)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_case_dispatch(hash, else_offset) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE key = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, else_offset); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_case_dispatch -# line 1157 "insns.def" -{ - OFFSET dst = vm_case_dispatch(hash, else_offset, key); - - if (dst) { - JUMP(dst); - } -} -# line 3166 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_case_dispatch); -} - -/* insn opt_plus(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_plus) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_plus); - DEBUG_ENTER_INSN("opt_plus"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_plus(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_plus -# line 1173 "insns.def" -{ - val = vm_opt_plus(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3210 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_plus); -} - -/* insn opt_minus(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_minus) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_minus); - DEBUG_ENTER_INSN("opt_minus"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_minus(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_minus -# line 1187 "insns.def" -{ - val = vm_opt_minus(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3257 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_minus); -} - -/* insn opt_mult(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_mult) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_mult); - DEBUG_ENTER_INSN("opt_mult"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_mult(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_mult -# line 1201 "insns.def" -{ - val = vm_opt_mult(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3304 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_mult); -} - -/* insn opt_div(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_div) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_div); - DEBUG_ENTER_INSN("opt_div"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_div(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_div -# line 1218 "insns.def" -{ - val = vm_opt_div(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3351 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_div); -} - -/* insn opt_mod(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_mod) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_mod); - DEBUG_ENTER_INSN("opt_mod"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_mod(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_mod -# line 1234 "insns.def" -{ - val = vm_opt_mod(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3398 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_mod); -} - -/* insn opt_eq(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_eq) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_eq); - DEBUG_ENTER_INSN("opt_eq"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_eq(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_eq -# line 1248 "insns.def" -{ - val = opt_equality(GET_ISEQ(), recv, obj, cd); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3445 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_eq); -} - -/* insn opt_neq(cd_eq, cd)(recv, obj)(val) */ -INSN_ENTRY(opt_neq) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_neq); - DEBUG_ENTER_INSN("opt_neq"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd_eq = (CALL_DATA)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_neq(cd_eq, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd_eq); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_neq -# line 1262 "insns.def" -{ - val = vm_opt_neq(GET_ISEQ(), cd, cd_eq, recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3494 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_neq); -} - -/* insn opt_lt(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_lt) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_lt); - DEBUG_ENTER_INSN("opt_lt"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_lt(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_lt -# line 1276 "insns.def" -{ - val = vm_opt_lt(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3541 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_lt); -} - -/* insn opt_le(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_le) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_le); - DEBUG_ENTER_INSN("opt_le"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_le(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_le -# line 1290 "insns.def" -{ - val = vm_opt_le(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3588 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_le); -} - -/* insn opt_gt(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_gt) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_gt); - DEBUG_ENTER_INSN("opt_gt"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_gt(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_gt -# line 1304 "insns.def" -{ - val = vm_opt_gt(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3635 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_gt); -} - -/* insn opt_ge(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_ge) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_ge); - DEBUG_ENTER_INSN("opt_ge"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_ge(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_ge -# line 1318 "insns.def" -{ - val = vm_opt_ge(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3682 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_ge); -} - -/* insn opt_ltlt(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_ltlt) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_ltlt); - DEBUG_ENTER_INSN("opt_ltlt"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_ltlt(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_ltlt -# line 1336 "insns.def" -{ - val = vm_opt_ltlt(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3729 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_ltlt); -} - -/* insn opt_and(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_and) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_and); - DEBUG_ENTER_INSN("opt_and"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_and(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_and -# line 1350 "insns.def" -{ - val = vm_opt_and(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3776 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_and); -} - -/* insn opt_or(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_or) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_or); - DEBUG_ENTER_INSN("opt_or"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_or(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_or -# line 1364 "insns.def" -{ - val = vm_opt_or(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3823 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_or); -} - -/* insn opt_aref(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_aref) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aref); - DEBUG_ENTER_INSN("opt_aref"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_aref(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aref -# line 1383 "insns.def" -{ - val = vm_opt_aref(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3870 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aref); -} - -/* insn opt_aset(cd)(recv, obj, set)(val) */ -INSN_ENTRY(opt_aset) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aset); - DEBUG_ENTER_INSN("opt_aset"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_aset(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(2); - VALUE obj = TOPN(1); - VALUE set = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aset -# line 1400 "insns.def" -{ - val = vm_opt_aset(recv, obj, set); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3918 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aset); -} - -/* insn opt_aset_with(key, cd)(recv, val)(val) */ -INSN_ENTRY(opt_aset_with) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aset_with); - DEBUG_ENTER_INSN("opt_aset_with"); - - /* ### Declare and assign variables. ### */ - VALUE key = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_aset_with(key, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aset_with -# line 1416 "insns.def" -{ - VALUE tmp = vm_opt_aset_with(recv, key, val); - - if (!UNDEF_P(tmp)) { - val = tmp; - } - else { - TOPN(0) = rb_str_resurrect(key); - PUSH(val); - CALL_SIMPLE_METHOD(); - } -} -# line 3971 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aset_with); -} - -/* insn opt_aref_with(key, cd)(recv)(val) */ -INSN_ENTRY(opt_aref_with) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aref_with); - DEBUG_ENTER_INSN("opt_aref_with"); - - /* ### Declare and assign variables. ### */ - VALUE key = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_aref_with(key, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aref_with -# line 1437 "insns.def" -{ - val = vm_opt_aref_with(recv, key); - - if (UNDEF_P(val)) { - PUSH(rb_str_resurrect(key)); - CALL_SIMPLE_METHOD(); - } -} -# line 4020 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aref_with); -} - -/* insn opt_length(cd)(recv)(val) */ -INSN_ENTRY(opt_length) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_length); - DEBUG_ENTER_INSN("opt_length"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_length(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_length -# line 1452 "insns.def" -{ - val = vm_opt_length(recv, BOP_LENGTH); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4066 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_length); -} - -/* insn opt_size(cd)(recv)(val) */ -INSN_ENTRY(opt_size) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_size); - DEBUG_ENTER_INSN("opt_size"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_size(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_size -# line 1466 "insns.def" -{ - val = vm_opt_length(recv, BOP_SIZE); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4112 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_size); -} - -/* insn opt_empty_p(cd)(recv)(val) */ -INSN_ENTRY(opt_empty_p) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_empty_p); - DEBUG_ENTER_INSN("opt_empty_p"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_empty_p(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_empty_p -# line 1480 "insns.def" -{ - val = vm_opt_empty_p(recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4158 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_empty_p); -} - -/* insn opt_succ(cd)(recv)(val) */ -INSN_ENTRY(opt_succ) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_succ); - DEBUG_ENTER_INSN("opt_succ"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_succ(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_succ -# line 1494 "insns.def" -{ - val = vm_opt_succ(recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4204 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_succ); -} - -/* insn opt_not(cd)(recv)(val) */ -INSN_ENTRY(opt_not) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_not); - DEBUG_ENTER_INSN("opt_not"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_not(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_not -# line 1508 "insns.def" -{ - val = vm_opt_not(GET_ISEQ(), cd, recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4250 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_not); -} - -/* insn opt_regexpmatch2(cd)(obj2, obj1)(val) */ -INSN_ENTRY(opt_regexpmatch2) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_regexpmatch2); - DEBUG_ENTER_INSN("opt_regexpmatch2"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_regexpmatch2(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE obj2 = TOPN(1); - VALUE obj1 = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_regexpmatch2 -# line 1523 "insns.def" -{ - val = vm_opt_regexpmatch2(obj2, obj1); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4297 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_regexpmatch2); -} - -/* insn invokebuiltin(bf)(...)(val) */ -INSN_ENTRY(invokebuiltin) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokebuiltin); - DEBUG_ENTER_INSN("invokebuiltin"); - - /* ### Declare and assign variables. ### */ - RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _invokebuiltin(bf) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokebuiltin -# line 1539 "insns.def" -{ - val = vm_invoke_builtin(ec, reg_cfp, bf, STACK_ADDR_FROM_TOP(bf->argc)); -} -# line 4338 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokebuiltin); -} - -/* insn opt_invokebuiltin_delegate(bf, index)()(val) */ -INSN_ENTRY(opt_invokebuiltin_delegate) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_invokebuiltin_delegate); - DEBUG_ENTER_INSN("opt_invokebuiltin_delegate"); - - /* ### Declare and assign variables. ### */ - RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); - rb_num_t index = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_invokebuiltin_delegate(bf, index) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, index); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_invokebuiltin_delegate -# line 1550 "insns.def" -{ - val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index); -} -# line 4381 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_invokebuiltin_delegate); -} - -/* insn opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -INSN_ENTRY(opt_invokebuiltin_delegate_leave) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_invokebuiltin_delegate_leave); - DEBUG_ENTER_INSN("opt_invokebuiltin_delegate_leave"); - - /* ### Declare and assign variables. ### */ - RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); - rb_num_t index = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_invokebuiltin_delegate_leave(bf, index) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, index); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_invokebuiltin_delegate_leave -# line 1561 "insns.def" -{ - val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index); - - /* leave fastpath */ - /* TracePoint/return fallbacks this insn to opt_invokebuiltin_delegate */ - if (vm_pop_frame(ec, GET_CFP(), GET_EP())) { -# if OPT_CALL_THREADED_CODE - rb_ec_thread_ptr(ec)->retval = val; - return 0; -# else - return val; -# endif - } - else { - RESTORE_REGS(); - } -} -# line 4438 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_invokebuiltin_delegate_leave); -} - -/* insn getlocal_WC_0(idx)()(val) */ -INSN_ENTRY(getlocal_WC_0) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getlocal_WC_0); - DEBUG_ENTER_INSN("getlocal_WC_0"); - - /* ### Declare and assign variables. ### */ -#line 10 "defs/opt_operand.def" - const rb_num_t level = 0; -#line 4464 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getlocal_WC_0(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getlocal_WC_0 -# line 81 "insns.def" -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} -# line 4484 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getlocal_WC_0); -} - -/* insn getlocal_WC_1(idx)()(val) */ -INSN_ENTRY(getlocal_WC_1) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getlocal_WC_1); - DEBUG_ENTER_INSN("getlocal_WC_1"); - - /* ### Declare and assign variables. ### */ -#line 11 "defs/opt_operand.def" - const rb_num_t level = 1; -#line 4510 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getlocal_WC_1(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getlocal_WC_1 -# line 81 "insns.def" -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} -# line 4530 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getlocal_WC_1); -} - -/* insn setlocal_WC_0(idx)(val)() */ -INSN_ENTRY(setlocal_WC_0) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setlocal_WC_0); - DEBUG_ENTER_INSN("setlocal_WC_0"); - - /* ### Declare and assign variables. ### */ -#line 12 "defs/opt_operand.def" - const rb_num_t level = 0; -#line 4556 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setlocal_WC_0(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setlocal_WC_0 -# line 95 "insns.def" -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} -# line 4576 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setlocal_WC_0); -} - -/* insn setlocal_WC_1(idx)(val)() */ -INSN_ENTRY(setlocal_WC_1) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setlocal_WC_1); - DEBUG_ENTER_INSN("setlocal_WC_1"); - - /* ### Declare and assign variables. ### */ -#line 13 "defs/opt_operand.def" - const rb_num_t level = 1; -#line 4599 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setlocal_WC_1(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setlocal_WC_1 -# line 95 "insns.def" -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} -# line 4619 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setlocal_WC_1); -} - -/* insn putobject_INT2FIX_0_()()(val) */ -INSN_ENTRY(putobject_INT2FIX_0_) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putobject_INT2FIX_0_); - DEBUG_ENTER_INSN("putobject_INT2FIX_0_"); - - /* ### Declare and assign variables. ### */ -#line 15 "defs/opt_operand.def" - const VALUE val = INT2FIX(0); -#line 4642 "vm.inc" -# define INSN_ATTR(x) attr_ ## x ## _putobject_INT2FIX_0_() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putobject_INT2FIX_0_); -} - -/* insn putobject_INT2FIX_1_()()(val) */ -INSN_ENTRY(putobject_INT2FIX_1_) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putobject_INT2FIX_1_); - DEBUG_ENTER_INSN("putobject_INT2FIX_1_"); - - /* ### Declare and assign variables. ### */ -#line 16 "defs/opt_operand.def" - const VALUE val = INT2FIX(1); -#line 4672 "vm.inc" -# define INSN_ATTR(x) attr_ ## x ## _putobject_INT2FIX_1_() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putobject_INT2FIX_1_); -} - -/* insn trace_nop(...)(...)(...) */ -INSN_ENTRY(trace_nop) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(nop); - END_INSN(trace_nop); -} - -/* insn trace_getlocal(...)(...)(...) */ -INSN_ENTRY(trace_getlocal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getlocal); - END_INSN(trace_getlocal); -} - -/* insn trace_setlocal(...)(...)(...) */ -INSN_ENTRY(trace_setlocal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setlocal); - END_INSN(trace_setlocal); -} - -/* insn trace_getblockparam(...)(...)(...) */ -INSN_ENTRY(trace_getblockparam) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getblockparam); - END_INSN(trace_getblockparam); -} - -/* insn trace_setblockparam(...)(...)(...) */ -INSN_ENTRY(trace_setblockparam) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setblockparam); - END_INSN(trace_setblockparam); -} - -/* insn trace_getblockparamproxy(...)(...)(...) */ -INSN_ENTRY(trace_getblockparamproxy) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getblockparamproxy); - END_INSN(trace_getblockparamproxy); -} - -/* insn trace_getspecial(...)(...)(...) */ -INSN_ENTRY(trace_getspecial) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getspecial); - END_INSN(trace_getspecial); -} - -/* insn trace_setspecial(...)(...)(...) */ -INSN_ENTRY(trace_setspecial) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setspecial); - END_INSN(trace_setspecial); -} - -/* insn trace_getinstancevariable(...)(...)(...) */ -INSN_ENTRY(trace_getinstancevariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getinstancevariable); - END_INSN(trace_getinstancevariable); -} - -/* insn trace_setinstancevariable(...)(...)(...) */ -INSN_ENTRY(trace_setinstancevariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setinstancevariable); - END_INSN(trace_setinstancevariable); -} - -/* insn trace_getclassvariable(...)(...)(...) */ -INSN_ENTRY(trace_getclassvariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getclassvariable); - END_INSN(trace_getclassvariable); -} - -/* insn trace_setclassvariable(...)(...)(...) */ -INSN_ENTRY(trace_setclassvariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setclassvariable); - END_INSN(trace_setclassvariable); -} - -/* insn trace_opt_getconstant_path(...)(...)(...) */ -INSN_ENTRY(trace_opt_getconstant_path) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_getconstant_path); - END_INSN(trace_opt_getconstant_path); -} - -/* insn trace_getconstant(...)(...)(...) */ -INSN_ENTRY(trace_getconstant) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getconstant); - END_INSN(trace_getconstant); -} - -/* insn trace_setconstant(...)(...)(...) */ -INSN_ENTRY(trace_setconstant) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setconstant); - END_INSN(trace_setconstant); -} - -/* insn trace_getglobal(...)(...)(...) */ -INSN_ENTRY(trace_getglobal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getglobal); - END_INSN(trace_getglobal); -} - -/* insn trace_setglobal(...)(...)(...) */ -INSN_ENTRY(trace_setglobal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setglobal); - END_INSN(trace_setglobal); -} - -/* insn trace_putnil(...)(...)(...) */ -INSN_ENTRY(trace_putnil) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putnil); - END_INSN(trace_putnil); -} - -/* insn trace_putself(...)(...)(...) */ -INSN_ENTRY(trace_putself) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putself); - END_INSN(trace_putself); -} - -/* insn trace_putobject(...)(...)(...) */ -INSN_ENTRY(trace_putobject) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putobject); - END_INSN(trace_putobject); -} - -/* insn trace_putspecialobject(...)(...)(...) */ -INSN_ENTRY(trace_putspecialobject) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putspecialobject); - END_INSN(trace_putspecialobject); -} - -/* insn trace_putstring(...)(...)(...) */ -INSN_ENTRY(trace_putstring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putstring); - END_INSN(trace_putstring); -} - -/* insn trace_putchilledstring(...)(...)(...) */ -INSN_ENTRY(trace_putchilledstring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putchilledstring); - END_INSN(trace_putchilledstring); -} - -/* insn trace_concatstrings(...)(...)(...) */ -INSN_ENTRY(trace_concatstrings) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(concatstrings); - END_INSN(trace_concatstrings); -} - -/* insn trace_anytostring(...)(...)(...) */ -INSN_ENTRY(trace_anytostring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(anytostring); - END_INSN(trace_anytostring); -} - -/* insn trace_toregexp(...)(...)(...) */ -INSN_ENTRY(trace_toregexp) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(toregexp); - END_INSN(trace_toregexp); -} - -/* insn trace_intern(...)(...)(...) */ -INSN_ENTRY(trace_intern) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(intern); - END_INSN(trace_intern); -} - -/* insn trace_newarray(...)(...)(...) */ -INSN_ENTRY(trace_newarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newarray); - END_INSN(trace_newarray); -} - -/* insn trace_newarraykwsplat(...)(...)(...) */ -INSN_ENTRY(trace_newarraykwsplat) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newarraykwsplat); - END_INSN(trace_newarraykwsplat); -} - -/* insn trace_pushtoarraykwsplat(...)(...)(...) */ -INSN_ENTRY(trace_pushtoarraykwsplat) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(pushtoarraykwsplat); - END_INSN(trace_pushtoarraykwsplat); -} - -/* insn trace_duparray(...)(...)(...) */ -INSN_ENTRY(trace_duparray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(duparray); - END_INSN(trace_duparray); -} - -/* insn trace_duphash(...)(...)(...) */ -INSN_ENTRY(trace_duphash) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(duphash); - END_INSN(trace_duphash); -} - -/* insn trace_expandarray(...)(...)(...) */ -INSN_ENTRY(trace_expandarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(expandarray); - END_INSN(trace_expandarray); -} - -/* insn trace_concatarray(...)(...)(...) */ -INSN_ENTRY(trace_concatarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(concatarray); - END_INSN(trace_concatarray); -} - -/* insn trace_concattoarray(...)(...)(...) */ -INSN_ENTRY(trace_concattoarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(concattoarray); - END_INSN(trace_concattoarray); -} - -/* insn trace_pushtoarray(...)(...)(...) */ -INSN_ENTRY(trace_pushtoarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(pushtoarray); - END_INSN(trace_pushtoarray); -} - -/* insn trace_splatarray(...)(...)(...) */ -INSN_ENTRY(trace_splatarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(splatarray); - END_INSN(trace_splatarray); -} - -/* insn trace_splatkw(...)(...)(...) */ -INSN_ENTRY(trace_splatkw) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(splatkw); - END_INSN(trace_splatkw); -} - -/* insn trace_newhash(...)(...)(...) */ -INSN_ENTRY(trace_newhash) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newhash); - END_INSN(trace_newhash); -} - -/* insn trace_newrange(...)(...)(...) */ -INSN_ENTRY(trace_newrange) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newrange); - END_INSN(trace_newrange); -} - -/* insn trace_pop(...)(...)(...) */ -INSN_ENTRY(trace_pop) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(pop); - END_INSN(trace_pop); -} - -/* insn trace_dup(...)(...)(...) */ -INSN_ENTRY(trace_dup) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(dup); - END_INSN(trace_dup); -} - -/* insn trace_dupn(...)(...)(...) */ -INSN_ENTRY(trace_dupn) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(dupn); - END_INSN(trace_dupn); -} - -/* insn trace_swap(...)(...)(...) */ -INSN_ENTRY(trace_swap) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(swap); - END_INSN(trace_swap); -} - -/* insn trace_opt_reverse(...)(...)(...) */ -INSN_ENTRY(trace_opt_reverse) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_reverse); - END_INSN(trace_opt_reverse); -} - -/* insn trace_topn(...)(...)(...) */ -INSN_ENTRY(trace_topn) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(topn); - END_INSN(trace_topn); -} - -/* insn trace_setn(...)(...)(...) */ -INSN_ENTRY(trace_setn) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setn); - END_INSN(trace_setn); -} - -/* insn trace_adjuststack(...)(...)(...) */ -INSN_ENTRY(trace_adjuststack) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(adjuststack); - END_INSN(trace_adjuststack); -} - -/* insn trace_defined(...)(...)(...) */ -INSN_ENTRY(trace_defined) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(defined); - END_INSN(trace_defined); -} - -/* insn trace_definedivar(...)(...)(...) */ -INSN_ENTRY(trace_definedivar) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(definedivar); - END_INSN(trace_definedivar); -} - -/* insn trace_checkmatch(...)(...)(...) */ -INSN_ENTRY(trace_checkmatch) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(checkmatch); - END_INSN(trace_checkmatch); -} - -/* insn trace_checkkeyword(...)(...)(...) */ -INSN_ENTRY(trace_checkkeyword) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(checkkeyword); - END_INSN(trace_checkkeyword); -} - -/* insn trace_checktype(...)(...)(...) */ -INSN_ENTRY(trace_checktype) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(checktype); - END_INSN(trace_checktype); -} - -/* insn trace_defineclass(...)(...)(...) */ -INSN_ENTRY(trace_defineclass) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(defineclass); - END_INSN(trace_defineclass); -} - -/* insn trace_definemethod(...)(...)(...) */ -INSN_ENTRY(trace_definemethod) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(definemethod); - END_INSN(trace_definemethod); -} - -/* insn trace_definesmethod(...)(...)(...) */ -INSN_ENTRY(trace_definesmethod) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(definesmethod); - END_INSN(trace_definesmethod); -} - -/* insn trace_send(...)(...)(...) */ -INSN_ENTRY(trace_send) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(send); - END_INSN(trace_send); -} - -/* insn trace_opt_send_without_block(...)(...)(...) */ -INSN_ENTRY(trace_opt_send_without_block) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_send_without_block); -} - -/* insn trace_objtostring(...)(...)(...) */ -INSN_ENTRY(trace_objtostring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(objtostring); - END_INSN(trace_objtostring); -} - -/* insn trace_opt_str_freeze(...)(...)(...) */ -INSN_ENTRY(trace_opt_str_freeze) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_str_freeze); - END_INSN(trace_opt_str_freeze); -} - -/* insn trace_opt_nil_p(...)(...)(...) */ -INSN_ENTRY(trace_opt_nil_p) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_nil_p); -} - -/* insn trace_opt_str_uminus(...)(...)(...) */ -INSN_ENTRY(trace_opt_str_uminus) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_str_uminus); - END_INSN(trace_opt_str_uminus); -} - -/* insn trace_opt_newarray_send(...)(...)(...) */ -INSN_ENTRY(trace_opt_newarray_send) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_newarray_send); - END_INSN(trace_opt_newarray_send); -} - -/* insn trace_invokesuper(...)(...)(...) */ -INSN_ENTRY(trace_invokesuper) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokesuper); - END_INSN(trace_invokesuper); -} - -/* insn trace_invokeblock(...)(...)(...) */ -INSN_ENTRY(trace_invokeblock) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokeblock); - END_INSN(trace_invokeblock); -} - -/* insn trace_leave(...)(...)(...) */ -INSN_ENTRY(trace_leave) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(leave); - END_INSN(trace_leave); -} - -/* insn trace_throw(...)(...)(...) */ -INSN_ENTRY(trace_throw) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(throw); - END_INSN(trace_throw); -} - -/* insn trace_jump(...)(...)(...) */ -INSN_ENTRY(trace_jump) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(jump); - END_INSN(trace_jump); -} - -/* insn trace_branchif(...)(...)(...) */ -INSN_ENTRY(trace_branchif) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(branchif); - END_INSN(trace_branchif); -} - -/* insn trace_branchunless(...)(...)(...) */ -INSN_ENTRY(trace_branchunless) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(branchunless); - END_INSN(trace_branchunless); -} - -/* insn trace_branchnil(...)(...)(...) */ -INSN_ENTRY(trace_branchnil) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(branchnil); - END_INSN(trace_branchnil); -} - -/* insn trace_once(...)(...)(...) */ -INSN_ENTRY(trace_once) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(once); - END_INSN(trace_once); -} - -/* insn trace_opt_case_dispatch(...)(...)(...) */ -INSN_ENTRY(trace_opt_case_dispatch) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_case_dispatch); - END_INSN(trace_opt_case_dispatch); -} - -/* insn trace_opt_plus(...)(...)(...) */ -INSN_ENTRY(trace_opt_plus) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_plus); -} - -/* insn trace_opt_minus(...)(...)(...) */ -INSN_ENTRY(trace_opt_minus) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_minus); -} - -/* insn trace_opt_mult(...)(...)(...) */ -INSN_ENTRY(trace_opt_mult) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_mult); -} - -/* insn trace_opt_div(...)(...)(...) */ -INSN_ENTRY(trace_opt_div) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_div); -} - -/* insn trace_opt_mod(...)(...)(...) */ -INSN_ENTRY(trace_opt_mod) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_mod); -} - -/* insn trace_opt_eq(...)(...)(...) */ -INSN_ENTRY(trace_opt_eq) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_eq); -} - -/* insn trace_opt_neq(...)(...)(...) */ -INSN_ENTRY(trace_opt_neq) -{ - vm_trace(ec, GET_CFP()); - ADD_PC(1); - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_neq); -} - -/* insn trace_opt_lt(...)(...)(...) */ -INSN_ENTRY(trace_opt_lt) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_lt); -} - -/* insn trace_opt_le(...)(...)(...) */ -INSN_ENTRY(trace_opt_le) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_le); -} - -/* insn trace_opt_gt(...)(...)(...) */ -INSN_ENTRY(trace_opt_gt) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_gt); -} - -/* insn trace_opt_ge(...)(...)(...) */ -INSN_ENTRY(trace_opt_ge) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_ge); -} - -/* insn trace_opt_ltlt(...)(...)(...) */ -INSN_ENTRY(trace_opt_ltlt) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_ltlt); -} - -/* insn trace_opt_and(...)(...)(...) */ -INSN_ENTRY(trace_opt_and) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_and); -} - -/* insn trace_opt_or(...)(...)(...) */ -INSN_ENTRY(trace_opt_or) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_or); -} - -/* insn trace_opt_aref(...)(...)(...) */ -INSN_ENTRY(trace_opt_aref) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_aref); -} - -/* insn trace_opt_aset(...)(...)(...) */ -INSN_ENTRY(trace_opt_aset) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_aset); -} - -/* insn trace_opt_aset_with(...)(...)(...) */ -INSN_ENTRY(trace_opt_aset_with) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_aset_with); - END_INSN(trace_opt_aset_with); -} - -/* insn trace_opt_aref_with(...)(...)(...) */ -INSN_ENTRY(trace_opt_aref_with) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_aref_with); - END_INSN(trace_opt_aref_with); -} - -/* insn trace_opt_length(...)(...)(...) */ -INSN_ENTRY(trace_opt_length) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_length); -} - -/* insn trace_opt_size(...)(...)(...) */ -INSN_ENTRY(trace_opt_size) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_size); -} - -/* insn trace_opt_empty_p(...)(...)(...) */ -INSN_ENTRY(trace_opt_empty_p) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_empty_p); -} - -/* insn trace_opt_succ(...)(...)(...) */ -INSN_ENTRY(trace_opt_succ) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_succ); -} - -/* insn trace_opt_not(...)(...)(...) */ -INSN_ENTRY(trace_opt_not) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_not); -} - -/* insn trace_opt_regexpmatch2(...)(...)(...) */ -INSN_ENTRY(trace_opt_regexpmatch2) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_regexpmatch2); -} - -/* insn trace_invokebuiltin(...)(...)(...) */ -INSN_ENTRY(trace_invokebuiltin) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokebuiltin); - END_INSN(trace_invokebuiltin); -} - -/* insn trace_opt_invokebuiltin_delegate(...)(...)(...) */ -INSN_ENTRY(trace_opt_invokebuiltin_delegate) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_invokebuiltin_delegate); - END_INSN(trace_opt_invokebuiltin_delegate); -} - -/* insn trace_opt_invokebuiltin_delegate_leave(...)(...)(...) */ -INSN_ENTRY(trace_opt_invokebuiltin_delegate_leave) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_invokebuiltin_delegate_leave); - END_INSN(trace_opt_invokebuiltin_delegate_leave); -} - -/* insn trace_getlocal_WC_0(...)(...)(...) */ -INSN_ENTRY(trace_getlocal_WC_0) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getlocal_WC_0); - END_INSN(trace_getlocal_WC_0); -} - -/* insn trace_getlocal_WC_1(...)(...)(...) */ -INSN_ENTRY(trace_getlocal_WC_1) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getlocal_WC_1); - END_INSN(trace_getlocal_WC_1); -} - -/* insn trace_setlocal_WC_0(...)(...)(...) */ -INSN_ENTRY(trace_setlocal_WC_0) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setlocal_WC_0); - END_INSN(trace_setlocal_WC_0); -} - -/* insn trace_setlocal_WC_1(...)(...)(...) */ -INSN_ENTRY(trace_setlocal_WC_1) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setlocal_WC_1); - END_INSN(trace_setlocal_WC_1); -} - -/* insn trace_putobject_INT2FIX_0_(...)(...)(...) */ -INSN_ENTRY(trace_putobject_INT2FIX_0_) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putobject_INT2FIX_0_); - END_INSN(trace_putobject_INT2FIX_0_); -} - -/* insn trace_putobject_INT2FIX_1_(...)(...)(...) */ -INSN_ENTRY(trace_putobject_INT2FIX_1_) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putobject_INT2FIX_1_); - END_INSN(trace_putobject_INT2FIX_1_); -} diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc deleted file mode 100644 index c800942..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc +++ /dev/null @@ -1,244 +0,0 @@ -/* -*- c -*- */ -#if 1 /* enable or disable this optimization */ - -/* DO NOT EDIT THIS FILE DIRECTLY - * - * This file is generated by tool/generic_erb.rb - * with template/call_iseq_optimized.inc.tmpl - */ - -static VALUE -vm_call_iseq_setup_normal_0start_0params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 5); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 5); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 5); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 5); -} - -/* vm_call_iseq_handlers[param][local] */ -static const vm_call_handler vm_call_iseq_handlers[][6] = { - { - vm_call_iseq_setup_normal_0start_0params_0locals, - vm_call_iseq_setup_normal_0start_0params_1locals, - vm_call_iseq_setup_normal_0start_0params_2locals, - vm_call_iseq_setup_normal_0start_0params_3locals, - vm_call_iseq_setup_normal_0start_0params_4locals, - vm_call_iseq_setup_normal_0start_0params_5locals, - }, - { - vm_call_iseq_setup_normal_0start_1params_0locals, - vm_call_iseq_setup_normal_0start_1params_1locals, - vm_call_iseq_setup_normal_0start_1params_2locals, - vm_call_iseq_setup_normal_0start_1params_3locals, - vm_call_iseq_setup_normal_0start_1params_4locals, - vm_call_iseq_setup_normal_0start_1params_5locals, - }, - { - vm_call_iseq_setup_normal_0start_2params_0locals, - vm_call_iseq_setup_normal_0start_2params_1locals, - vm_call_iseq_setup_normal_0start_2params_2locals, - vm_call_iseq_setup_normal_0start_2params_3locals, - vm_call_iseq_setup_normal_0start_2params_4locals, - vm_call_iseq_setup_normal_0start_2params_5locals, - }, - { - vm_call_iseq_setup_normal_0start_3params_0locals, - vm_call_iseq_setup_normal_0start_3params_1locals, - vm_call_iseq_setup_normal_0start_3params_2locals, - vm_call_iseq_setup_normal_0start_3params_3locals, - vm_call_iseq_setup_normal_0start_3params_4locals, - vm_call_iseq_setup_normal_0start_3params_5locals, - }, -}; - -static inline vm_call_handler -vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size) -{ - if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) { - return &vm_call_iseq_setup_tailcall_0start; - } - else if (0) { /* to disable optimize */ - return &vm_call_iseq_setup_normal_0start; - } - else if (param_size <= 3 && local_size <= 5) { - VM_ASSERT(local_size >= 0); - return vm_call_iseq_handlers[param_size][local_size]; - } - else { - return &vm_call_iseq_setup_normal_0start; - } -} - -#else - -static inline vm_call_handler -vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size) -{ - if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) { - return &vm_call_iseq_setup_tailcall_0start; - } - else { - return &vm_call_iseq_setup_normal_0start; - } -} -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h deleted file mode 100644 index 71ab9fe..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h +++ /dev/null @@ -1,605 +0,0 @@ -#ifndef RUBY_VM_CALLINFO_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_VM_CALLINFO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ - -#include "debug_counter.h" -#include "internal/class.h" -#include "shape.h" - -enum vm_call_flag_bits { - VM_CALL_ARGS_SPLAT_bit, // m(*args) - VM_CALL_ARGS_BLOCKARG_bit, // m(&block) - VM_CALL_FCALL_bit, // m(args) # receiver is self - VM_CALL_VCALL_bit, // m # method call that looks like a local variable - VM_CALL_ARGS_SIMPLE_bit, // (ci->flag & (SPLAT|BLOCKARG)) && blockiseq == NULL && ci->kw_arg == NULL - VM_CALL_KWARG_bit, // has kwarg - VM_CALL_KW_SPLAT_bit, // m(**opts) - VM_CALL_TAILCALL_bit, // located at tail position - VM_CALL_SUPER_bit, // super - VM_CALL_ZSUPER_bit, // zsuper - VM_CALL_OPT_SEND_bit, // internal flag - VM_CALL_KW_SPLAT_MUT_bit, // kw splat hash can be modified (to avoid allocating a new one) - VM_CALL_ARGS_SPLAT_MUT_bit, // args splat can be modified (to avoid allocating a new one) - VM_CALL__END -}; - -#define VM_CALL_ARGS_SPLAT (0x01 << VM_CALL_ARGS_SPLAT_bit) -#define VM_CALL_ARGS_BLOCKARG (0x01 << VM_CALL_ARGS_BLOCKARG_bit) -#define VM_CALL_FCALL (0x01 << VM_CALL_FCALL_bit) -#define VM_CALL_VCALL (0x01 << VM_CALL_VCALL_bit) -#define VM_CALL_ARGS_SIMPLE (0x01 << VM_CALL_ARGS_SIMPLE_bit) -#define VM_CALL_KWARG (0x01 << VM_CALL_KWARG_bit) -#define VM_CALL_KW_SPLAT (0x01 << VM_CALL_KW_SPLAT_bit) -#define VM_CALL_TAILCALL (0x01 << VM_CALL_TAILCALL_bit) -#define VM_CALL_SUPER (0x01 << VM_CALL_SUPER_bit) -#define VM_CALL_ZSUPER (0x01 << VM_CALL_ZSUPER_bit) -#define VM_CALL_OPT_SEND (0x01 << VM_CALL_OPT_SEND_bit) -#define VM_CALL_KW_SPLAT_MUT (0x01 << VM_CALL_KW_SPLAT_MUT_bit) -#define VM_CALL_ARGS_SPLAT_MUT (0x01 << VM_CALL_ARGS_SPLAT_MUT_bit) - -struct rb_callinfo_kwarg { - int keyword_len; - int references; - VALUE keywords[]; -}; - -static inline size_t -rb_callinfo_kwarg_bytes(int keyword_len) -{ - return rb_size_mul_add_or_raise( - keyword_len, - sizeof(VALUE), - sizeof(struct rb_callinfo_kwarg), - rb_eRuntimeError); -} - -// imemo_callinfo -struct rb_callinfo { - VALUE flags; - const struct rb_callinfo_kwarg *kwarg; - VALUE mid; - VALUE flag; - VALUE argc; -}; - -#if !defined(USE_EMBED_CI) || (USE_EMBED_CI+0) -#undef USE_EMBED_CI -#define USE_EMBED_CI 1 -#else -#undef USE_EMBED_CI -#define USE_EMBED_CI 0 -#endif - -#if SIZEOF_VALUE == 8 -#define CI_EMBED_TAG_bits 1 -#define CI_EMBED_ARGC_bits 15 -#define CI_EMBED_FLAG_bits 16 -#define CI_EMBED_ID_bits 32 -#elif SIZEOF_VALUE == 4 -#define CI_EMBED_TAG_bits 1 -#define CI_EMBED_ARGC_bits 3 -#define CI_EMBED_FLAG_bits 13 -#define CI_EMBED_ID_bits 15 -#endif - -#if (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits + CI_EMBED_FLAG_bits + CI_EMBED_ID_bits) != (SIZEOF_VALUE * 8) -#error -#endif - -#define CI_EMBED_FLAG 0x01 -#define CI_EMBED_ARGC_SHFT (CI_EMBED_TAG_bits) -#define CI_EMBED_ARGC_MASK ((((VALUE)1)<> CI_EMBED_ID_SHFT) & CI_EMBED_ID_MASK; - } - else { - return (ID)ci->mid; - } -} - -static inline unsigned int -vm_ci_flag(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - return (unsigned int)((((VALUE)ci) >> CI_EMBED_FLAG_SHFT) & CI_EMBED_FLAG_MASK); - } - else { - return (unsigned int)ci->flag; - } -} - -static inline unsigned int -vm_ci_argc(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - return (unsigned int)((((VALUE)ci) >> CI_EMBED_ARGC_SHFT) & CI_EMBED_ARGC_MASK); - } - else { - return (unsigned int)ci->argc; - } -} - -static inline const struct rb_callinfo_kwarg * -vm_ci_kwarg(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - return NULL; - } - else { - return ci->kwarg; - } -} - -static inline void -vm_ci_dump(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - ruby_debug_printf("packed_ci ID:%s flag:%x argc:%u\n", - rb_id2name(vm_ci_mid(ci)), vm_ci_flag(ci), vm_ci_argc(ci)); - } - else { - rp(ci); - } -} - -#define vm_ci_new(mid, flag, argc, kwarg) vm_ci_new_(mid, flag, argc, kwarg, __FILE__, __LINE__) -#define vm_ci_new_runtime(mid, flag, argc, kwarg) vm_ci_new_runtime_(mid, flag, argc, kwarg, __FILE__, __LINE__) - -/* This is passed to STATIC_ASSERT. Cannot be an inline function. */ -#define VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg) \ - (((mid ) & ~CI_EMBED_ID_MASK) ? false : \ - ((flag) & ~CI_EMBED_FLAG_MASK) ? false : \ - ((argc) & ~CI_EMBED_ARGC_MASK) ? false : \ - (kwarg) ? false : true) - -#define vm_ci_new_id(mid, flag, argc, must_zero) \ - ((const struct rb_callinfo *) \ - ((((VALUE)(mid )) << CI_EMBED_ID_SHFT) | \ - (((VALUE)(flag)) << CI_EMBED_FLAG_SHFT) | \ - (((VALUE)(argc)) << CI_EMBED_ARGC_SHFT) | \ - RUBY_FIXNUM_FLAG)) - -// vm_method.c -const struct rb_callinfo *rb_vm_ci_lookup(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg); -void rb_vm_ci_free(const struct rb_callinfo *); - -static inline const struct rb_callinfo * -vm_ci_new_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line) -{ - if (USE_EMBED_CI && VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) { - RB_DEBUG_COUNTER_INC(ci_packed); - return vm_ci_new_id(mid, flag, argc, kwarg); - } - - const bool debug = 0; - if (debug) ruby_debug_printf("%s:%d ", file, line); - - const struct rb_callinfo *ci = rb_vm_ci_lookup(mid, flag, argc, kwarg); - - if (debug) rp(ci); - if (kwarg) { - RB_DEBUG_COUNTER_INC(ci_kw); - } - else { - RB_DEBUG_COUNTER_INC(ci_nokw); - } - - VM_ASSERT(vm_ci_flag(ci) == flag); - VM_ASSERT(vm_ci_argc(ci) == argc); - - return ci; -} - - -static inline const struct rb_callinfo * -vm_ci_new_runtime_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(ci_runtime); - return vm_ci_new_(mid, flag, argc, kwarg, file, line); -} - -#define VM_CALLINFO_NOT_UNDER_GC IMEMO_FL_USER0 - -#define VM_CI_ON_STACK(mid_, flags_, argc_, kwarg_) \ - (struct rb_callinfo) { \ - .flags = T_IMEMO | \ - (imemo_callinfo << FL_USHIFT) | \ - VM_CALLINFO_NOT_UNDER_GC, \ - .mid = mid_, \ - .flag = flags_, \ - .argc = argc_, \ - .kwarg = kwarg_, \ - } - -typedef VALUE (*vm_call_handler)( - struct rb_execution_context_struct *ec, - struct rb_control_frame_struct *cfp, - struct rb_calling_info *calling); - -// imemo_callcache - -struct rb_callcache { - const VALUE flags; - - /* inline cache: key */ - const VALUE klass; // should not mark it because klass can not be free'd - // because of this marking. When klass is collected, - // cc will be cleared (cc->klass = 0) at vm_ccs_free(). - - /* inline cache: values */ - const struct rb_callable_method_entry_struct * const cme_; - const vm_call_handler call_; - - union { - struct { - uintptr_t value; // Shape ID in upper bits, index in lower bits - } attr; - const enum method_missing_reason method_missing_reason; /* used by method_missing */ - VALUE v; - const struct rb_builtin_function *bf; - } aux_; -}; - -#define VM_CALLCACHE_UNMARKABLE FL_FREEZE -#define VM_CALLCACHE_ON_STACK FL_EXIVAR - -/* VM_CALLCACHE_IVAR used for IVAR/ATTRSET/STRUCT_AREF/STRUCT_ASET methods */ -#define VM_CALLCACHE_IVAR IMEMO_FL_USER0 -#define VM_CALLCACHE_BF IMEMO_FL_USER1 -#define VM_CALLCACHE_SUPER IMEMO_FL_USER2 -#define VM_CALLCACHE_REFINEMENT IMEMO_FL_USER3 - -enum vm_cc_type { - cc_type_normal, // chained from ccs - cc_type_super, - cc_type_refinement, -}; - -extern const struct rb_callcache *rb_vm_empty_cc(void); -extern const struct rb_callcache *rb_vm_empty_cc_for_super(void); - -#define vm_cc_empty() rb_vm_empty_cc() - -static inline void vm_cc_attr_index_set(const struct rb_callcache *cc, attr_index_t index, shape_id_t dest_shape_id); - -static inline void -vm_cc_attr_index_initialize(const struct rb_callcache *cc, shape_id_t shape_id) -{ - vm_cc_attr_index_set(cc, (attr_index_t)-1, shape_id); -} - -static inline const struct rb_callcache * -vm_cc_new(VALUE klass, - const struct rb_callable_method_entry_struct *cme, - vm_call_handler call, - enum vm_cc_type type) -{ - struct rb_callcache *cc = IMEMO_NEW(struct rb_callcache, imemo_callcache, klass); - *((struct rb_callable_method_entry_struct **)&cc->cme_) = (struct rb_callable_method_entry_struct *)cme; - *((vm_call_handler *)&cc->call_) = call; - - switch (type) { - case cc_type_normal: - break; - case cc_type_super: - *(VALUE *)&cc->flags |= VM_CALLCACHE_SUPER; - break; - case cc_type_refinement: - *(VALUE *)&cc->flags |= VM_CALLCACHE_REFINEMENT; - break; - } - - vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID); - RB_DEBUG_COUNTER_INC(cc_new); - return cc; -} - -static inline bool -vm_cc_super_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_SUPER) != 0; -} - -static inline bool -vm_cc_refinement_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_REFINEMENT) != 0; -} - -#define VM_CC_ON_STACK(clazz, call, aux, cme) \ - (struct rb_callcache) { \ - .flags = T_IMEMO | \ - (imemo_callcache << FL_USHIFT) | \ - VM_CALLCACHE_UNMARKABLE | \ - VM_CALLCACHE_ON_STACK, \ - .klass = clazz, \ - .cme_ = cme, \ - .call_ = call, \ - .aux_ = aux, \ - } - -static inline bool -vm_cc_class_check(const struct rb_callcache *cc, VALUE klass) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc->klass == 0 || - RB_TYPE_P(cc->klass, T_CLASS) || RB_TYPE_P(cc->klass, T_ICLASS)); - return cc->klass == klass; -} - -static inline int -vm_cc_markable(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return FL_TEST_RAW((VALUE)cc, VM_CALLCACHE_UNMARKABLE) == 0; -} - -static inline const struct rb_callable_method_entry_struct * -vm_cc_cme(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc->call_ == NULL || // not initialized yet - !vm_cc_markable(cc) || - cc->cme_ != NULL); - - return cc->cme_; -} - -static inline vm_call_handler -vm_cc_call(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc->call_ != NULL); - return cc->call_; -} - -static inline attr_index_t -vm_cc_attr_index(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return (attr_index_t)((cc->aux_.attr.value & SHAPE_FLAG_MASK) - 1); -} - -static inline shape_id_t -vm_cc_attr_index_dest_shape_id(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - - return cc->aux_.attr.value >> SHAPE_FLAG_SHIFT; -} - -static inline void -vm_cc_atomic_shape_and_index(const struct rb_callcache *cc, shape_id_t * shape_id, attr_index_t * index) -{ - uintptr_t cache_value = cc->aux_.attr.value; // Atomically read 64 bits - *shape_id = (shape_id_t)(cache_value >> SHAPE_FLAG_SHIFT); - *index = (attr_index_t)(cache_value & SHAPE_FLAG_MASK) - 1; - return; -} - -static inline void -vm_ic_atomic_shape_and_index(const struct iseq_inline_iv_cache_entry *ic, shape_id_t * shape_id, attr_index_t * index) -{ - uintptr_t cache_value = ic->value; // Atomically read 64 bits - *shape_id = (shape_id_t)(cache_value >> SHAPE_FLAG_SHIFT); - *index = (attr_index_t)(cache_value & SHAPE_FLAG_MASK) - 1; - return; -} - -static inline shape_id_t -vm_ic_attr_index_dest_shape_id(const struct iseq_inline_iv_cache_entry *ic) -{ - return (shape_id_t)(ic->value >> SHAPE_FLAG_SHIFT); -} - -static inline unsigned int -vm_cc_cmethod_missing_reason(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return cc->aux_.method_missing_reason; -} - -static inline bool -vm_cc_invalidated_p(const struct rb_callcache *cc) -{ - if (cc->klass && !METHOD_ENTRY_INVALIDATED(vm_cc_cme(cc))) { - return false; - } - else { - return true; - } -} - -// For RJIT. cc_cme is supposed to have inlined `vm_cc_cme(cc)`. -static inline bool -vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *cc_cme, VALUE klass) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - if (cc->klass == klass && !METHOD_ENTRY_INVALIDATED(cc_cme)) { - return 1; - } - else { - return 0; - } -} - -/* callcache: mutate */ - -static inline void -vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *(vm_call_handler *)&cc->call_ = call; -} - -static inline void -set_vm_cc_ivar(const struct rb_callcache *cc) -{ - *(VALUE *)&cc->flags |= VM_CALLCACHE_IVAR; -} - -static inline void -vm_cc_attr_index_set(const struct rb_callcache *cc, attr_index_t index, shape_id_t dest_shape_id) -{ - uintptr_t *attr_value = (uintptr_t *)&cc->aux_.attr.value; - if (!vm_cc_markable(cc)) { - *attr_value = (uintptr_t)INVALID_SHAPE_ID << SHAPE_FLAG_SHIFT; - return; - } - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *attr_value = (attr_index_t)(index + 1) | ((uintptr_t)(dest_shape_id) << SHAPE_FLAG_SHIFT); - set_vm_cc_ivar(cc); -} - -static inline bool -vm_cc_ivar_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_IVAR) != 0; -} - -static inline void -vm_ic_attr_index_set(const rb_iseq_t *iseq, const struct iseq_inline_iv_cache_entry *ic, attr_index_t index, shape_id_t dest_shape_id) -{ - *(uintptr_t *)&ic->value = ((uintptr_t)dest_shape_id << SHAPE_FLAG_SHIFT) | (attr_index_t)(index + 1); -} - -static inline void -vm_ic_attr_index_initialize(const struct iseq_inline_iv_cache_entry *ic, shape_id_t shape_id) -{ - *(uintptr_t *)&ic->value = (uintptr_t)shape_id << SHAPE_FLAG_SHIFT; -} - -static inline void -vm_cc_method_missing_reason_set(const struct rb_callcache *cc, enum method_missing_reason reason) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *(enum method_missing_reason *)&cc->aux_.method_missing_reason = reason; -} - -static inline void -vm_cc_bf_set(const struct rb_callcache *cc, const struct rb_builtin_function *bf) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *(const struct rb_builtin_function **)&cc->aux_.bf = bf; - *(VALUE *)&cc->flags |= VM_CALLCACHE_BF; -} - -static inline bool -vm_cc_bf_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_BF) != 0; -} - -static inline void -vm_cc_invalidate(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - VM_ASSERT(cc->klass != 0); // should be enable - - *(VALUE *)&cc->klass = 0; - RB_DEBUG_COUNTER_INC(cc_ent_invalidate); -} - -/* calldata */ - -struct rb_call_data { - const struct rb_callinfo *ci; - const struct rb_callcache *cc; -}; - -struct rb_class_cc_entries { -#if VM_CHECK_MODE > 0 - VALUE debug_sig; -#endif - int capa; - int len; - const struct rb_callable_method_entry_struct *cme; - struct rb_class_cc_entries_entry { - unsigned int argc; - unsigned int flag; - const struct rb_callcache *cc; - } *entries; -}; - -#if VM_CHECK_MODE > 0 - -const rb_callable_method_entry_t *rb_vm_lookup_overloaded_cme(const rb_callable_method_entry_t *cme); -void rb_vm_dump_overloaded_cme_table(void); - -static inline bool -vm_ccs_p(const struct rb_class_cc_entries *ccs) -{ - return ccs->debug_sig == ~(VALUE)ccs; -} - -static inline bool -vm_cc_check_cme(const struct rb_callcache *cc, const rb_callable_method_entry_t *cme) -{ - if (vm_cc_cme(cc) == cme || - (cme->def->iseq_overload && vm_cc_cme(cc) == rb_vm_lookup_overloaded_cme(cme))) { - return true; - } - else { -#if 1 - // debug print - - fprintf(stderr, "iseq_overload:%d\n", (int)cme->def->iseq_overload); - rp(cme); - rp(vm_cc_cme(cc)); - rb_vm_lookup_overloaded_cme(cme); -#endif - return false; - } -} - -#endif - -// gc.c -void rb_vm_ccs_free(struct rb_class_cc_entries *ccs); - -#endif /* RUBY_VM_CALLINFO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h deleted file mode 100644 index 30e06c4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h +++ /dev/null @@ -1,2236 +0,0 @@ -#ifndef RUBY_VM_CORE_H -#define RUBY_VM_CORE_H -/********************************************************************** - - vm_core.h - - - $Author$ - created at: 04/01/01 19:41:38 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -/* - * Enable check mode. - * 1: enable local assertions. - */ -#ifndef VM_CHECK_MODE - -// respect RUBY_DUBUG: if given n is 0, then use RUBY_DEBUG -#define N_OR_RUBY_DEBUG(n) (((n) > 0) ? (n) : RUBY_DEBUG) - -#define VM_CHECK_MODE N_OR_RUBY_DEBUG(0) -#endif - -/** - * VM Debug Level - * - * debug level: - * 0: no debug output - * 1: show instruction name - * 2: show stack frame when control stack frame is changed - * 3: show stack status - * 4: show register - * 5: - * 10: gc check - */ - -#ifndef VMDEBUG -#define VMDEBUG 0 -#endif - -#if 0 -#undef VMDEBUG -#define VMDEBUG 3 -#endif - -#include "ruby/internal/config.h" - -#include -#include -#include - -#include "ruby_assert.h" - -#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX])) - -#if VM_CHECK_MODE > 0 -#define VM_ASSERT(/*expr, */...) RUBY_ASSERT_WHEN(VM_CHECK_MODE > 0, __VA_ARGS__) -#define VM_UNREACHABLE(func) rb_bug(#func ": unreachable") -#define RUBY_ASSERT_CRITICAL_SECTION -#define RUBY_DEBUG_THREAD_SCHEDULE() rb_thread_schedule() -#else -#define VM_ASSERT(/*expr, */...) ((void)0) -#define VM_UNREACHABLE(func) UNREACHABLE -#define RUBY_DEBUG_THREAD_SCHEDULE() -#endif - -#define RUBY_ASSERT_MUTEX_OWNED(mutex) VM_ASSERT(rb_mutex_owned_p(mutex)) - -#if defined(RUBY_ASSERT_CRITICAL_SECTION) -// TODO add documentation -extern int ruby_assert_critical_section_entered; -#define RUBY_ASSERT_CRITICAL_SECTION_ENTER() do{ruby_assert_critical_section_entered += 1;}while(false) -#define RUBY_ASSERT_CRITICAL_SECTION_LEAVE() do{VM_ASSERT(ruby_assert_critical_section_entered > 0);ruby_assert_critical_section_entered -= 1;}while(false) -#else -#define RUBY_ASSERT_CRITICAL_SECTION_ENTER() -#define RUBY_ASSERT_CRITICAL_SECTION_LEAVE() -#endif - -#if defined(__wasm__) && !defined(__EMSCRIPTEN__) -# include "wasm/setjmp.h" -#else -# include -#endif - -#if defined(__linux__) || defined(__FreeBSD__) -# define RB_THREAD_T_HAS_NATIVE_ID -#endif - -#include "ruby/internal/stdbool.h" -#include "ccan/list/list.h" -#include "id.h" -#include "internal.h" -#include "internal/array.h" -#include "internal/basic_operators.h" -#include "internal/sanitizers.h" -#include "internal/serial.h" -#include "internal/vm.h" -#include "method.h" -#include "node.h" -#include "ruby/ruby.h" -#include "ruby/st.h" -#include "ruby_atomic.h" -#include "vm_opts.h" - -#include "ruby/thread_native.h" - -#if USE_SHARED_GC -typedef struct gc_function_map { - void *(*objspace_alloc)(void); -} rb_gc_function_map_t; - -#define rb_gc_functions (&GET_VM()->gc_functions_map) -#endif - -/* - * implementation selector of get_insn_info algorithm - * 0: linear search - * 1: binary search - * 2: succinct bitvector - */ -#ifndef VM_INSN_INFO_TABLE_IMPL -# define VM_INSN_INFO_TABLE_IMPL 2 -#endif - -#if defined(NSIG_MAX) /* POSIX issue 8 */ -# undef NSIG -# define NSIG NSIG_MAX -#elif defined(_SIG_MAXSIG) /* FreeBSD */ -# undef NSIG -# define NSIG _SIG_MAXSIG -#elif defined(_SIGMAX) /* QNX */ -# define NSIG (_SIGMAX + 1) -#elif defined(NSIG) /* 99% of everything else */ -# /* take it */ -#else /* Last resort */ -# define NSIG (sizeof(sigset_t) * CHAR_BIT + 1) -#endif - -#define RUBY_NSIG NSIG - -#if defined(SIGCLD) -# define RUBY_SIGCHLD (SIGCLD) -#elif defined(SIGCHLD) -# define RUBY_SIGCHLD (SIGCHLD) -#endif - -#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__) -# define USE_SIGALTSTACK -void *rb_allocate_sigaltstack(void); -void *rb_register_sigaltstack(void *); -# define RB_ALTSTACK_INIT(var, altstack) var = rb_register_sigaltstack(altstack) -# define RB_ALTSTACK_FREE(var) free(var) -# define RB_ALTSTACK(var) var -#else /* noop */ -# define RB_ALTSTACK_INIT(var, altstack) -# define RB_ALTSTACK_FREE(var) -# define RB_ALTSTACK(var) (0) -#endif - -#include THREAD_IMPL_H -#define RUBY_VM_THREAD_MODEL 2 - -/*****************/ -/* configuration */ -/*****************/ - -/* gcc ver. check */ -#if defined(__GNUC__) && __GNUC__ >= 2 - -#if OPT_TOKEN_THREADED_CODE -#if OPT_DIRECT_THREADED_CODE -#undef OPT_DIRECT_THREADED_CODE -#endif -#endif - -#else /* defined(__GNUC__) && __GNUC__ >= 2 */ - -/* disable threaded code options */ -#if OPT_DIRECT_THREADED_CODE -#undef OPT_DIRECT_THREADED_CODE -#endif -#if OPT_TOKEN_THREADED_CODE -#undef OPT_TOKEN_THREADED_CODE -#endif -#endif - -/* call threaded code */ -#if OPT_CALL_THREADED_CODE -#if OPT_DIRECT_THREADED_CODE -#undef OPT_DIRECT_THREADED_CODE -#endif /* OPT_DIRECT_THREADED_CODE */ -#endif /* OPT_CALL_THREADED_CODE */ - -void rb_vm_encoded_insn_data_table_init(void); -typedef unsigned long rb_num_t; -typedef signed long rb_snum_t; - -enum ruby_tag_type { - RUBY_TAG_NONE = 0x0, - RUBY_TAG_RETURN = 0x1, - RUBY_TAG_BREAK = 0x2, - RUBY_TAG_NEXT = 0x3, - RUBY_TAG_RETRY = 0x4, - RUBY_TAG_REDO = 0x5, - RUBY_TAG_RAISE = 0x6, - RUBY_TAG_THROW = 0x7, - RUBY_TAG_FATAL = 0x8, - RUBY_TAG_MASK = 0xf -}; - -#define TAG_NONE RUBY_TAG_NONE -#define TAG_RETURN RUBY_TAG_RETURN -#define TAG_BREAK RUBY_TAG_BREAK -#define TAG_NEXT RUBY_TAG_NEXT -#define TAG_RETRY RUBY_TAG_RETRY -#define TAG_REDO RUBY_TAG_REDO -#define TAG_RAISE RUBY_TAG_RAISE -#define TAG_THROW RUBY_TAG_THROW -#define TAG_FATAL RUBY_TAG_FATAL -#define TAG_MASK RUBY_TAG_MASK - -enum ruby_vm_throw_flags { - VM_THROW_NO_ESCAPE_FLAG = 0x8000, - VM_THROW_STATE_MASK = 0xff -}; - -/* forward declarations */ -struct rb_thread_struct; -struct rb_control_frame_struct; - -/* iseq data type */ -typedef struct rb_compile_option_struct rb_compile_option_t; - -union ic_serial_entry { - rb_serial_t raw; - VALUE data[2]; -}; - -// imemo_constcache -struct iseq_inline_constant_cache_entry { - VALUE flags; - - VALUE value; // v0 - VALUE _unused1; // v1 - VALUE _unused2; // v2 - const rb_cref_t *ic_cref; // v3 -}; -STATIC_ASSERT(sizeof_iseq_inline_constant_cache_entry, - (offsetof(struct iseq_inline_constant_cache_entry, ic_cref) + - sizeof(const rb_cref_t *)) <= RVALUE_SIZE); - -struct iseq_inline_constant_cache { - struct iseq_inline_constant_cache_entry *entry; - - /** - * A null-terminated list of ids, used to represent a constant's path - * idNULL is used to represent the :: prefix, and 0 is used to donate the end - * of the list. - * - * For example - * FOO {rb_intern("FOO"), 0} - * FOO::BAR {rb_intern("FOO"), rb_intern("BAR"), 0} - * ::FOO {idNULL, rb_intern("FOO"), 0} - * ::FOO::BAR {idNULL, rb_intern("FOO"), rb_intern("BAR"), 0} - */ - const ID *segments; -}; - -struct iseq_inline_iv_cache_entry { - uintptr_t value; // attr_index in lower bits, dest_shape_id in upper bits - ID iv_set_name; -}; - -struct iseq_inline_cvar_cache_entry { - struct rb_cvar_class_tbl_entry *entry; -}; - -union iseq_inline_storage_entry { - struct { - struct rb_thread_struct *running_thread; - VALUE value; - } once; - struct iseq_inline_constant_cache ic_cache; - struct iseq_inline_iv_cache_entry iv_cache; -}; - -struct rb_calling_info { - const struct rb_call_data *cd; - const struct rb_callcache *cc; - VALUE block_handler; - VALUE recv; - int argc; - bool kw_splat; - VALUE heap_argv; -}; - -#ifndef VM_ARGC_STACK_MAX -#define VM_ARGC_STACK_MAX 128 -#endif - -# define CALLING_ARGC(calling) ((calling)->heap_argv ? RARRAY_LENINT((calling)->heap_argv) : (calling)->argc) - -struct rb_execution_context_struct; - -#if 1 -#define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj) -#else -#define CoreDataFromValue(obj, type) (type*)rb_data_object_get(obj) -#endif -#define GetCoreDataFromValue(obj, type, ptr) ((ptr) = CoreDataFromValue((obj), type)) - -typedef struct rb_iseq_location_struct { - VALUE pathobj; /* String (path) or Array [path, realpath]. Frozen. */ - VALUE base_label; /* String */ - VALUE label; /* String */ - int first_lineno; - int node_id; - rb_code_location_t code_location; -} rb_iseq_location_t; - -#define PATHOBJ_PATH 0 -#define PATHOBJ_REALPATH 1 - -static inline VALUE -pathobj_path(VALUE pathobj) -{ - if (RB_TYPE_P(pathobj, T_STRING)) { - return pathobj; - } - else { - VM_ASSERT(RB_TYPE_P(pathobj, T_ARRAY)); - return RARRAY_AREF(pathobj, PATHOBJ_PATH); - } -} - -static inline VALUE -pathobj_realpath(VALUE pathobj) -{ - if (RB_TYPE_P(pathobj, T_STRING)) { - return pathobj; - } - else { - VM_ASSERT(RB_TYPE_P(pathobj, T_ARRAY)); - return RARRAY_AREF(pathobj, PATHOBJ_REALPATH); - } -} - -/* Forward declarations */ -struct rb_rjit_unit; - -typedef uintptr_t iseq_bits_t; - -#define ISEQ_IS_SIZE(body) (body->ic_size + body->ivc_size + body->ise_size + body->icvarc_size) - -/* [ TS_IVC | TS_ICVARC | TS_ISE | TS_IC ] */ -#define ISEQ_IS_IC_ENTRY(body, idx) (body->is_entries[(idx) + body->ise_size + body->icvarc_size + body->ivc_size].ic_cache); - -/* instruction sequence type */ -enum rb_iseq_type { - ISEQ_TYPE_TOP, - ISEQ_TYPE_METHOD, - ISEQ_TYPE_BLOCK, - ISEQ_TYPE_CLASS, - ISEQ_TYPE_RESCUE, - ISEQ_TYPE_ENSURE, - ISEQ_TYPE_EVAL, - ISEQ_TYPE_MAIN, - ISEQ_TYPE_PLAIN -}; - -// Attributes specified by Primitive.attr! -enum rb_builtin_attr { - // The iseq does not call methods. - BUILTIN_ATTR_LEAF = 0x01, - // This iseq only contains single `opt_invokebuiltin_delegate_leave` instruction with 0 arguments. - BUILTIN_ATTR_SINGLE_NOARG_LEAF = 0x02, - // This attribute signals JIT to duplicate the iseq for each block iseq so that its `yield` will be monomorphic. - BUILTIN_ATTR_INLINE_BLOCK = 0x04, -}; - -typedef VALUE (*rb_jit_func_t)(struct rb_execution_context_struct *, struct rb_control_frame_struct *); - -struct rb_iseq_constant_body { - enum rb_iseq_type type; - - unsigned int iseq_size; - VALUE *iseq_encoded; /* encoded iseq (insn addr and operands) */ - - /** - * parameter information - * - * def m(a1, a2, ..., aM, # mandatory - * b1=(...), b2=(...), ..., bN=(...), # optional - * *c, # rest - * d1, d2, ..., dO, # post - * e1:(...), e2:(...), ..., eK:(...), # keyword - * **f, # keyword_rest - * &g) # block - * => - * - * lead_num = M - * opt_num = N - * rest_start = M+N - * post_start = M+N+(*1) - * post_num = O - * keyword_num = K - * block_start = M+N+(*1)+O+K - * keyword_bits = M+N+(*1)+O+K+(&1) - * size = M+N+O+(*1)+K+(&1)+(**1) // parameter size. - */ - - struct { - struct { - unsigned int has_lead : 1; - unsigned int has_opt : 1; - unsigned int has_rest : 1; - unsigned int has_post : 1; - unsigned int has_kw : 1; - unsigned int has_kwrest : 1; - unsigned int has_block : 1; - - unsigned int ambiguous_param0 : 1; /* {|a|} */ - unsigned int accepts_no_kwarg : 1; - unsigned int ruby2_keywords: 1; - unsigned int anon_rest: 1; - unsigned int anon_kwrest: 1; - unsigned int use_block: 1; - } flags; - - unsigned int size; - - int lead_num; - int opt_num; - int rest_start; - int post_start; - int post_num; - int block_start; - - const VALUE *opt_table; /* (opt_num + 1) entries. */ - /* opt_num and opt_table: - * - * def foo o1=e1, o2=e2, ..., oN=eN - * #=> - * # prologue code - * A1: e1 - * A2: e2 - * ... - * AN: eN - * AL: body - * opt_num = N - * opt_table = [A1, A2, ..., AN, AL] - */ - - const struct rb_iseq_param_keyword { - int num; - int required_num; - int bits_start; - int rest_start; - const ID *table; - VALUE *default_values; - } *keyword; - } param; - - rb_iseq_location_t location; - - /* insn info, must be freed */ - struct iseq_insn_info { - const struct iseq_insn_info_entry *body; - unsigned int *positions; - unsigned int size; -#if VM_INSN_INFO_TABLE_IMPL == 2 - struct succ_index_table *succ_index_table; -#endif - } insns_info; - - const ID *local_table; /* must free */ - - /* catch table */ - struct iseq_catch_table *catch_table; - - /* for child iseq */ - const struct rb_iseq_struct *parent_iseq; - struct rb_iseq_struct *local_iseq; /* local_iseq->flip_cnt can be modified */ - - union iseq_inline_storage_entry *is_entries; /* [ TS_IVC | TS_ICVARC | TS_ISE | TS_IC ] */ - struct rb_call_data *call_data; //struct rb_call_data calls[ci_size]; - - struct { - rb_snum_t flip_count; - VALUE script_lines; - VALUE coverage; - VALUE pc2branchindex; - VALUE *original_iseq; - } variable; - - unsigned int local_table_size; - unsigned int ic_size; // Number of IC caches - unsigned int ise_size; // Number of ISE caches - unsigned int ivc_size; // Number of IVC caches - unsigned int icvarc_size; // Number of ICVARC caches - unsigned int ci_size; - unsigned int stack_max; /* for stack overflow check */ - - unsigned int builtin_attrs; // Union of rb_builtin_attr - - bool prism; // ISEQ was generated from prism compiler - - union { - iseq_bits_t * list; /* Find references for GC */ - iseq_bits_t single; - } mark_bits; - - struct rb_id_table *outer_variables; - - const rb_iseq_t *mandatory_only_iseq; - -#if USE_RJIT || USE_YJIT - // Function pointer for JIT code on jit_exec() - rb_jit_func_t jit_entry; - // Number of calls on jit_exec() - long unsigned jit_entry_calls; -#endif - -#if USE_YJIT - // Function pointer for JIT code on jit_exec_exception() - rb_jit_func_t jit_exception; - // Number of calls on jit_exec_exception() - long unsigned jit_exception_calls; -#endif - -#if USE_RJIT - // RJIT stores some data on each iseq. - VALUE rjit_blocks; -#endif - -#if USE_YJIT - // YJIT stores some data on each iseq. - void *yjit_payload; - // Used to estimate how frequently this ISEQ gets called - uint64_t yjit_calls_at_interv; -#endif -}; - -/* T_IMEMO/iseq */ -/* typedef rb_iseq_t is in method.h */ -struct rb_iseq_struct { - VALUE flags; /* 1 */ - VALUE wrapper; /* 2 */ - - struct rb_iseq_constant_body *body; /* 3 */ - - union { /* 4, 5 words */ - struct iseq_compile_data *compile_data; /* used at compile time */ - - struct { - VALUE obj; - int index; - } loader; - - struct { - struct rb_hook_list_struct *local_hooks; - rb_event_flag_t global_trace_events; - } exec; - } aux; -}; - -#define ISEQ_BODY(iseq) ((iseq)->body) - -#if !defined(USE_LAZY_LOAD) || !(USE_LAZY_LOAD+0) -#define USE_LAZY_LOAD 0 -#endif - -#if !USE_LAZY_LOAD -static inline const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq) {return 0;} -#endif -const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq); - -static inline const rb_iseq_t * -rb_iseq_check(const rb_iseq_t *iseq) -{ - if (USE_LAZY_LOAD && ISEQ_BODY(iseq) == NULL) { - rb_iseq_complete((rb_iseq_t *)iseq); - } - return iseq; -} - -static inline const rb_iseq_t * -def_iseq_ptr(rb_method_definition_t *def) -{ -//TODO: re-visit. to check the bug, enable this assertion. -#if VM_CHECK_MODE > 0 - if (def->type != VM_METHOD_TYPE_ISEQ) rb_bug("def_iseq_ptr: not iseq (%d)", def->type); -#endif - return rb_iseq_check(def->body.iseq.iseqptr); -} - -enum ruby_special_exceptions { - ruby_error_reenter, - ruby_error_nomemory, - ruby_error_sysstack, - ruby_error_stackfatal, - ruby_error_stream_closed, - ruby_special_error_count -}; - -#define GetVMPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_vm_t, (ptr)) - -struct rb_vm_struct; -typedef void rb_vm_at_exit_func(struct rb_vm_struct*); - -typedef struct rb_at_exit_list { - rb_vm_at_exit_func *func; - struct rb_at_exit_list *next; -} rb_at_exit_list; - -struct rb_objspace; -struct rb_objspace *rb_objspace_alloc(void); -void rb_objspace_free(struct rb_objspace *); -void rb_objspace_call_finalizer(struct rb_objspace *); - -typedef struct rb_hook_list_struct { - struct rb_event_hook_struct *hooks; - rb_event_flag_t events; - unsigned int running; - bool need_clean; - bool is_local; -} rb_hook_list_t; - - -// see builtin.h for definition -typedef const struct rb_builtin_function *RB_BUILTIN; - -struct global_object_list { - VALUE *varptr; - struct global_object_list *next; -}; - -typedef struct rb_vm_struct { - VALUE self; - - struct { - struct ccan_list_head set; - unsigned int cnt; - unsigned int blocking_cnt; - - struct rb_ractor_struct *main_ractor; - struct rb_thread_struct *main_thread; // == vm->ractor.main_ractor->threads.main - - struct { - // monitor - rb_nativethread_lock_t lock; - struct rb_ractor_struct *lock_owner; - unsigned int lock_rec; - - // join at exit - rb_nativethread_cond_t terminate_cond; - bool terminate_waiting; - -#ifndef RUBY_THREAD_PTHREAD_H - bool barrier_waiting; - unsigned int barrier_cnt; - rb_nativethread_cond_t barrier_cond; -#endif - } sync; - - // ractor scheduling - struct { - rb_nativethread_lock_t lock; - struct rb_ractor_struct *lock_owner; - bool locked; - - rb_nativethread_cond_t cond; // GRQ - unsigned int snt_cnt; // count of shared NTs - unsigned int dnt_cnt; // count of dedicated NTs - - unsigned int running_cnt; - - unsigned int max_cpu; - struct ccan_list_head grq; // // Global Ready Queue - unsigned int grq_cnt; - - // running threads - struct ccan_list_head running_threads; - - // threads which switch context by timeslice - struct ccan_list_head timeslice_threads; - - struct ccan_list_head zombie_threads; - - // true if timeslice timer is not enable - bool timeslice_wait_inf; - - // barrier - rb_nativethread_cond_t barrier_complete_cond; - rb_nativethread_cond_t barrier_release_cond; - bool barrier_waiting; - unsigned int barrier_waiting_cnt; - unsigned int barrier_serial; - } sched; - } ractor; - -#ifdef USE_SIGALTSTACK - void *main_altstack; -#endif - - rb_serial_t fork_gen; - struct ccan_list_head waiting_fds; /* <=> struct waiting_fd */ - - /* set in single-threaded processes only: */ - volatile int ubf_async_safe; - - unsigned int running: 1; - unsigned int thread_abort_on_exception: 1; - unsigned int thread_report_on_exception: 1; - unsigned int thread_ignore_deadlock: 1; - - /* object management */ - VALUE mark_object_ary; - struct global_object_list *global_object_list; - const VALUE special_exceptions[ruby_special_error_count]; - - /* load */ - VALUE top_self; - VALUE load_path; - VALUE load_path_snapshot; - VALUE load_path_check_cache; - VALUE expanded_load_path; - VALUE loaded_features; - VALUE loaded_features_snapshot; - VALUE loaded_features_realpaths; - VALUE loaded_features_realpath_map; - struct st_table *loaded_features_index; - struct st_table *loading_table; - // For running the init function of statically linked - // extensions when they are loaded - struct st_table *static_ext_inits; - - /* signal */ - struct { - VALUE cmd[RUBY_NSIG]; - } trap_list; - - /* relation table of ensure - rollback for callcc */ - struct st_table *ensure_rollback_table; - - /* postponed_job (async-signal-safe, and thread-safe) */ - struct rb_postponed_job_queue *postponed_job_queue; - - int src_encoding_index; - - /* workqueue (thread-safe, NOT async-signal-safe) */ - struct ccan_list_head workqueue; /* <=> rb_workqueue_job.jnode */ - rb_nativethread_lock_t workqueue_lock; - - VALUE orig_progname, progname; - VALUE coverages, me2counter; - int coverage_mode; - - struct rb_objspace *objspace; -#if USE_SHARED_GC - rb_gc_function_map_t gc_functions_map; -#endif - - rb_at_exit_list *at_exit; - - st_table *frozen_strings; - - const struct rb_builtin_function *builtin_function_table; - - st_table *ci_table; - struct rb_id_table *negative_cme_table; - st_table *overloaded_cme_table; // cme -> overloaded_cme - st_table *unused_block_warning_table; - bool unused_block_warning_strict; - - // This id table contains a mapping from ID to ICs. It does this with ID - // keys and nested st_tables as values. The nested tables have ICs as keys - // and Qtrue as values. It is used when inline constant caches need to be - // invalidated or ISEQs are being freed. - struct rb_id_table *constant_cache; - -#ifndef VM_GLOBAL_CC_CACHE_TABLE_SIZE -#define VM_GLOBAL_CC_CACHE_TABLE_SIZE 1023 -#endif - const struct rb_callcache *global_cc_cache_table[VM_GLOBAL_CC_CACHE_TABLE_SIZE]; // vm_eval.c - -#if defined(USE_VM_CLOCK) && USE_VM_CLOCK - uint32_t clock; -#endif - - /* params */ - struct { /* size in byte */ - size_t thread_vm_stack_size; - size_t thread_machine_stack_size; - size_t fiber_vm_stack_size; - size_t fiber_machine_stack_size; - } default_params; - -} rb_vm_t; - -/* default values */ - -#define RUBY_VM_SIZE_ALIGN 4096 - -#define RUBY_VM_THREAD_VM_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */ -#define RUBY_VM_THREAD_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */ -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */ -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ - -#define RUBY_VM_FIBER_VM_STACK_SIZE ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ -#define RUBY_VM_FIBER_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */ -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */ -#if defined(__powerpc64__) || defined(__ppc64__) // macOS has __ppc64__ -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 32 * 1024 * sizeof(VALUE)) /* 128 KB or 256 KB */ -#else -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ -#endif - -#if __has_feature(memory_sanitizer) || __has_feature(address_sanitizer) -/* It seems sanitizers consume A LOT of machine stacks */ -#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE (1024 * 1024 * sizeof(VALUE)) -#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 512 * 1024 * sizeof(VALUE)) -#undef RUBY_VM_FIBER_MACHINE_STACK_SIZE -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 256 * 1024 * sizeof(VALUE)) -#undef RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 128 * 1024 * sizeof(VALUE)) -#endif - -#ifndef VM_DEBUG_BP_CHECK -#define VM_DEBUG_BP_CHECK 0 -#endif - -#ifndef VM_DEBUG_VERIFY_METHOD_CACHE -#define VM_DEBUG_VERIFY_METHOD_CACHE (VMDEBUG != 0) -#endif - -struct rb_captured_block { - VALUE self; - const VALUE *ep; - union { - const rb_iseq_t *iseq; - const struct vm_ifunc *ifunc; - VALUE val; - } code; -}; - -enum rb_block_handler_type { - block_handler_type_iseq, - block_handler_type_ifunc, - block_handler_type_symbol, - block_handler_type_proc -}; - -enum rb_block_type { - block_type_iseq, - block_type_ifunc, - block_type_symbol, - block_type_proc -}; - -struct rb_block { - union { - struct rb_captured_block captured; - VALUE symbol; - VALUE proc; - } as; - enum rb_block_type type; -}; - -typedef struct rb_control_frame_struct { - const VALUE *pc; // cfp[0] - VALUE *sp; // cfp[1] - const rb_iseq_t *iseq; // cfp[2] - VALUE self; // cfp[3] / block[0] - const VALUE *ep; // cfp[4] / block[1] - const void *block_code; // cfp[5] / block[2] -- iseq, ifunc, or forwarded block handler - void *jit_return; // cfp[6] -- return address for JIT code -#if VM_DEBUG_BP_CHECK - VALUE *bp_check; // cfp[7] -#endif -} rb_control_frame_t; - -extern const rb_data_type_t ruby_threadptr_data_type; - -static inline struct rb_thread_struct * -rb_thread_ptr(VALUE thval) -{ - return (struct rb_thread_struct *)rb_check_typeddata(thval, &ruby_threadptr_data_type); -} - -enum rb_thread_status { - THREAD_RUNNABLE, - THREAD_STOPPED, - THREAD_STOPPED_FOREVER, - THREAD_KILLED -}; - -#ifdef RUBY_JMP_BUF -typedef RUBY_JMP_BUF rb_jmpbuf_t; -#else -typedef void *rb_jmpbuf_t[5]; -#endif - -/* - `rb_vm_tag_jmpbuf_t` type represents a buffer used to - long jump to a C frame associated with `rb_vm_tag`. - - Use-site of `rb_vm_tag_jmpbuf_t` is responsible for calling the - following functions: - - `rb_vm_tag_jmpbuf_init` once `rb_vm_tag_jmpbuf_t` is allocated. - - `rb_vm_tag_jmpbuf_deinit` once `rb_vm_tag_jmpbuf_t` is no longer necessary. - - `RB_VM_TAG_JMPBUF_GET` transforms a `rb_vm_tag_jmpbuf_t` into a - `rb_jmpbuf_t` to be passed to `rb_setjmp/rb_longjmp`. -*/ -#if defined(__wasm__) && !defined(__EMSCRIPTEN__) -/* - WebAssembly target with Asyncify-based SJLJ needs - to capture the execution context by unwind/rewind-ing - call frames into a jump buffer. The buffer space tends - to be considerably large unlike other architectures' - register-based buffers. - Therefore, we allocates the buffer on the heap on such - environments. -*/ -typedef rb_jmpbuf_t *rb_vm_tag_jmpbuf_t; - -#define RB_VM_TAG_JMPBUF_GET(buf) (*buf) - -static inline void -rb_vm_tag_jmpbuf_init(rb_vm_tag_jmpbuf_t *jmpbuf) -{ - *jmpbuf = ruby_xmalloc(sizeof(rb_jmpbuf_t)); -} - -static inline void -rb_vm_tag_jmpbuf_deinit(const rb_vm_tag_jmpbuf_t *jmpbuf) -{ - ruby_xfree(*jmpbuf); -} -#else -typedef rb_jmpbuf_t rb_vm_tag_jmpbuf_t; - -#define RB_VM_TAG_JMPBUF_GET(buf) (buf) - -static inline void -rb_vm_tag_jmpbuf_init(rb_vm_tag_jmpbuf_t *jmpbuf) -{ - // no-op -} - -static inline void -rb_vm_tag_jmpbuf_deinit(const rb_vm_tag_jmpbuf_t *jmpbuf) -{ - // no-op -} -#endif - -/* - the members which are written in EC_PUSH_TAG() should be placed at - the beginning and the end, so that entire region is accessible. -*/ -struct rb_vm_tag { - VALUE tag; - VALUE retval; - rb_vm_tag_jmpbuf_t buf; - struct rb_vm_tag *prev; - enum ruby_tag_type state; - unsigned int lock_rec; -}; - -STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0); -STATIC_ASSERT(rb_vm_tag_buf_end, - offsetof(struct rb_vm_tag, buf) + sizeof(rb_vm_tag_jmpbuf_t) < - sizeof(struct rb_vm_tag)); - -struct rb_unblock_callback { - rb_unblock_function_t *func; - void *arg; -}; - -struct rb_mutex_struct; - -typedef struct rb_ensure_entry { - VALUE marker; - VALUE (*e_proc)(VALUE); - VALUE data2; -} rb_ensure_entry_t; - -typedef struct rb_ensure_list { - struct rb_ensure_list *next; - struct rb_ensure_entry entry; -} rb_ensure_list_t; - -typedef struct rb_fiber_struct rb_fiber_t; - -struct rb_waiting_list { - struct rb_waiting_list *next; - struct rb_thread_struct *thread; - struct rb_fiber_struct *fiber; -}; - -struct rb_execution_context_struct { - /* execution information */ - VALUE *vm_stack; /* must free, must mark */ - size_t vm_stack_size; /* size in word (byte size / sizeof(VALUE)) */ - rb_control_frame_t *cfp; - - struct rb_vm_tag *tag; - - /* interrupt flags */ - rb_atomic_t interrupt_flag; - rb_atomic_t interrupt_mask; /* size should match flag */ -#if defined(USE_VM_CLOCK) && USE_VM_CLOCK - uint32_t checked_clock; -#endif - - rb_fiber_t *fiber_ptr; - struct rb_thread_struct *thread_ptr; - - /* storage (ec (fiber) local) */ - struct rb_id_table *local_storage; - VALUE local_storage_recursive_hash; - VALUE local_storage_recursive_hash_for_trace; - - /* Inheritable fiber storage. */ - VALUE storage; - - /* eval env */ - const VALUE *root_lep; - VALUE root_svar; - - /* ensure & callcc */ - rb_ensure_list_t *ensure_list; - - /* trace information */ - struct rb_trace_arg_struct *trace_arg; - - /* temporary places */ - VALUE errinfo; - VALUE passed_block_handler; /* for rb_iterate */ - - uint8_t raised_flag; /* only 3 bits needed */ - - /* n.b. only 7 bits needed, really: */ - BITFIELD(enum method_missing_reason, method_missing_reason, 8); - - VALUE private_const_reference; - - /* for GC */ - struct { - VALUE *stack_start; - VALUE *stack_end; - size_t stack_maxsize; - RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs; - -#ifdef RUBY_ASAN_ENABLED - void *asan_fake_stack_handle; -#endif - } machine; -}; - -#ifndef rb_execution_context_t -typedef struct rb_execution_context_struct rb_execution_context_t; -#define rb_execution_context_t rb_execution_context_t -#endif - -// for builtin.h -#define VM_CORE_H_EC_DEFINED 1 - -// Set the vm_stack pointer in the execution context. -void rb_ec_set_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size); - -// Initialize the vm_stack pointer in the execution context and push the initial stack frame. -// @param ec the execution context to update. -// @param stack a pointer to the stack to use. -// @param size the size of the stack, as in `VALUE stack[size]`. -void rb_ec_initialize_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size); - -// Clear (set to `NULL`) the vm_stack pointer. -// @param ec the execution context to update. -void rb_ec_clear_vm_stack(rb_execution_context_t *ec); - -struct rb_ext_config { - bool ractor_safe; -}; - -typedef struct rb_ractor_struct rb_ractor_t; - -struct rb_native_thread; - -typedef struct rb_thread_struct { - struct ccan_list_node lt_node; // managed by a ractor - VALUE self; - rb_ractor_t *ractor; - rb_vm_t *vm; - struct rb_native_thread *nt; - rb_execution_context_t *ec; - - struct rb_thread_sched_item sched; - bool mn_schedulable; - rb_atomic_t serial; // only for RUBY_DEBUG_LOG() - - VALUE last_status; /* $? */ - - /* for cfunc */ - struct rb_calling_info *calling; - - /* for load(true) */ - VALUE top_self; - VALUE top_wrapper; - - /* thread control */ - - BITFIELD(enum rb_thread_status, status, 2); - /* bit flags */ - unsigned int has_dedicated_nt : 1; - unsigned int to_kill : 1; - unsigned int abort_on_exception: 1; - unsigned int report_on_exception: 1; - unsigned int pending_interrupt_queue_checked: 1; - int8_t priority; /* -3 .. 3 (RUBY_THREAD_PRIORITY_{MIN,MAX}) */ - uint32_t running_time_us; /* 12500..800000 */ - - void *blocking_region_buffer; - - VALUE thgroup; - VALUE value; - - /* temporary place of retval on OPT_CALL_THREADED_CODE */ -#if OPT_CALL_THREADED_CODE - VALUE retval; -#endif - - /* async errinfo queue */ - VALUE pending_interrupt_queue; - VALUE pending_interrupt_mask_stack; - - /* interrupt management */ - rb_nativethread_lock_t interrupt_lock; - struct rb_unblock_callback unblock; - VALUE locking_mutex; - struct rb_mutex_struct *keeping_mutexes; - - struct rb_waiting_list *join_list; - - union { - struct { - VALUE proc; - VALUE args; - int kw_splat; - } proc; - struct { - VALUE (*func)(void *); - void *arg; - } func; - } invoke_arg; - - enum thread_invoke_type { - thread_invoke_type_none = 0, - thread_invoke_type_proc, - thread_invoke_type_ractor_proc, - thread_invoke_type_func - } invoke_type; - - /* statistics data for profiler */ - VALUE stat_insn_usage; - - /* fiber */ - rb_fiber_t *root_fiber; - - VALUE scheduler; - unsigned int blocking; - - /* misc */ - VALUE name; - void **specific_storage; - - struct rb_ext_config ext_config; -} rb_thread_t; - -static inline unsigned int -rb_th_serial(const rb_thread_t *th) -{ - return th ? (unsigned int)th->serial : 0; -} - -typedef enum { - VM_DEFINECLASS_TYPE_CLASS = 0x00, - VM_DEFINECLASS_TYPE_SINGLETON_CLASS = 0x01, - VM_DEFINECLASS_TYPE_MODULE = 0x02, - /* 0x03..0x06 is reserved */ - VM_DEFINECLASS_TYPE_MASK = 0x07 -} rb_vm_defineclass_type_t; - -#define VM_DEFINECLASS_TYPE(x) ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK) -#define VM_DEFINECLASS_FLAG_SCOPED 0x08 -#define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS 0x10 -#define VM_DEFINECLASS_SCOPED_P(x) ((x) & VM_DEFINECLASS_FLAG_SCOPED) -#define VM_DEFINECLASS_HAS_SUPERCLASS_P(x) \ - ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS) - -/* iseq.c */ -RUBY_SYMBOL_EXPORT_BEGIN - -/* node -> iseq */ -rb_iseq_t *rb_iseq_new (const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type); -rb_iseq_t *rb_iseq_new_top (const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent); -rb_iseq_t *rb_iseq_new_main (const VALUE ast_value, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt); -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); -rb_iseq_t *rb_iseq_new_with_opt(const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth, - enum rb_iseq_type, const rb_compile_option_t*, - VALUE script_lines); - -struct iseq_link_anchor; -struct rb_iseq_new_with_callback_callback_func { - VALUE flags; - VALUE reserved; - void (*func)(rb_iseq_t *, struct iseq_link_anchor *, const void *); - const void *data; -}; -static inline struct rb_iseq_new_with_callback_callback_func * -rb_iseq_new_with_callback_new_callback( - void (*func)(rb_iseq_t *, struct iseq_link_anchor *, const void *), const void *ptr) -{ - struct rb_iseq_new_with_callback_callback_func *memo = - IMEMO_NEW(struct rb_iseq_new_with_callback_callback_func, imemo_ifunc, Qfalse); - memo->func = func; - memo->data = ptr; - - return memo; -} -rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_callback_func * ifunc, - VALUE name, VALUE path, VALUE realpath, int first_lineno, - const rb_iseq_t *parent, enum rb_iseq_type, const rb_compile_option_t*); - -VALUE rb_iseq_disasm(const rb_iseq_t *iseq); -int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child); - -VALUE rb_iseq_coverage(const rb_iseq_t *iseq); - -RUBY_EXTERN VALUE rb_cISeq; -RUBY_EXTERN VALUE rb_cRubyVM; -RUBY_EXTERN VALUE rb_mRubyVMFrozenCore; -RUBY_EXTERN VALUE rb_block_param_proxy; -RUBY_SYMBOL_EXPORT_END - -#define GetProcPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_proc_t, (ptr)) - -typedef struct { - const struct rb_block block; - unsigned int is_from_method: 1; /* bool */ - unsigned int is_lambda: 1; /* bool */ - unsigned int is_isolated: 1; /* bool */ -} rb_proc_t; - -RUBY_SYMBOL_EXPORT_BEGIN -VALUE rb_proc_isolate(VALUE self); -VALUE rb_proc_isolate_bang(VALUE self); -VALUE rb_proc_ractor_make_shareable(VALUE self); -RUBY_SYMBOL_EXPORT_END - -typedef struct { - VALUE flags; /* imemo header */ - rb_iseq_t *iseq; - const VALUE *ep; - const VALUE *env; - unsigned int env_size; -} rb_env_t; - -extern const rb_data_type_t ruby_binding_data_type; - -#define GetBindingPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_binding_t, (ptr)) - -typedef struct { - const struct rb_block block; - const VALUE pathobj; - int first_lineno; -} rb_binding_t; - -/* used by compile time and send insn */ - -enum vm_check_match_type { - VM_CHECKMATCH_TYPE_WHEN = 1, - VM_CHECKMATCH_TYPE_CASE = 2, - VM_CHECKMATCH_TYPE_RESCUE = 3 -}; - -#define VM_CHECKMATCH_TYPE_MASK 0x03 -#define VM_CHECKMATCH_ARRAY 0x04 - -enum vm_special_object_type { - VM_SPECIAL_OBJECT_VMCORE = 1, - VM_SPECIAL_OBJECT_CBASE, - VM_SPECIAL_OBJECT_CONST_BASE -}; - -enum vm_svar_index { - VM_SVAR_LASTLINE = 0, /* $_ */ - VM_SVAR_BACKREF = 1, /* $~ */ - - VM_SVAR_EXTRA_START = 2, - VM_SVAR_FLIPFLOP_START = 2 /* flipflop */ -}; - -/* inline cache */ -typedef struct iseq_inline_constant_cache *IC; -typedef struct iseq_inline_iv_cache_entry *IVC; -typedef struct iseq_inline_cvar_cache_entry *ICVARC; -typedef union iseq_inline_storage_entry *ISE; -typedef const struct rb_callinfo *CALL_INFO; -typedef const struct rb_callcache *CALL_CACHE; -typedef struct rb_call_data *CALL_DATA; - -typedef VALUE CDHASH; - -#ifndef FUNC_FASTCALL -#define FUNC_FASTCALL(x) x -#endif - -typedef rb_control_frame_t * - (FUNC_FASTCALL(*rb_insn_func_t))(rb_execution_context_t *, rb_control_frame_t *); - -#define VM_TAGGED_PTR_SET(p, tag) ((VALUE)(p) | (tag)) -#define VM_TAGGED_PTR_REF(v, mask) ((void *)((v) & ~mask)) - -#define GC_GUARDED_PTR(p) VM_TAGGED_PTR_SET((p), 0x01) -#define GC_GUARDED_PTR_REF(p) VM_TAGGED_PTR_REF((p), 0x03) -#define GC_GUARDED_PTR_P(p) (((VALUE)(p)) & 0x01) - -enum vm_frame_env_flags { - /* Frame/Environment flag bits: - * MMMM MMMM MMMM MMMM ____ FFFF FFFE EEEX (LSB) - * - * X : tag for GC marking (It seems as Fixnum) - * EEE : 4 bits Env flags - * FF..: 7 bits Frame flags - * MM..: 15 bits frame magic (to check frame corruption) - */ - - /* frame types */ - VM_FRAME_MAGIC_METHOD = 0x11110001, - VM_FRAME_MAGIC_BLOCK = 0x22220001, - VM_FRAME_MAGIC_CLASS = 0x33330001, - VM_FRAME_MAGIC_TOP = 0x44440001, - VM_FRAME_MAGIC_CFUNC = 0x55550001, - VM_FRAME_MAGIC_IFUNC = 0x66660001, - VM_FRAME_MAGIC_EVAL = 0x77770001, - VM_FRAME_MAGIC_RESCUE = 0x78880001, - VM_FRAME_MAGIC_DUMMY = 0x79990001, - - VM_FRAME_MAGIC_MASK = 0x7fff0001, - - /* frame flag */ - VM_FRAME_FLAG_FINISH = 0x0020, - VM_FRAME_FLAG_BMETHOD = 0x0040, - VM_FRAME_FLAG_CFRAME = 0x0080, - VM_FRAME_FLAG_LAMBDA = 0x0100, - VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM = 0x0200, - VM_FRAME_FLAG_CFRAME_KW = 0x0400, - VM_FRAME_FLAG_PASSED = 0x0800, - - /* env flag */ - VM_ENV_FLAG_LOCAL = 0x0002, - VM_ENV_FLAG_ESCAPED = 0x0004, - VM_ENV_FLAG_WB_REQUIRED = 0x0008, - VM_ENV_FLAG_ISOLATED = 0x0010, -}; - -#define VM_ENV_DATA_SIZE ( 3) - -#define VM_ENV_DATA_INDEX_ME_CREF (-2) /* ep[-2] */ -#define VM_ENV_DATA_INDEX_SPECVAL (-1) /* ep[-1] */ -#define VM_ENV_DATA_INDEX_FLAGS ( 0) /* ep[ 0] */ -#define VM_ENV_DATA_INDEX_ENV ( 1) /* ep[ 1] */ - -#define VM_ENV_INDEX_LAST_LVAR (-VM_ENV_DATA_SIZE) - -static inline void VM_FORCE_WRITE_SPECIAL_CONST(const VALUE *ptr, VALUE special_const_value); - -static inline void -VM_ENV_FLAGS_SET(const VALUE *ep, VALUE flag) -{ - VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS]; - VM_ASSERT(FIXNUM_P(flags)); - VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_FLAGS], flags | flag); -} - -static inline void -VM_ENV_FLAGS_UNSET(const VALUE *ep, VALUE flag) -{ - VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS]; - VM_ASSERT(FIXNUM_P(flags)); - VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_FLAGS], flags & ~flag); -} - -static inline unsigned long -VM_ENV_FLAGS(const VALUE *ep, long flag) -{ - VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS]; - VM_ASSERT(FIXNUM_P(flags)); - return flags & flag; -} - -static inline unsigned long -VM_FRAME_TYPE(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_MAGIC_MASK); -} - -static inline int -VM_FRAME_LAMBDA_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_LAMBDA) != 0; -} - -static inline int -VM_FRAME_CFRAME_KW_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME_KW) != 0; -} - -static inline int -VM_FRAME_FINISHED_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_FINISH) != 0; -} - -static inline int -VM_FRAME_BMETHOD_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_BMETHOD) != 0; -} - -static inline int -rb_obj_is_iseq(VALUE iseq) -{ - return imemo_type_p(iseq, imemo_iseq); -} - -#if VM_CHECK_MODE > 0 -#define RUBY_VM_NORMAL_ISEQ_P(iseq) rb_obj_is_iseq((VALUE)iseq) -#endif - -static inline int -VM_FRAME_CFRAME_P(const rb_control_frame_t *cfp) -{ - int cframe_p = VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME) != 0; - VM_ASSERT(RUBY_VM_NORMAL_ISEQ_P(cfp->iseq) != cframe_p || - (VM_FRAME_TYPE(cfp) & VM_FRAME_MAGIC_MASK) == VM_FRAME_MAGIC_DUMMY); - return cframe_p; -} - -static inline int -VM_FRAME_RUBYFRAME_P(const rb_control_frame_t *cfp) -{ - return !VM_FRAME_CFRAME_P(cfp); -} - -#define RUBYVM_CFUNC_FRAME_P(cfp) \ - (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC) - -#define VM_GUARDED_PREV_EP(ep) GC_GUARDED_PTR(ep) -#define VM_BLOCK_HANDLER_NONE 0 - -static inline int -VM_ENV_LOCAL_P(const VALUE *ep) -{ - return VM_ENV_FLAGS(ep, VM_ENV_FLAG_LOCAL) ? 1 : 0; -} - -static inline const VALUE * -VM_ENV_PREV_EP(const VALUE *ep) -{ - VM_ASSERT(VM_ENV_LOCAL_P(ep) == 0); - return GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]); -} - -static inline VALUE -VM_ENV_BLOCK_HANDLER(const VALUE *ep) -{ - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - return ep[VM_ENV_DATA_INDEX_SPECVAL]; -} - -#if VM_CHECK_MODE > 0 -int rb_vm_ep_in_heap_p(const VALUE *ep); -#endif - -static inline int -VM_ENV_ESCAPED_P(const VALUE *ep) -{ - VM_ASSERT(rb_vm_ep_in_heap_p(ep) == !!VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)); - return VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED) ? 1 : 0; -} - -#if VM_CHECK_MODE > 0 -static inline int -vm_assert_env(VALUE obj) -{ - VM_ASSERT(imemo_type_p(obj, imemo_env)); - return 1; -} -#endif - -RBIMPL_ATTR_NONNULL((1)) -static inline VALUE -VM_ENV_ENVVAL(const VALUE *ep) -{ - VALUE envval = ep[VM_ENV_DATA_INDEX_ENV]; - VM_ASSERT(VM_ENV_ESCAPED_P(ep)); - VM_ASSERT(vm_assert_env(envval)); - return envval; -} - -RBIMPL_ATTR_NONNULL((1)) -static inline const rb_env_t * -VM_ENV_ENVVAL_PTR(const VALUE *ep) -{ - return (const rb_env_t *)VM_ENV_ENVVAL(ep); -} - -static inline const rb_env_t * -vm_env_new(VALUE *env_ep, VALUE *env_body, unsigned int env_size, const rb_iseq_t *iseq) -{ - rb_env_t *env = IMEMO_NEW(rb_env_t, imemo_env, (VALUE)iseq); - env->ep = env_ep; - env->env = env_body; - env->env_size = env_size; - env_ep[VM_ENV_DATA_INDEX_ENV] = (VALUE)env; - return env; -} - -static inline void -VM_FORCE_WRITE(const VALUE *ptr, VALUE v) -{ - *((VALUE *)ptr) = v; -} - -static inline void -VM_FORCE_WRITE_SPECIAL_CONST(const VALUE *ptr, VALUE special_const_value) -{ - VM_ASSERT(RB_SPECIAL_CONST_P(special_const_value)); - VM_FORCE_WRITE(ptr, special_const_value); -} - -static inline void -VM_STACK_ENV_WRITE(const VALUE *ep, int index, VALUE v) -{ - VM_ASSERT(VM_ENV_FLAGS(ep, VM_ENV_FLAG_WB_REQUIRED) == 0); - VM_FORCE_WRITE(&ep[index], v); -} - -const VALUE *rb_vm_ep_local_ep(const VALUE *ep); -const VALUE *rb_vm_proc_local_ep(VALUE proc); -void rb_vm_block_ep_update(VALUE obj, const struct rb_block *dst, const VALUE *ep); -void rb_vm_block_copy(VALUE obj, const struct rb_block *dst, const struct rb_block *src); - -VALUE rb_vm_frame_block_handler(const rb_control_frame_t *cfp); - -#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) ((cfp)+1) -#define RUBY_VM_NEXT_CONTROL_FRAME(cfp) ((cfp)-1) - -#define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \ - ((void *)(ecfp) > (void *)(cfp)) - -static inline const rb_control_frame_t * -RUBY_VM_END_CONTROL_FRAME(const rb_execution_context_t *ec) -{ - return (rb_control_frame_t *)(ec->vm_stack + ec->vm_stack_size); -} - -static inline int -RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(const rb_execution_context_t *ec, const rb_control_frame_t *cfp) -{ - return !RUBY_VM_VALID_CONTROL_FRAME_P(cfp, RUBY_VM_END_CONTROL_FRAME(ec)); -} - -static inline int -VM_BH_ISEQ_BLOCK_P(VALUE block_handler) -{ - if ((block_handler & 0x03) == 0x01) { -#if VM_CHECK_MODE > 0 - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(imemo_type_p(captured->code.val, imemo_iseq)); -#endif - return 1; - } - else { - return 0; - } -} - -static inline VALUE -VM_BH_FROM_ISEQ_BLOCK(const struct rb_captured_block *captured) -{ - VALUE block_handler = VM_TAGGED_PTR_SET(captured, 0x01); - VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler)); - return block_handler; -} - -static inline const struct rb_captured_block * -VM_BH_TO_ISEQ_BLOCK(VALUE block_handler) -{ - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler)); - return captured; -} - -static inline int -VM_BH_IFUNC_P(VALUE block_handler) -{ - if ((block_handler & 0x03) == 0x03) { -#if VM_CHECK_MODE > 0 - struct rb_captured_block *captured = (void *)(block_handler & ~0x03); - VM_ASSERT(imemo_type_p(captured->code.val, imemo_ifunc)); -#endif - return 1; - } - else { - return 0; - } -} - -static inline VALUE -VM_BH_FROM_IFUNC_BLOCK(const struct rb_captured_block *captured) -{ - VALUE block_handler = VM_TAGGED_PTR_SET(captured, 0x03); - VM_ASSERT(VM_BH_IFUNC_P(block_handler)); - return block_handler; -} - -static inline const struct rb_captured_block * -VM_BH_TO_IFUNC_BLOCK(VALUE block_handler) -{ - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(VM_BH_IFUNC_P(block_handler)); - return captured; -} - -static inline const struct rb_captured_block * -VM_BH_TO_CAPT_BLOCK(VALUE block_handler) -{ - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(VM_BH_IFUNC_P(block_handler) || VM_BH_ISEQ_BLOCK_P(block_handler)); - return captured; -} - -static inline enum rb_block_handler_type -vm_block_handler_type(VALUE block_handler) -{ - if (VM_BH_ISEQ_BLOCK_P(block_handler)) { - return block_handler_type_iseq; - } - else if (VM_BH_IFUNC_P(block_handler)) { - return block_handler_type_ifunc; - } - else if (SYMBOL_P(block_handler)) { - return block_handler_type_symbol; - } - else { - VM_ASSERT(rb_obj_is_proc(block_handler)); - return block_handler_type_proc; - } -} - -static inline void -vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler)) -{ - VM_ASSERT(block_handler == VM_BLOCK_HANDLER_NONE || - (vm_block_handler_type(block_handler), 1)); -} - -static inline enum rb_block_type -vm_block_type(const struct rb_block *block) -{ -#if VM_CHECK_MODE > 0 - switch (block->type) { - case block_type_iseq: - VM_ASSERT(imemo_type_p(block->as.captured.code.val, imemo_iseq)); - break; - case block_type_ifunc: - VM_ASSERT(imemo_type_p(block->as.captured.code.val, imemo_ifunc)); - break; - case block_type_symbol: - VM_ASSERT(SYMBOL_P(block->as.symbol)); - break; - case block_type_proc: - VM_ASSERT(rb_obj_is_proc(block->as.proc)); - break; - } -#endif - return block->type; -} - -static inline void -vm_block_type_set(const struct rb_block *block, enum rb_block_type type) -{ - struct rb_block *mb = (struct rb_block *)block; - mb->type = type; -} - -static inline const struct rb_block * -vm_proc_block(VALUE procval) -{ - VM_ASSERT(rb_obj_is_proc(procval)); - return &((rb_proc_t *)RTYPEDDATA_DATA(procval))->block; -} - -static inline const rb_iseq_t *vm_block_iseq(const struct rb_block *block); -static inline const VALUE *vm_block_ep(const struct rb_block *block); - -static inline const rb_iseq_t * -vm_proc_iseq(VALUE procval) -{ - return vm_block_iseq(vm_proc_block(procval)); -} - -static inline const VALUE * -vm_proc_ep(VALUE procval) -{ - return vm_block_ep(vm_proc_block(procval)); -} - -static inline const rb_iseq_t * -vm_block_iseq(const struct rb_block *block) -{ - switch (vm_block_type(block)) { - case block_type_iseq: return rb_iseq_check(block->as.captured.code.iseq); - case block_type_proc: return vm_proc_iseq(block->as.proc); - case block_type_ifunc: - case block_type_symbol: return NULL; - } - VM_UNREACHABLE(vm_block_iseq); - return NULL; -} - -static inline const VALUE * -vm_block_ep(const struct rb_block *block) -{ - switch (vm_block_type(block)) { - case block_type_iseq: - case block_type_ifunc: return block->as.captured.ep; - case block_type_proc: return vm_proc_ep(block->as.proc); - case block_type_symbol: return NULL; - } - VM_UNREACHABLE(vm_block_ep); - return NULL; -} - -static inline VALUE -vm_block_self(const struct rb_block *block) -{ - switch (vm_block_type(block)) { - case block_type_iseq: - case block_type_ifunc: - return block->as.captured.self; - case block_type_proc: - return vm_block_self(vm_proc_block(block->as.proc)); - case block_type_symbol: - return Qundef; - } - VM_UNREACHABLE(vm_block_self); - return Qundef; -} - -static inline VALUE -VM_BH_TO_SYMBOL(VALUE block_handler) -{ - VM_ASSERT(SYMBOL_P(block_handler)); - return block_handler; -} - -static inline VALUE -VM_BH_FROM_SYMBOL(VALUE symbol) -{ - VM_ASSERT(SYMBOL_P(symbol)); - return symbol; -} - -static inline VALUE -VM_BH_TO_PROC(VALUE block_handler) -{ - VM_ASSERT(rb_obj_is_proc(block_handler)); - return block_handler; -} - -static inline VALUE -VM_BH_FROM_PROC(VALUE procval) -{ - VM_ASSERT(rb_obj_is_proc(procval)); - return procval; -} - -/* VM related object allocate functions */ -VALUE rb_thread_alloc(VALUE klass); -VALUE rb_binding_alloc(VALUE klass); -VALUE rb_proc_alloc(VALUE klass); -VALUE rb_proc_dup(VALUE self); - -/* for debug */ -extern bool rb_vmdebug_stack_dump_raw(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *); -extern bool rb_vmdebug_debug_print_pre(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE *_pc, FILE *); -extern bool rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *); - -#define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp, stderr) -#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp), stderr) -bool rb_vm_bugreport(const void *, FILE *); -typedef void (*ruby_sighandler_t)(int); -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5) -NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...)); - -/* functions about thread/vm execution */ -RUBY_SYMBOL_EXPORT_BEGIN -VALUE rb_iseq_eval(const rb_iseq_t *iseq); -VALUE rb_iseq_eval_main(const rb_iseq_t *iseq); -VALUE rb_iseq_path(const rb_iseq_t *iseq); -VALUE rb_iseq_realpath(const rb_iseq_t *iseq); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_iseq_pathobj_new(VALUE path, VALUE realpath); -void rb_iseq_pathobj_set(const rb_iseq_t *iseq, VALUE path, VALUE realpath); - -int rb_ec_frame_method_id_and_class(const rb_execution_context_t *ec, ID *idp, ID *called_idp, VALUE *klassp); -void rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause); - -VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, int kw_splat, VALUE block_handler); - -VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda); -static inline VALUE -rb_vm_make_proc(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass) -{ - return rb_vm_make_proc_lambda(ec, captured, klass, 0); -} - -static inline VALUE -rb_vm_make_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass) -{ - return rb_vm_make_proc_lambda(ec, captured, klass, 1); -} - -VALUE rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *src_cfp); -VALUE rb_vm_env_local_variables(const rb_env_t *env); -const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env); -const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars); -void rb_vm_inc_const_missing_count(void); -VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, - const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat); -void rb_vm_pop_frame_no_int(rb_execution_context_t *ec); -void rb_vm_pop_frame(rb_execution_context_t *ec); - -void rb_thread_start_timer_thread(void); -void rb_thread_stop_timer_thread(void); -void rb_thread_reset_timer_thread(void); -void rb_thread_wakeup_timer_thread(int); - -static inline void -rb_vm_living_threads_init(rb_vm_t *vm) -{ - ccan_list_head_init(&vm->waiting_fds); - ccan_list_head_init(&vm->workqueue); - ccan_list_head_init(&vm->ractor.set); - ccan_list_head_init(&vm->ractor.sched.zombie_threads); -} - -typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE); -rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -VALUE *rb_vm_svar_lep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -int rb_vm_get_sourceline(const rb_control_frame_t *); -void rb_vm_stack_to_heap(rb_execution_context_t *ec); -void ruby_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame); -rb_thread_t * ruby_thread_from_native(void); -int ruby_thread_set_native(rb_thread_t *th); -int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp); -void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp); -void rb_vm_env_write(const VALUE *ep, int index, VALUE v); -VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler); - -void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg); - -#define rb_vm_register_special_exception(sp, e, m) \ - rb_vm_register_special_exception_str(sp, e, rb_usascii_str_new_static((m), (long)rb_strlen_lit(m))) - -void rb_gc_mark_machine_context(const rb_execution_context_t *ec); - -void rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr); - -const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp); - -#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack] - -#define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) do { \ - STATIC_ASSERT(sizeof_sp, sizeof(*(sp)) == sizeof(VALUE)); \ - STATIC_ASSERT(sizeof_cfp, sizeof(*(cfp)) == sizeof(rb_control_frame_t)); \ - const struct rb_control_frame_struct *bound = (void *)&(sp)[(margin)]; \ - if (UNLIKELY((cfp) <= &bound[1])) { \ - vm_stackoverflow(); \ - } \ -} while (0) - -#define CHECK_VM_STACK_OVERFLOW(cfp, margin) \ - CHECK_VM_STACK_OVERFLOW0((cfp), (cfp)->sp, (margin)) - -VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr); - -rb_execution_context_t *rb_vm_main_ractor_ec(rb_vm_t *vm); // ractor.c - -/* for thread */ - -#if RUBY_VM_THREAD_MODEL == 2 - -RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c -RUBY_EXTERN rb_vm_t *ruby_current_vm_ptr; -RUBY_EXTERN rb_event_flag_t ruby_vm_event_flags; -RUBY_EXTERN rb_event_flag_t ruby_vm_event_enabled_global_flags; -RUBY_EXTERN unsigned int ruby_vm_event_local_num; - -#define GET_VM() rb_current_vm() -#define GET_RACTOR() rb_current_ractor() -#define GET_THREAD() rb_current_thread() -#define GET_EC() rb_current_execution_context(true) - -static inline rb_thread_t * -rb_ec_thread_ptr(const rb_execution_context_t *ec) -{ - return ec->thread_ptr; -} - -static inline rb_ractor_t * -rb_ec_ractor_ptr(const rb_execution_context_t *ec) -{ - const rb_thread_t *th = rb_ec_thread_ptr(ec); - if (th) { - VM_ASSERT(th->ractor != NULL); - return th->ractor; - } - else { - return NULL; - } -} - -static inline rb_vm_t * -rb_ec_vm_ptr(const rb_execution_context_t *ec) -{ - const rb_thread_t *th = rb_ec_thread_ptr(ec); - if (th) { - return th->vm; - } - else { - return NULL; - } -} - -static inline rb_execution_context_t * -rb_current_execution_context(bool expect_ec) -{ -#ifdef RB_THREAD_LOCAL_SPECIFIER - #ifdef __APPLE__ - rb_execution_context_t *ec = rb_current_ec(); - #else - rb_execution_context_t *ec = ruby_current_ec; - #endif - - /* On the shared objects, `__tls_get_addr()` is used to access the TLS - * and the address of the `ruby_current_ec` can be stored on a function - * frame. However, this address can be mis-used after native thread - * migration of a coroutine. - * 1) Get `ptr =&ruby_current_ec` op NT1 and store it on the frame. - * 2) Context switch and resume it on the NT2. - * 3) `ptr` is used on NT2 but it accesses to the TLS on NT1. - * This assertion checks such misusage. - * - * To avoid accidents, `GET_EC()` should be called once on the frame. - * Note that inlining can produce the problem. - */ - VM_ASSERT(ec == rb_current_ec_noinline()); -#else - rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key); -#endif - VM_ASSERT(!expect_ec || ec != NULL); - return ec; -} - -static inline rb_thread_t * -rb_current_thread(void) -{ - const rb_execution_context_t *ec = GET_EC(); - return rb_ec_thread_ptr(ec); -} - -static inline rb_ractor_t * -rb_current_ractor_raw(bool expect) -{ - if (ruby_single_main_ractor) { - return ruby_single_main_ractor; - } - else { - const rb_execution_context_t *ec = rb_current_execution_context(expect); - return (expect || ec) ? rb_ec_ractor_ptr(ec) : NULL; - } -} - -static inline rb_ractor_t * -rb_current_ractor(void) -{ - return rb_current_ractor_raw(true); -} - -static inline rb_vm_t * -rb_current_vm(void) -{ -#if 0 // TODO: reconsider the assertions - VM_ASSERT(ruby_current_vm_ptr == NULL || - ruby_current_execution_context_ptr == NULL || - rb_ec_thread_ptr(GET_EC()) == NULL || - rb_ec_thread_ptr(GET_EC())->status == THREAD_KILLED || - rb_ec_vm_ptr(GET_EC()) == ruby_current_vm_ptr); -#endif - - return ruby_current_vm_ptr; -} - -void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec, - unsigned int recorded_lock_rec, - unsigned int current_lock_rec); - -static inline unsigned int -rb_ec_vm_lock_rec(const rb_execution_context_t *ec) -{ - rb_vm_t *vm = rb_ec_vm_ptr(ec); - - if (vm->ractor.sync.lock_owner != rb_ec_ractor_ptr(ec)) { - return 0; - } - else { - return vm->ractor.sync.lock_rec; - } -} - -#else -#error "unsupported thread model" -#endif - -enum { - TIMER_INTERRUPT_MASK = 0x01, - PENDING_INTERRUPT_MASK = 0x02, - POSTPONED_JOB_INTERRUPT_MASK = 0x04, - TRAP_INTERRUPT_MASK = 0x08, - TERMINATE_INTERRUPT_MASK = 0x10, - VM_BARRIER_INTERRUPT_MASK = 0x20, -}; - -#define RUBY_VM_SET_TIMER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TIMER_INTERRUPT_MASK) -#define RUBY_VM_SET_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, PENDING_INTERRUPT_MASK) -#define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK) -#define RUBY_VM_SET_TRAP_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TRAP_INTERRUPT_MASK) -#define RUBY_VM_SET_TERMINATE_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TERMINATE_INTERRUPT_MASK) -#define RUBY_VM_SET_VM_BARRIER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, VM_BARRIER_INTERRUPT_MASK) -#define RUBY_VM_INTERRUPTED(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask & \ - (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK)) - -static inline bool -RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec) -{ -#if defined(USE_VM_CLOCK) && USE_VM_CLOCK - uint32_t current_clock = rb_ec_vm_ptr(ec)->clock; - - if (current_clock != ec->checked_clock) { - ec->checked_clock = current_clock; - RUBY_VM_SET_TIMER_INTERRUPT(ec); - } -#endif - return ec->interrupt_flag & ~(ec)->interrupt_mask; -} - -VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt); -int rb_signal_buff_size(void); -int rb_signal_exec(rb_thread_t *th, int sig); -void rb_threadptr_check_signal(rb_thread_t *mth); -void rb_threadptr_signal_raise(rb_thread_t *th, int sig); -void rb_threadptr_signal_exit(rb_thread_t *th); -int rb_threadptr_execute_interrupts(rb_thread_t *, int); -void rb_threadptr_interrupt(rb_thread_t *th); -void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th); -void rb_threadptr_pending_interrupt_clear(rb_thread_t *th); -void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v); -VALUE rb_ec_get_errinfo(const rb_execution_context_t *ec); -void rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo); -void rb_execution_context_update(rb_execution_context_t *ec); -void rb_execution_context_mark(const rb_execution_context_t *ec); -void rb_fiber_close(rb_fiber_t *fib); -void Init_native_thread(rb_thread_t *th); -int rb_vm_check_ints_blocking(rb_execution_context_t *ec); - -// vm_sync.h -void rb_vm_cond_wait(rb_vm_t *vm, rb_nativethread_cond_t *cond); -void rb_vm_cond_timedwait(rb_vm_t *vm, rb_nativethread_cond_t *cond, unsigned long msec); - -#define RUBY_VM_CHECK_INTS(ec) rb_vm_check_ints(ec) -static inline void -rb_vm_check_ints(rb_execution_context_t *ec) -{ -#ifdef RUBY_ASSERT_CRITICAL_SECTION - VM_ASSERT(ruby_assert_critical_section_entered == 0); -#endif - - VM_ASSERT(ec == GET_EC()); - - if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) { - rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0); - } -} - -/* tracer */ - -struct rb_trace_arg_struct { - rb_event_flag_t event; - rb_execution_context_t *ec; - const rb_control_frame_t *cfp; - VALUE self; - ID id; - ID called_id; - VALUE klass; - VALUE data; - - int klass_solved; - - /* calc from cfp */ - int lineno; - VALUE path; -}; - -void rb_hook_list_mark(rb_hook_list_t *hooks); -void rb_hook_list_mark_and_update(rb_hook_list_t *hooks); -void rb_hook_list_free(rb_hook_list_t *hooks); -void rb_hook_list_connect_tracepoint(VALUE target, rb_hook_list_t *list, VALUE tpval, unsigned int target_line); -void rb_hook_list_remove_tracepoint(rb_hook_list_t *list, VALUE tpval); - -void rb_exec_event_hooks(struct rb_trace_arg_struct *trace_arg, rb_hook_list_t *hooks, int pop_p); - -#define EXEC_EVENT_HOOK_ORIG(ec_, hooks_, flag_, self_, id_, called_id_, klass_, data_, pop_p_) do { \ - const rb_event_flag_t flag_arg_ = (flag_); \ - rb_hook_list_t *hooks_arg_ = (hooks_); \ - if (UNLIKELY((hooks_arg_)->events & (flag_arg_))) { \ - /* defer evaluating the other arguments */ \ - rb_exec_event_hook_orig(ec_, hooks_arg_, flag_arg_, self_, id_, called_id_, klass_, data_, pop_p_); \ - } \ -} while (0) - -static inline void -rb_exec_event_hook_orig(rb_execution_context_t *ec, rb_hook_list_t *hooks, rb_event_flag_t flag, - VALUE self, ID id, ID called_id, VALUE klass, VALUE data, int pop_p) -{ - struct rb_trace_arg_struct trace_arg; - - VM_ASSERT((hooks->events & flag) != 0); - - trace_arg.event = flag; - trace_arg.ec = ec; - trace_arg.cfp = ec->cfp; - trace_arg.self = self; - trace_arg.id = id; - trace_arg.called_id = called_id; - trace_arg.klass = klass; - trace_arg.data = data; - trace_arg.path = Qundef; - trace_arg.klass_solved = 0; - - rb_exec_event_hooks(&trace_arg, hooks, pop_p); -} - -struct rb_ractor_pub { - VALUE self; - uint32_t id; - rb_hook_list_t hooks; -}; - -static inline rb_hook_list_t * -rb_ec_ractor_hooks(const rb_execution_context_t *ec) -{ - struct rb_ractor_pub *cr_pub = (struct rb_ractor_pub *)rb_ec_ractor_ptr(ec); - return &cr_pub->hooks; -} - -#define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \ - EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0) - -#define EXEC_EVENT_HOOK_AND_POP_FRAME(ec_, flag_, self_, id_, called_id_, klass_, data_) \ - EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1) - -static inline void -rb_exec_event_hook_script_compiled(rb_execution_context_t *ec, const rb_iseq_t *iseq, VALUE eval_script) -{ - EXEC_EVENT_HOOK(ec, RUBY_EVENT_SCRIPT_COMPILED, ec->cfp->self, 0, 0, 0, - NIL_P(eval_script) ? (VALUE)iseq : - rb_ary_new_from_args(2, eval_script, (VALUE)iseq)); -} - -void rb_vm_trap_exit(rb_vm_t *vm); -void rb_vm_postponed_job_atfork(void); /* vm_trace.c */ -void rb_vm_postponed_job_free(void); /* vm_trace.c */ -size_t rb_vm_memsize_postponed_job_queue(void); /* vm_trace.c */ -void rb_vm_postponed_job_queue_init(rb_vm_t *vm); /* vm_trace.c */ - -RUBY_SYMBOL_EXPORT_BEGIN - -int rb_thread_check_trap_pending(void); - -/* #define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000 */ /* from vm_core.h */ -#define RUBY_EVENT_COVERAGE_LINE 0x010000 -#define RUBY_EVENT_COVERAGE_BRANCH 0x020000 - -extern VALUE rb_get_coverages(void); -extern void rb_set_coverages(VALUE, int, VALUE); -extern void rb_clear_coverages(void); -extern void rb_reset_coverages(void); -extern void rb_resume_coverages(void); -extern void rb_suspend_coverages(void); - -void rb_postponed_job_flush(rb_vm_t *vm); - -// ractor.c -RUBY_EXTERN VALUE rb_eRactorUnsafeError; -RUBY_EXTERN VALUE rb_eRactorIsolationError; - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_VM_CORE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h deleted file mode 100644 index d0bc815..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef RUBY_DEBUG_H -#define RUBY_DEBUG_H -/********************************************************************** - - vm_debug.h - YARV Debug function interface - - $Author$ - created at: 04/08/25 02:33:49 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -#include "ruby/ruby.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#define dpv(h,v) ruby_debug_print_value(-1, 0, (h), (v)) -#define dp(v) ruby_debug_print_value(-1, 0, "", (v)) -#define dpi(i) ruby_debug_print_id(-1, 0, "", (i)) -#define dpn(n) ruby_debug_print_node(-1, 0, "", (n)) - -struct RNode; - -VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v); -void ruby_debug_print_v(VALUE v); -ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id); -struct RNode *ruby_debug_print_node(int level, int debug_level, const char *header, const struct RNode *node); -void ruby_debug_print_n(const struct RNode *node); -int ruby_debug_print_indent(int level, int debug_level, int indent_level); -void ruby_debug_gc_check_func(void); -void ruby_set_debug_option(const char *str); - -RUBY_SYMBOL_EXPORT_END - -#ifndef USE_RUBY_DEBUG_LOG -#define USE_RUBY_DEBUG_LOG 0 -#endif - -/* RUBY_DEBUG_LOG: Logging debug information mechanism - * - * This feature provides a mechanism to store logging information - * to a file, stderr or memory space with simple macros. - * - * The following information will be stored. - * * (1) __FILE__, __LINE__ in C - * * (2) __FILE__, __LINE__ in Ruby - * * (3) __func__ in C (message title) - * * (4) given string with sprintf format - * * (5) Thread number (if multiple threads are running) - * - * This feature is enabled only USE_RUBY_DEBUG_LOG is enabled. - * Release version should not enable it. - * - * Running with the `RUBY_DEBUG_LOG` environment variable enables - * this feature. - * - * # logging into a file - * RUBY_DEBUG_LOG=/path/to/file STDERR - * - * # logging into STDERR - * RUBY_DEBUG_LOG=stderr - * - * # logging into memory space (check with a debugger) - * # It will help if the timing is important. - * RUBY_DEBUG_LOG=mem - * - * RUBY_DEBUG_LOG_FILTER environment variable can specify the filter string. - * If "(3) __func__ in C (message title)" contains the specified string, the - * information will be stored (example: RUBY_DEBUG_LOG_FILTER=str will enable - * only on str related information). - * - * In a MRI source code, you can use the following macros: - * * RUBY_DEBUG_LOG(fmt, ...): Above (1) to (4) will be logged. - * * RUBY_DEBUG_LOG2(file, line, fmt, ...): - * Same as RUBY_DEBUG_LOG(), but (1) will be replaced with given file, line. - */ - -extern enum ruby_debug_log_mode { - ruby_debug_log_disabled = 0x00, - ruby_debug_log_memory = 0x01, - ruby_debug_log_stderr = 0x02, - ruby_debug_log_file = 0x04, -} ruby_debug_log_mode; - -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5) -void ruby_debug_log(const char *file, int line, const char *func_name, const char *fmt, ...); -void ruby_debug_log_print(unsigned int n); -bool ruby_debug_log_filter(const char *func_name, const char *file_name); - -#if RBIMPL_COMPILER_IS(GCC) && defined(__OPTIMIZE__) -# define ruby_debug_log(...) \ - RB_GNUC_EXTENSION_BLOCK( \ - RBIMPL_WARNING_PUSH(); \ - RBIMPL_WARNING_IGNORED(-Wformat-zero-length); \ - ruby_debug_log(__VA_ARGS__); \ - RBIMPL_WARNING_POP()) -#endif - -// convenient macro to log even if the USE_RUBY_DEBUG_LOG macro is not specified. -// You can use this macro for temporary usage (you should not commit it). -#define _RUBY_DEBUG_LOG(...) ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__) - -#if USE_RUBY_DEBUG_LOG -# define RUBY_DEBUG_LOG_ENABLED(func_name, file_name) \ - (ruby_debug_log_mode && ruby_debug_log_filter(func_name, file_name)) - -#define RUBY_DEBUG_LOG(...) do { \ - if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, __FILE__)) \ - ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \ -} while (0) - -#define RUBY_DEBUG_LOG2(file, line, ...) do { \ - if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, file)) \ - ruby_debug_log(file, line, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \ -} while (0) - -#else // USE_RUBY_DEBUG_LOG -// do nothing -#define RUBY_DEBUG_LOG(...) -#define RUBY_DEBUG_LOG2(file, line, ...) -#endif // USE_RUBY_DEBUG_LOG - -#endif /* RUBY_DEBUG_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h deleted file mode 100644 index c3b7d4e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h +++ /dev/null @@ -1,199 +0,0 @@ -#ifndef RUBY_VM_EXEC_H -#define RUBY_VM_EXEC_H -/********************************************************************** - - vm.h - - - $Author$ - created at: 04/01/01 16:56:59 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -typedef long OFFSET; -typedef unsigned long lindex_t; -typedef VALUE GENTRY; -typedef rb_iseq_t *ISEQ; - -#if VMDEBUG > 0 -#define debugs printf -#define DEBUG_ENTER_INSN(insn) \ - rb_vmdebug_debug_print_pre(ec, GET_CFP(), GET_PC()); - -#define SC_REGS() - -#define DEBUG_END_INSN() \ - rb_vmdebug_debug_print_post(ec, GET_CFP() SC_REGS()); - -#else - -#define debugs -#define DEBUG_ENTER_INSN(insn) -#define DEBUG_END_INSN() -#endif - -#define throwdebug if(0)ruby_debug_printf -/* #define throwdebug ruby_debug_printf */ - -/************************************************/ -#if defined(DISPATCH_XXX) -error ! -/************************************************/ -#elif OPT_CALL_THREADED_CODE - -#define LABEL(x) insn_func_##x -#define ELABEL(x) -#define LABEL_PTR(x) &LABEL(x) - -#define INSN_ENTRY(insn) \ - static rb_control_frame_t * \ - FUNC_FASTCALL(LABEL(insn))(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp) { - -#define END_INSN(insn) return reg_cfp;} - -#define NEXT_INSN() return reg_cfp; - -#define START_OF_ORIGINAL_INSN(x) /* ignore */ -#define DISPATCH_ORIGINAL_INSN(x) return LABEL(x)(ec, reg_cfp); - -/************************************************/ -#elif OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE -/* threaded code with gcc */ - -#define LABEL(x) INSN_LABEL_##x -#define ELABEL(x) INSN_ELABEL_##x -#define LABEL_PTR(x) RB_GNUC_EXTENSION(&&LABEL(x)) - -#define INSN_ENTRY_SIG(insn) \ - if (0) { \ - ruby_debug_printf("exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \ - (reg_pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded), \ - (reg_cfp->pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded), \ - RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \ - rb_iseq_line_no(reg_cfp->iseq, reg_pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded)); \ - } - -#define INSN_DISPATCH_SIG(insn) - -#define INSN_ENTRY(insn) \ - LABEL(insn): \ - INSN_ENTRY_SIG(insn); \ - -/**********************************/ -#if OPT_DIRECT_THREADED_CODE - -/* for GCC 3.4.x */ -#define TC_DISPATCH(insn) \ - INSN_DISPATCH_SIG(insn); \ - RB_GNUC_EXTENSION_BLOCK(goto *(void const *)GET_CURRENT_INSN()); \ - ; - -#else -/* token threaded code */ - -/* dispatcher */ -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3 -#define DISPATCH_ARCH_DEPEND_WAY(addr) \ - __asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr)) - -#else -#define DISPATCH_ARCH_DEPEND_WAY(addr) \ - /* do nothing */ -#endif -#define TC_DISPATCH(insn) \ - DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \ - INSN_DISPATCH_SIG(insn); \ - RB_GNUC_EXTENSION_BLOCK(goto *insns_address_table[GET_CURRENT_INSN()]); \ - rb_bug("tc error"); - -#endif /* OPT_DIRECT_THREADED_CODE */ - -#define END_INSN(insn) \ - DEBUG_END_INSN(); \ - TC_DISPATCH(insn); - -#define INSN_DISPATCH() \ - TC_DISPATCH(__START__) \ - { - -#define END_INSNS_DISPATCH() \ - rb_bug("unknown insn: %"PRIdVALUE, GET_CURRENT_INSN()); \ - } /* end of while loop */ \ - -#define NEXT_INSN() TC_DISPATCH(__NEXT_INSN__) - -/************************************************/ -#else /* no threaded code */ -/* most common method */ - -#define INSN_ENTRY(insn) \ -case BIN(insn): - -#define END_INSN(insn) \ - DEBUG_END_INSN(); \ - break; - -#define INSN_DISPATCH() \ - while (1) { \ - switch (GET_CURRENT_INSN()) { - -#define END_INSNS_DISPATCH() \ -default: \ - SDR(); \ - rb_bug("unknown insn: %ld", GET_CURRENT_INSN()); \ - } /* end of switch */ \ - } /* end of while loop */ \ - -#define NEXT_INSN() goto first - -#endif - -#ifndef START_OF_ORIGINAL_INSN -#define START_OF_ORIGINAL_INSN(x) if (0) goto start_of_##x; start_of_##x: -#define DISPATCH_ORIGINAL_INSN(x) goto start_of_##x; -#endif - -#define VM_SP_CNT(ec, sp) ((sp) - (ec)->vm_stack) - -#if OPT_CALL_THREADED_CODE -#define THROW_EXCEPTION(exc) do { \ - ec->errinfo = (VALUE)(exc); \ - return 0; \ -} while (0) -#else -#define THROW_EXCEPTION(exc) return (VALUE)(exc) -#endif - -// Run the interpreter from the JIT -#define VM_EXEC(ec, val) do { \ - if (UNDEF_P(val)) { \ - VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH); \ - val = vm_exec(ec); \ - } \ -} while (0) - -// Run the JIT from the interpreter -#define JIT_EXEC(ec, val) do { \ - rb_jit_func_t func; \ - /* don't run tailcalls since that breaks FINISH */ \ - if (UNDEF_P(val) && GET_CFP() != ec->cfp && (func = jit_compile(ec))) { \ - val = func(ec, ec->cfp); \ - if (ec->tag->state) THROW_EXCEPTION(val); \ - } \ -} while (0) - -#define SCREG(r) (reg_##r) - -#define VM_DEBUG_STACKOVERFLOW 0 - -#if VM_DEBUG_STACKOVERFLOW -#define CHECK_VM_STACK_OVERFLOW_FOR_INSN CHECK_VM_STACK_OVERFLOW -#else -#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin) -#endif - -#define INSN_LABEL2(insn, name) INSN_LABEL_ ## insn ## _ ## name -#define INSN_LABEL(x) INSN_LABEL2(NAME_OF_CURRENT_INSN, x) - -#endif /* RUBY_VM_EXEC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h deleted file mode 100644 index 926700b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h +++ /dev/null @@ -1,272 +0,0 @@ -#ifndef RUBY_INSNHELPER_H -#define RUBY_INSNHELPER_H -/********************************************************************** - - insnhelper.h - helper macros to implement each instructions - - $Author$ - created at: 04/01/01 15:50:34 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -RUBY_EXTERN VALUE ruby_vm_const_missing_count; -RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_invalidations; -RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_misses; -RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state; - -#if USE_YJIT || USE_RJIT // We want vm_insns_count on any JIT-enabled build. -// Increment vm_insns_count for --yjit-stats. We increment this even when -// --yjit or --yjit-stats is not used because branching to skip it is slower. -// We also don't use ATOMIC_INC for performance, allowing inaccuracy on Ractors. -#define JIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++ -#else -#define JIT_COLLECT_USAGE_INSN(insn) // none -#endif - -#if VM_COLLECT_USAGE_DETAILS -#define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) vm_collect_usage_operand((insn), (n), ((VALUE)(op))) -#define COLLECT_USAGE_REGISTER(reg, s) vm_collect_usage_register((reg), (s)) -#else -#define COLLECT_USAGE_INSN(insn) JIT_COLLECT_USAGE_INSN(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) // none -#define COLLECT_USAGE_REGISTER(reg, s) // none -#endif - -/**********************************************************/ -/* deal with stack */ -/**********************************************************/ - -#define PUSH(x) (SET_SV(x), INC_SP(1)) -#define TOPN(n) (*(GET_SP()-(n)-1)) -#define POPN(n) (DEC_SP(n)) -#define POP() (DEC_SP(1)) -#define STACK_ADDR_FROM_TOP(n) (GET_SP()-(n)) - -/**********************************************************/ -/* deal with registers */ -/**********************************************************/ - -#define VM_REG_CFP (reg_cfp) -#define VM_REG_PC (VM_REG_CFP->pc) -#define VM_REG_SP (VM_REG_CFP->sp) -#define VM_REG_EP (VM_REG_CFP->ep) - -#define RESTORE_REGS() do { \ - VM_REG_CFP = ec->cfp; \ -} while (0) - -typedef enum call_type { - CALL_PUBLIC, - CALL_FCALL, - CALL_VCALL, - CALL_PUBLIC_KW, - CALL_FCALL_KW -} call_type; - -#if VM_COLLECT_USAGE_DETAILS -enum vm_regan_regtype { - VM_REGAN_PC = 0, - VM_REGAN_SP = 1, - VM_REGAN_EP = 2, - VM_REGAN_CFP = 3, - VM_REGAN_SELF = 4, - VM_REGAN_ISEQ = 5 -}; -enum vm_regan_acttype { - VM_REGAN_ACT_GET = 0, - VM_REGAN_ACT_SET = 1 -}; - -#define COLLECT_USAGE_REGISTER_HELPER(a, b, v) \ - (COLLECT_USAGE_REGISTER((VM_REGAN_##a), (VM_REGAN_ACT_##b)), (v)) -#else -#define COLLECT_USAGE_REGISTER_HELPER(a, b, v) (v) -#endif - -/* PC */ -#define GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, VM_REG_PC)) -#define SET_PC(x) (VM_REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x)))) -#define GET_CURRENT_INSN() (*GET_PC()) -#define GET_OPERAND(n) (GET_PC()[(n)]) -#define ADD_PC(n) (SET_PC(VM_REG_PC + (n))) -#define JUMP(dst) (SET_PC(VM_REG_PC + (dst))) - -/* frame pointer, environment pointer */ -#define GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, VM_REG_CFP)) -#define GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, VM_REG_EP)) -#define SET_EP(x) (VM_REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x)))) -#define GET_LEP() (VM_EP_LEP(GET_EP())) - -/* SP */ -#define GET_SP() (COLLECT_USAGE_REGISTER_HELPER(SP, GET, VM_REG_SP)) -#define SET_SP(x) (VM_REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) -#define INC_SP(x) (VM_REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) -#define DEC_SP(x) (VM_REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) -#define SET_SV(x) (*GET_SP() = rb_ractor_confirm_belonging(x)) - /* set current stack value as x */ - -/* instruction sequence C struct */ -#define GET_ISEQ() (GET_CFP()->iseq) - -/**********************************************************/ -/* deal with variables */ -/**********************************************************/ - -#define GET_PREV_EP(ep) ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03)) - -/**********************************************************/ -/* deal with values */ -/**********************************************************/ - -#define GET_SELF() (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self)) - -/**********************************************************/ -/* deal with control flow 2: method/iterator */ -/**********************************************************/ - -/* set fastpath when cached method is *NOT* protected - * because inline method cache does not care about receiver. - */ - -static inline void -CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enabled) -{ - if (LIKELY(enabled)) { - vm_cc_call_set(cc, func); - } -} - -#define GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL]) - -/**********************************************************/ -/* deal with control flow 3: exception */ -/**********************************************************/ - - -/**********************************************************/ -/* deal with stack canary */ -/**********************************************************/ - -#if VM_CHECK_MODE > 0 -#define SETUP_CANARY(cond) \ - VALUE *canary = 0; \ - if (cond) { \ - canary = GET_SP(); \ - SET_SV(vm_stack_canary); \ - } \ - else {\ - SET_SV(Qfalse); /* cleanup */ \ - } -#define CHECK_CANARY(cond, insn) \ - if (cond) { \ - if (*canary == vm_stack_canary) { \ - *canary = Qfalse; /* cleanup */ \ - } \ - else { \ - rb_vm_canary_is_found_dead(insn, *canary); \ - } \ - } -#else -#define SETUP_CANARY(cond) if (cond) {} else {} -#define CHECK_CANARY(cond, insn) if (cond) {(void)(insn);} -#endif - -/**********************************************************/ -/* others */ -/**********************************************************/ - -#define CALL_SIMPLE_METHOD() do { \ - rb_snum_t insn_width = attr_width_opt_send_without_block(0); \ - ADD_PC(-insn_width); \ - DISPATCH_ORIGINAL_INSN(opt_send_without_block); \ -} while (0) - -#define GET_GLOBAL_CVAR_STATE() (ruby_vm_global_cvar_state) -#define INC_GLOBAL_CVAR_STATE() (++ruby_vm_global_cvar_state) - -static inline struct vm_throw_data * -THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, int st) -{ - struct vm_throw_data *obj = IMEMO_NEW(struct vm_throw_data, imemo_throw_data, 0); - *((VALUE *)&obj->throw_obj) = val; - *((struct rb_control_frame_struct **)&obj->catch_frame) = (struct rb_control_frame_struct *)cf; - obj->throw_state = st; - - return obj; -} - -static inline VALUE -THROW_DATA_VAL(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->throw_obj; -} - -static inline const rb_control_frame_t * -THROW_DATA_CATCH_FRAME(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->catch_frame; -} - -static inline int -THROW_DATA_STATE(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->throw_state; -} - -static inline int -THROW_DATA_CONSUMED_P(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->flags & THROW_DATA_CONSUMED; -} - -static inline void -THROW_DATA_CATCH_FRAME_SET(struct vm_throw_data *obj, const rb_control_frame_t *cfp) -{ - VM_ASSERT(THROW_DATA_P(obj)); - obj->catch_frame = cfp; -} - -static inline void -THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st) -{ - VM_ASSERT(THROW_DATA_P(obj)); - obj->throw_state = st; -} - -static inline void -THROW_DATA_CONSUMED_SET(struct vm_throw_data *obj) -{ - if (THROW_DATA_P(obj) && - THROW_DATA_STATE(obj) == TAG_BREAK) { - obj->flags |= THROW_DATA_CONSUMED; - } -} - -#define IS_ARGS_SPLAT(ci) (vm_ci_flag(ci) & VM_CALL_ARGS_SPLAT) -#define IS_ARGS_KEYWORD(ci) (vm_ci_flag(ci) & VM_CALL_KWARG) -#define IS_ARGS_KW_SPLAT(ci) (vm_ci_flag(ci) & VM_CALL_KW_SPLAT) -#define IS_ARGS_KW_OR_KW_SPLAT(ci) (vm_ci_flag(ci) & (VM_CALL_KWARG | VM_CALL_KW_SPLAT)) -#define IS_ARGS_KW_SPLAT_MUT(ci) (vm_ci_flag(ci) & VM_CALL_KW_SPLAT_MUT) - -static inline bool -vm_call_cacheable(const struct rb_callinfo *ci, const struct rb_callcache *cc) -{ - return (vm_ci_flag(ci) & VM_CALL_FCALL) || - METHOD_ENTRY_VISI(vm_cc_cme(cc)) != METHOD_VISI_PROTECTED; -} -/* If this returns true, an optimized function returned by `vm_call_iseq_setup_func` - can be used as a fastpath. */ -static inline bool -vm_call_iseq_optimizable_p(const struct rb_callinfo *ci, const struct rb_callcache *cc) -{ - return !IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && vm_call_cacheable(ci, cc); -} - -#endif /* RUBY_INSNHELPER_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h deleted file mode 100644 index ce47745..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef RUBY_VM_OPTS_H/*-*-c-*-*/ -#define RUBY_VM_OPTS_H -/********************************************************************** - - vm_opts.h - VM optimize option - - $Author$ - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -/* Compile options. - * You can change these options at runtime by VM::CompileOption. - * Following definitions are default values. - */ - -#define OPT_TAILCALL_OPTIMIZATION 0 -#define OPT_PEEPHOLE_OPTIMIZATION 1 -#define OPT_SPECIALISED_INSTRUCTION 1 -#define OPT_INLINE_CONST_CACHE 1 -#define OPT_FROZEN_STRING_LITERAL -1 -#define OPT_DEBUG_FROZEN_STRING_LITERAL 0 - -/* Build Options. - * You can't change these options at runtime. - */ - -/* C compiler dependent */ - -/* - * 0: direct (using labeled goto using GCC special) - * 1: token (switch/case) - * 2: call (function call for each insn dispatch) - */ -#ifndef OPT_THREADED_CODE -#define OPT_THREADED_CODE 0 -#endif - -#define OPT_DIRECT_THREADED_CODE (OPT_THREADED_CODE == 0) -#define OPT_TOKEN_THREADED_CODE (OPT_THREADED_CODE == 1) -#define OPT_CALL_THREADED_CODE (OPT_THREADED_CODE == 2) - -/* VM running option */ -#define OPT_CHECKED_RUN 1 -#define OPT_INLINE_METHOD_CACHE 1 -#define OPT_GLOBAL_METHOD_CACHE 1 - -#ifndef OPT_IC_FOR_IVAR -#define OPT_IC_FOR_IVAR 1 -#endif - -/* architecture independent, affects generated code */ -#define OPT_OPERANDS_UNIFICATION 1 -#define OPT_INSTRUCTIONS_UNIFICATION 0 -#define OPT_UNIFY_ALL_COMBINATION 0 - -/* misc */ -#ifndef OPT_SUPPORT_JOKE -#define OPT_SUPPORT_JOKE 0 -#endif - -#ifndef VM_COLLECT_USAGE_DETAILS -#define VM_COLLECT_USAGE_DETAILS 0 -#endif - -#endif /* RUBY_VM_OPTS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h deleted file mode 100644 index 4d83b5e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef RUBY_VM_SYNC_H -#define RUBY_VM_SYNC_H - -#include "vm_debug.h" -#include "debug_counter.h" - -#if USE_RUBY_DEBUG_LOG -#define LOCATION_ARGS const char *file, int line -#define LOCATION_PARAMS file, line -#define APPEND_LOCATION_ARGS , const char *file, int line -#define APPEND_LOCATION_PARAMS , file, line -#else -#define LOCATION_ARGS void -#define LOCATION_PARAMS -#define APPEND_LOCATION_ARGS -#define APPEND_LOCATION_PARAMS -#endif - -bool rb_vm_locked_p(void); -void rb_vm_lock_body(LOCATION_ARGS); -void rb_vm_unlock_body(LOCATION_ARGS); - -struct rb_ractor_struct; -void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_barrier(void); - -#if RUBY_DEBUG -// GET_VM() -#include "vm_core.h" -#endif - -RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c - -static inline bool -rb_multi_ractor_p(void) -{ - if (LIKELY(ruby_single_main_ractor)) { - // 0 on boot time. - RUBY_ASSERT(GET_VM()->ractor.cnt <= 1); - return false; - } - else { - // multi-ractor mode can run ractor.cnt == 1 - return true; - } -} - -static inline void -rb_vm_lock(const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock); - - if (rb_multi_ractor_p()) { - rb_vm_lock_body(LOCATION_PARAMS); - } -} - -static inline void -rb_vm_unlock(const char *file, int line) -{ - if (rb_multi_ractor_p()) { - rb_vm_unlock_body(LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_enter(unsigned int *lev, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock_enter); - - if (rb_multi_ractor_p()) { - rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb); - - if (rb_multi_ractor_p()) { - rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_leave(unsigned int *lev, const char *file, int line) -{ - if (rb_multi_ractor_p()) { - rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr); - rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS); -} - -static inline void -rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line) -{ - rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS); -} - -#define RB_VM_LOCKED_P() rb_vm_locked_p() - -#define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__) -#define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__) - -#define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__) -#define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__) -#define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__) -#define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__) - -#define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev); -#define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); } - -#define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__) -#define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev); -#define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV(&_lev); } - -#if RUBY_DEBUG > 0 -void RUBY_ASSERT_vm_locking(void); -void RUBY_ASSERT_vm_unlocking(void); -#define ASSERT_vm_locking() RUBY_ASSERT_vm_locking() -#define ASSERT_vm_unlocking() RUBY_ASSERT_vm_unlocking() -#else -#define ASSERT_vm_locking() -#define ASSERT_vm_unlocking() -#endif - -#endif // RUBY_VM_SYNC_H diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc deleted file mode 100644 index af9eaf3..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc +++ /dev/null @@ -1,253 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/vmtc.inc.erb" - or tool/insns2vm.rb - */ - -static const void *const insns_address_table[] = { - LABEL_PTR(nop), - LABEL_PTR(getlocal), - LABEL_PTR(setlocal), - LABEL_PTR(getblockparam), - LABEL_PTR(setblockparam), - LABEL_PTR(getblockparamproxy), - LABEL_PTR(getspecial), - LABEL_PTR(setspecial), - LABEL_PTR(getinstancevariable), - LABEL_PTR(setinstancevariable), - LABEL_PTR(getclassvariable), - LABEL_PTR(setclassvariable), - LABEL_PTR(opt_getconstant_path), - LABEL_PTR(getconstant), - LABEL_PTR(setconstant), - LABEL_PTR(getglobal), - LABEL_PTR(setglobal), - LABEL_PTR(putnil), - LABEL_PTR(putself), - LABEL_PTR(putobject), - LABEL_PTR(putspecialobject), - LABEL_PTR(putstring), - LABEL_PTR(putchilledstring), - LABEL_PTR(concatstrings), - LABEL_PTR(anytostring), - LABEL_PTR(toregexp), - LABEL_PTR(intern), - LABEL_PTR(newarray), - LABEL_PTR(newarraykwsplat), - LABEL_PTR(pushtoarraykwsplat), - LABEL_PTR(duparray), - LABEL_PTR(duphash), - LABEL_PTR(expandarray), - LABEL_PTR(concatarray), - LABEL_PTR(concattoarray), - LABEL_PTR(pushtoarray), - LABEL_PTR(splatarray), - LABEL_PTR(splatkw), - LABEL_PTR(newhash), - LABEL_PTR(newrange), - LABEL_PTR(pop), - LABEL_PTR(dup), - LABEL_PTR(dupn), - LABEL_PTR(swap), - LABEL_PTR(opt_reverse), - LABEL_PTR(topn), - LABEL_PTR(setn), - LABEL_PTR(adjuststack), - LABEL_PTR(defined), - LABEL_PTR(definedivar), - LABEL_PTR(checkmatch), - LABEL_PTR(checkkeyword), - LABEL_PTR(checktype), - LABEL_PTR(defineclass), - LABEL_PTR(definemethod), - LABEL_PTR(definesmethod), - LABEL_PTR(send), - LABEL_PTR(opt_send_without_block), - LABEL_PTR(objtostring), - LABEL_PTR(opt_str_freeze), - LABEL_PTR(opt_nil_p), - LABEL_PTR(opt_str_uminus), - LABEL_PTR(opt_newarray_send), - LABEL_PTR(invokesuper), - LABEL_PTR(invokeblock), - LABEL_PTR(leave), - LABEL_PTR(throw), - LABEL_PTR(jump), - LABEL_PTR(branchif), - LABEL_PTR(branchunless), - LABEL_PTR(branchnil), - LABEL_PTR(once), - LABEL_PTR(opt_case_dispatch), - LABEL_PTR(opt_plus), - LABEL_PTR(opt_minus), - LABEL_PTR(opt_mult), - LABEL_PTR(opt_div), - LABEL_PTR(opt_mod), - LABEL_PTR(opt_eq), - LABEL_PTR(opt_neq), - LABEL_PTR(opt_lt), - LABEL_PTR(opt_le), - LABEL_PTR(opt_gt), - LABEL_PTR(opt_ge), - LABEL_PTR(opt_ltlt), - LABEL_PTR(opt_and), - LABEL_PTR(opt_or), - LABEL_PTR(opt_aref), - LABEL_PTR(opt_aset), - LABEL_PTR(opt_aset_with), - LABEL_PTR(opt_aref_with), - LABEL_PTR(opt_length), - LABEL_PTR(opt_size), - LABEL_PTR(opt_empty_p), - LABEL_PTR(opt_succ), - LABEL_PTR(opt_not), - LABEL_PTR(opt_regexpmatch2), - LABEL_PTR(invokebuiltin), - LABEL_PTR(opt_invokebuiltin_delegate), - LABEL_PTR(opt_invokebuiltin_delegate_leave), - LABEL_PTR(getlocal_WC_0), - LABEL_PTR(getlocal_WC_1), - LABEL_PTR(setlocal_WC_0), - LABEL_PTR(setlocal_WC_1), - LABEL_PTR(putobject_INT2FIX_0_), - LABEL_PTR(putobject_INT2FIX_1_), - LABEL_PTR(trace_nop), - LABEL_PTR(trace_getlocal), - LABEL_PTR(trace_setlocal), - LABEL_PTR(trace_getblockparam), - LABEL_PTR(trace_setblockparam), - LABEL_PTR(trace_getblockparamproxy), - LABEL_PTR(trace_getspecial), - LABEL_PTR(trace_setspecial), - LABEL_PTR(trace_getinstancevariable), - LABEL_PTR(trace_setinstancevariable), - LABEL_PTR(trace_getclassvariable), - LABEL_PTR(trace_setclassvariable), - LABEL_PTR(trace_opt_getconstant_path), - LABEL_PTR(trace_getconstant), - LABEL_PTR(trace_setconstant), - LABEL_PTR(trace_getglobal), - LABEL_PTR(trace_setglobal), - LABEL_PTR(trace_putnil), - LABEL_PTR(trace_putself), - LABEL_PTR(trace_putobject), - LABEL_PTR(trace_putspecialobject), - LABEL_PTR(trace_putstring), - LABEL_PTR(trace_putchilledstring), - LABEL_PTR(trace_concatstrings), - LABEL_PTR(trace_anytostring), - LABEL_PTR(trace_toregexp), - LABEL_PTR(trace_intern), - LABEL_PTR(trace_newarray), - LABEL_PTR(trace_newarraykwsplat), - LABEL_PTR(trace_pushtoarraykwsplat), - LABEL_PTR(trace_duparray), - LABEL_PTR(trace_duphash), - LABEL_PTR(trace_expandarray), - LABEL_PTR(trace_concatarray), - LABEL_PTR(trace_concattoarray), - LABEL_PTR(trace_pushtoarray), - LABEL_PTR(trace_splatarray), - LABEL_PTR(trace_splatkw), - LABEL_PTR(trace_newhash), - LABEL_PTR(trace_newrange), - LABEL_PTR(trace_pop), - LABEL_PTR(trace_dup), - LABEL_PTR(trace_dupn), - LABEL_PTR(trace_swap), - LABEL_PTR(trace_opt_reverse), - LABEL_PTR(trace_topn), - LABEL_PTR(trace_setn), - LABEL_PTR(trace_adjuststack), - LABEL_PTR(trace_defined), - LABEL_PTR(trace_definedivar), - LABEL_PTR(trace_checkmatch), - LABEL_PTR(trace_checkkeyword), - LABEL_PTR(trace_checktype), - LABEL_PTR(trace_defineclass), - LABEL_PTR(trace_definemethod), - LABEL_PTR(trace_definesmethod), - LABEL_PTR(trace_send), - LABEL_PTR(trace_opt_send_without_block), - LABEL_PTR(trace_objtostring), - LABEL_PTR(trace_opt_str_freeze), - LABEL_PTR(trace_opt_nil_p), - LABEL_PTR(trace_opt_str_uminus), - LABEL_PTR(trace_opt_newarray_send), - LABEL_PTR(trace_invokesuper), - LABEL_PTR(trace_invokeblock), - LABEL_PTR(trace_leave), - LABEL_PTR(trace_throw), - LABEL_PTR(trace_jump), - LABEL_PTR(trace_branchif), - LABEL_PTR(trace_branchunless), - LABEL_PTR(trace_branchnil), - LABEL_PTR(trace_once), - LABEL_PTR(trace_opt_case_dispatch), - LABEL_PTR(trace_opt_plus), - LABEL_PTR(trace_opt_minus), - LABEL_PTR(trace_opt_mult), - LABEL_PTR(trace_opt_div), - LABEL_PTR(trace_opt_mod), - LABEL_PTR(trace_opt_eq), - LABEL_PTR(trace_opt_neq), - LABEL_PTR(trace_opt_lt), - LABEL_PTR(trace_opt_le), - LABEL_PTR(trace_opt_gt), - LABEL_PTR(trace_opt_ge), - LABEL_PTR(trace_opt_ltlt), - LABEL_PTR(trace_opt_and), - LABEL_PTR(trace_opt_or), - LABEL_PTR(trace_opt_aref), - LABEL_PTR(trace_opt_aset), - LABEL_PTR(trace_opt_aset_with), - LABEL_PTR(trace_opt_aref_with), - LABEL_PTR(trace_opt_length), - LABEL_PTR(trace_opt_size), - LABEL_PTR(trace_opt_empty_p), - LABEL_PTR(trace_opt_succ), - LABEL_PTR(trace_opt_not), - LABEL_PTR(trace_opt_regexpmatch2), - LABEL_PTR(trace_invokebuiltin), - LABEL_PTR(trace_opt_invokebuiltin_delegate), - LABEL_PTR(trace_opt_invokebuiltin_delegate_leave), - LABEL_PTR(trace_getlocal_WC_0), - LABEL_PTR(trace_getlocal_WC_1), - LABEL_PTR(trace_setlocal_WC_0), - LABEL_PTR(trace_setlocal_WC_1), - LABEL_PTR(trace_putobject_INT2FIX_0_), - LABEL_PTR(trace_putobject_INT2FIX_1_), -}; - -ASSERT_VM_INSTRUCTION_SIZE(insns_address_table); diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h deleted file mode 100644 index 5d1de2d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef YJIT_H -#define YJIT_H 1 -// -// This file contains definitions YJIT exposes to the CRuby codebase -// - -#include "ruby/internal/config.h" -#include "ruby_assert.h" // for RUBY_DEBUG -#include "vm_core.h" -#include "method.h" - -// YJIT_STATS controls whether to support runtime counters in generated code -// and in the interpreter. -#ifndef YJIT_STATS -# define YJIT_STATS RUBY_DEBUG -#endif - -#if USE_YJIT - -// We generate x86 or arm64 assembly -#if defined(_WIN32) ? defined(_M_AMD64) : (defined(__x86_64__) || defined(__aarch64__)) -// x86_64 platforms without mingw/msys or x64-mswin -#else -# error YJIT unsupported platform -#endif - -// Expose these as declarations since we are building YJIT. -extern uint64_t rb_yjit_call_threshold; -extern uint64_t rb_yjit_cold_threshold; -extern uint64_t rb_yjit_live_iseq_count; -extern uint64_t rb_yjit_iseq_alloc_count; -extern bool rb_yjit_enabled_p; -void rb_yjit_incr_counter(const char *counter_name); -void rb_yjit_invalidate_all_method_lookup_assumptions(void); -void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme); -void rb_yjit_collect_binding_alloc(void); -void rb_yjit_collect_binding_set(void); -void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception); -void rb_yjit_init(bool yjit_enabled); -void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -void rb_yjit_constant_state_changed(ID id); -void rb_yjit_iseq_mark(void *payload); -void rb_yjit_iseq_update_references(const rb_iseq_t *iseq); -void rb_yjit_iseq_free(const rb_iseq_t *iseq); -void rb_yjit_before_ractor_spawn(void); -void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); -void rb_yjit_tracing_invalidate_all(void); -void rb_yjit_show_usage(int help, int highlight, unsigned int width, int columns); -void rb_yjit_lazy_push_frame(const VALUE *pc); -void rb_yjit_invalidate_no_singleton_class(VALUE klass); -void rb_yjit_invalidate_ep_is_bp(const rb_iseq_t *iseq); - -#else -// !USE_YJIT -// In these builds, YJIT could never be turned on. Provide dummy implementations. - -#define rb_yjit_enabled_p false -static inline void rb_yjit_incr_counter(const char *counter_name) {} -static inline void rb_yjit_invalidate_all_method_lookup_assumptions(void) {} -static inline void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme) {} -static inline void rb_yjit_collect_binding_alloc(void) {} -static inline void rb_yjit_collect_binding_set(void) {} -static inline void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception) {} -static inline void rb_yjit_init(bool yjit_enabled) {} -static inline void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} -static inline void rb_yjit_constant_state_changed(ID id) {} -static inline void rb_yjit_iseq_mark(void *payload) {} -static inline void rb_yjit_iseq_update_references(const rb_iseq_t *iseq) {} -static inline void rb_yjit_iseq_free(const rb_iseq_t *iseq) {} -static inline void rb_yjit_before_ractor_spawn(void) {} -static inline void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {} -static inline void rb_yjit_tracing_invalidate_all(void) {} -static inline void rb_yjit_lazy_push_frame(const VALUE *pc) {} -static inline void rb_yjit_invalidate_no_singleton_class(VALUE klass) {} -static inline void rb_yjit_invalidate_ep_is_bp(const rb_iseq_t *iseq) {} - -#endif // #if USE_YJIT - -#endif // #ifndef YJIT_H diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/addr2line.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/addr2line.h deleted file mode 100644 index ff8e476..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/addr2line.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RUBY_ADDR2LINE_H -#define RUBY_ADDR2LINE_H -/********************************************************************** - - addr2line.h - - - $Author$ - - Copyright (C) 2010 Shinichiro Hamaji - -**********************************************************************/ - -#if (defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H)) - -#include - -void -rb_dump_backtrace_with_lines(int num_traces, void **traces, FILE *errout); - -#endif /* USE_ELF */ - -#endif /* RUBY_ADDR2LINE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/builtin.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/builtin.h deleted file mode 100644 index 24aa7c2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/builtin.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef BUILTIN_H_INCLUDED -#define BUILTIN_H_INCLUDED - -// invoke - -struct rb_builtin_function { - // for invocation - const void * const func_ptr; - const int argc; - - // for load - const int index; - const char * const name; -}; - -#define RB_BUILTIN_FUNCTION(_i, _name, _fname, _arity) {\ - .name = _i < 0 ? NULL : #_name, \ - .func_ptr = (void *)_fname, \ - .argc = _arity, \ - .index = _i, \ -} - -void rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table); - -#ifndef rb_execution_context_t -typedef struct rb_execution_context_struct rb_execution_context_t; -#define rb_execution_context_t rb_execution_context_t -#endif - -/* The following code is generated by the following Ruby script: - -typedef = proc {|i, args| - "typedef VALUE (*rb_builtin_arity#{i}_function_type)(rb_execution_context_t *ec, VALUE self#{args});" -} -puts typedef[0, ""] -(1..15).each {|i| - puts typedef[i, ",\n " + (0...i).map{"VALUE"}.join(", ")] -} -16.times{|i| - puts "static inline void rb_builtin_function_check_arity#{i}(rb_builtin_arity#{i}_function_type f){}" -} -*/ - -typedef VALUE (*rb_builtin_arity0_function_type)(rb_execution_context_t *ec, VALUE self); -typedef VALUE (*rb_builtin_arity1_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE); -typedef VALUE (*rb_builtin_arity2_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE); -typedef VALUE (*rb_builtin_arity3_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity4_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity5_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity6_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity7_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity8_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity9_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity10_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity11_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity12_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity13_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity14_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -typedef VALUE (*rb_builtin_arity15_function_type)(rb_execution_context_t *ec, VALUE self, - VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); -static inline void rb_builtin_function_check_arity0(rb_builtin_arity0_function_type f){} -static inline void rb_builtin_function_check_arity1(rb_builtin_arity1_function_type f){} -static inline void rb_builtin_function_check_arity2(rb_builtin_arity2_function_type f){} -static inline void rb_builtin_function_check_arity3(rb_builtin_arity3_function_type f){} -static inline void rb_builtin_function_check_arity4(rb_builtin_arity4_function_type f){} -static inline void rb_builtin_function_check_arity5(rb_builtin_arity5_function_type f){} -static inline void rb_builtin_function_check_arity6(rb_builtin_arity6_function_type f){} -static inline void rb_builtin_function_check_arity7(rb_builtin_arity7_function_type f){} -static inline void rb_builtin_function_check_arity8(rb_builtin_arity8_function_type f){} -static inline void rb_builtin_function_check_arity9(rb_builtin_arity9_function_type f){} -static inline void rb_builtin_function_check_arity10(rb_builtin_arity10_function_type f){} -static inline void rb_builtin_function_check_arity11(rb_builtin_arity11_function_type f){} -static inline void rb_builtin_function_check_arity12(rb_builtin_arity12_function_type f){} -static inline void rb_builtin_function_check_arity13(rb_builtin_arity13_function_type f){} -static inline void rb_builtin_function_check_arity14(rb_builtin_arity14_function_type f){} -static inline void rb_builtin_function_check_arity15(rb_builtin_arity15_function_type f){} - -PUREFUNC(VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index)); -VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index); - -// __builtin_inline! - -PUREFUNC(static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index)); - -static inline VALUE -rb_vm_lvar(rb_execution_context_t *ec, int index) -{ -#if defined(VM_CORE_H_EC_DEFINED) && VM_CORE_H_EC_DEFINED - return ec->cfp->ep[index]; -#else - return rb_vm_lvar_exposed(ec, index); -#endif -} - -#define LOCAL_PTR(local) local ## __ptr - -// dump/load - -struct builtin_binary { - const char *feature; // feature name - const unsigned char *bin; // binary by ISeq#to_binary - size_t bin_size; -}; - -#endif // BUILTIN_H_INCLUDED diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h deleted file mode 100644 index b846849..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h +++ /dev/null @@ -1,40 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_BUILD_ASSERT_H -#define CCAN_BUILD_ASSERT_H - -/** - * CCAN_BUILD_ASSERT - assert a build-time dependency. - * @cond: the compile-time condition which must be true. - * - * Your compile will fail if the condition isn't true, or can't be evaluated - * by the compiler. This can only be used within a function. - * - * Example: - * #include - * ... - * static char *foo_to_char(struct foo *foo) - * { - * // This code needs string to be at start of foo. - * CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0); - * return (char *)foo; - * } - */ -#define CCAN_BUILD_ASSERT(cond) \ - do { (void) sizeof(char [1 - 2*!(cond)]); } while(0) - -/** - * CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression. - * @cond: the compile-time condition which must be true. - * - * Your compile will fail if the condition isn't true, or can't be evaluated - * by the compiler. This can be used in an expression: its value is "0". - * - * Example: - * #define foo_to_char(foo) \ - * ((char *)(foo) \ - * + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0)) - */ -#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \ - (sizeof(char [1 - 2*!(cond)]) - 1) - -#endif /* CCAN_BUILD_ASSERT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h deleted file mode 100644 index 659e1a5..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h +++ /dev/null @@ -1,63 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_CHECK_TYPE_H -#define CCAN_CHECK_TYPE_H - -/** - * ccan_check_type - issue a warning or build failure if type is not correct. - * @expr: the expression whose type we should check (not evaluated). - * @type: the exact type we expect the expression to be. - * - * This macro is usually used within other macros to try to ensure that a macro - * argument is of the expected type. No type promotion of the expression is - * done: an unsigned int is not the same as an int! - * - * ccan_check_type() always evaluates to 0. - * - * If your compiler does not support typeof, then the best we can do is fail - * to compile if the sizes of the types are unequal (a less complete check). - * - * Example: - * // They should always pass a 64-bit value to _set_some_value! - * #define set_some_value(expr) \ - * _set_some_value((ccan_check_type((expr), uint64_t), (expr))) - */ - -/** - * ccan_check_types_match - issue a warning or build failure if types are not same. - * @expr1: the first expression (not evaluated). - * @expr2: the second expression (not evaluated). - * - * This macro is usually used within other macros to try to ensure that - * arguments are of identical types. No type promotion of the expressions is - * done: an unsigned int is not the same as an int! - * - * ccan_check_types_match() always evaluates to 0. - * - * If your compiler does not support typeof, then the best we can do is fail - * to compile if the sizes of the types are unequal (a less complete check). - * - * Example: - * // Do subtraction to get to enclosing type, but make sure that - * // pointer is of correct type for that member. - * #define ccan_container_of(mbr_ptr, encl_type, mbr) \ - * (ccan_check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \ - * ((encl_type *) \ - * ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr)))) - */ -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_check_type(expr, type) \ - ((typeof(expr) *)0 != (type *)0) - -#define ccan_check_types_match(expr1, expr2) \ - ((typeof(expr1) *)0 != (typeof(expr2) *)0) -#else -#include "ccan/build_assert/build_assert.h" -/* Without typeof, we can only test the sizes. */ -#define ccan_check_type(expr, type) \ - CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type)) - -#define ccan_check_types_match(expr1, expr2) \ - CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2)) -#endif /* HAVE_TYPEOF */ - -#endif /* CCAN_CHECK_TYPE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h deleted file mode 100644 index 872bb6e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h +++ /dev/null @@ -1,142 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_CONTAINER_OF_H -#define CCAN_CONTAINER_OF_H -#include "ccan/check_type/check_type.h" - -/** - * ccan_container_of - get pointer to enclosing structure - * @member_ptr: pointer to the structure member - * @containing_type: the type this member is within - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does pointer - * subtraction to return the pointer to the enclosing type. - * - * Example: - * struct foo { - * int fielda, fieldb; - * // ... - * }; - * struct info { - * int some_other_field; - * struct foo my_foo; - * }; - * - * static struct info *foo_to_info(struct foo *foo) - * { - * return ccan_container_of(foo, struct info, my_foo); - * } - */ -#define ccan_container_of(member_ptr, containing_type, member) \ - ((containing_type *) \ - ((char *)(member_ptr) \ - - ccan_container_off(containing_type, member)) \ - + ccan_check_types_match(*(member_ptr), ((containing_type *)0)->member)) - - -/** - * ccan_container_of_or_null - get pointer to enclosing structure, or NULL - * @member_ptr: pointer to the structure member - * @containing_type: the type this member is within - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does pointer - * subtraction to return the pointer to the enclosing type, unless it - * is given NULL, in which case it also returns NULL. - * - * Example: - * struct foo { - * int fielda, fieldb; - * // ... - * }; - * struct info { - * int some_other_field; - * struct foo my_foo; - * }; - * - * static struct info *foo_to_info_allowing_null(struct foo *foo) - * { - * return ccan_container_of_or_null(foo, struct info, my_foo); - * } - */ -static inline char *container_of_or_null_(void *member_ptr, size_t offset) -{ - return member_ptr ? (char *)member_ptr - offset : NULL; -} -#define ccan_container_of_or_null(member_ptr, containing_type, member) \ - ((containing_type *) \ - ccan_container_of_or_null_(member_ptr, \ - ccan_container_off(containing_type, member)) \ - + ccan_check_types_match(*(member_ptr), ((containing_type *)0)->member)) - -/** - * ccan_container_off - get offset to enclosing structure - * @containing_type: the type this member is within - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does - * typechecking and figures out the offset to the enclosing type. - * - * Example: - * struct foo { - * int fielda, fieldb; - * // ... - * }; - * struct info { - * int some_other_field; - * struct foo my_foo; - * }; - * - * static struct info *foo_to_info(struct foo *foo) - * { - * size_t off = ccan_container_off(struct info, my_foo); - * return (void *)((char *)foo - off); - * } - */ -#define ccan_container_off(containing_type, member) \ - offsetof(containing_type, member) - -/** - * ccan_container_of_var - get pointer to enclosing structure using a variable - * @member_ptr: pointer to the structure member - * @container_var: a pointer of same type as this member's container - * @member: the name of this member within the structure. - * - * Given a pointer to a member of a structure, this macro does pointer - * subtraction to return the pointer to the enclosing type. - * - * Example: - * static struct info *foo_to_i(struct foo *foo) - * { - * struct info *i = ccan_container_of_var(foo, i, my_foo); - * return i; - * } - */ -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_container_of_var(member_ptr, container_var, member) \ - ccan_container_of(member_ptr, typeof(*container_var), member) -#else -#define ccan_container_of_var(member_ptr, container_var, member) \ - ((void *)((char *)(member_ptr) - \ - ccan_container_off_var(container_var, member))) -#endif - -/** - * ccan_container_off_var - get offset of a field in enclosing structure - * @container_var: a pointer to a container structure - * @member: the name of a member within the structure. - * - * Given (any) pointer to a structure and a its member name, this - * macro does pointer subtraction to return offset of member in a - * structure memory layout. - * - */ -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_container_off_var(var, member) \ - ccan_container_off(typeof(*var), member) -#else -#define ccan_container_off_var(var, member) \ - ((const char *)&(var)->member - (const char *)(var)) -#endif - -#endif /* CCAN_CONTAINER_OF_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h deleted file mode 100644 index bf692a6..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h +++ /dev/null @@ -1,791 +0,0 @@ -/* Licensed under BSD-MIT - see ccan/licenses/BSD-MIT file for details */ -#ifndef CCAN_LIST_H -#define CCAN_LIST_H -#include -#include "ccan/str/str.h" -#include "ccan/container_of/container_of.h" -#include "ccan/check_type/check_type.h" - -/** - * struct ccan_list_node - an entry in a doubly-linked list - * @next: next entry (self if empty) - * @prev: previous entry (self if empty) - * - * This is used as an entry in a linked list. - * Example: - * struct child { - * const char *name; - * // Linked list of all us children. - * struct ccan_list_node list; - * }; - */ -struct ccan_list_node -{ - struct ccan_list_node *next, *prev; -}; - -/** - * struct ccan_list_head - the head of a doubly-linked list - * @h: the ccan_list_head (containing next and prev pointers) - * - * This is used as the head of a linked list. - * Example: - * struct parent { - * const char *name; - * struct ccan_list_head children; - * unsigned int num_children; - * }; - */ -struct ccan_list_head -{ - struct ccan_list_node n; -}; - -#define CCAN_LIST_LOC __FILE__ ":" ccan_stringify(__LINE__) -#define ccan_list_debug(h, loc) ((void)loc, h) -#define ccan_list_debug_node(n, loc) ((void)loc, n) - -/** - * CCAN_LIST_HEAD_INIT - initializer for an empty ccan_list_head - * @name: the name of the list. - * - * Explicit initializer for an empty list. - * - * See also: - * CCAN_LIST_HEAD, ccan_list_head_init() - * - * Example: - * static struct ccan_list_head my_list = CCAN_LIST_HEAD_INIT(my_list); - */ -#define CCAN_LIST_HEAD_INIT(name) { { &(name).n, &(name).n } } - -/** - * CCAN_LIST_HEAD - define and initialize an empty ccan_list_head - * @name: the name of the list. - * - * The CCAN_LIST_HEAD macro defines a ccan_list_head and initializes it to an empty - * list. It can be prepended by "static" to define a static ccan_list_head. - * - * See also: - * CCAN_LIST_HEAD_INIT, ccan_list_head_init() - * - * Example: - * static CCAN_LIST_HEAD(my_global_list); - */ -#define CCAN_LIST_HEAD(name) \ - struct ccan_list_head name = CCAN_LIST_HEAD_INIT(name) - -/** - * ccan_list_head_init - initialize a ccan_list_head - * @h: the ccan_list_head to set to the empty list - * - * Example: - * ... - * struct parent *parent = malloc(sizeof(*parent)); - * - * ccan_list_head_init(&parent->children); - * parent->num_children = 0; - */ -static inline void ccan_list_head_init(struct ccan_list_head *h) -{ - h->n.next = h->n.prev = &h->n; -} - -/** - * ccan_list_node_init - initialize a ccan_list_node - * @n: the ccan_list_node to link to itself. - * - * You don't need to use this normally! But it lets you ccan_list_del(@n) - * safely. - */ -static inline void ccan_list_node_init(struct ccan_list_node *n) -{ - n->next = n->prev = n; -} - -/** - * ccan_list_add_after - add an entry after an existing node in a linked list - * @h: the ccan_list_head to add the node to (for debugging) - * @p: the existing ccan_list_node to add the node after - * @n: the new ccan_list_node to add to the list. - * - * The existing ccan_list_node must already be a member of the list. - * The new ccan_list_node does not need to be initialized; it will be overwritten. - * - * Example: - * struct child c1, c2, c3; - * CCAN_LIST_HEAD(h); - * - * ccan_list_add_tail(&h, &c1.list); - * ccan_list_add_tail(&h, &c3.list); - * ccan_list_add_after(&h, &c1.list, &c2.list); - */ -#define ccan_list_add_after(h, p, n) ccan_list_add_after_(h, p, n, CCAN_LIST_LOC) -static inline void ccan_list_add_after_(struct ccan_list_head *h, - struct ccan_list_node *p, - struct ccan_list_node *n, - const char *abortstr) -{ - n->next = p->next; - n->prev = p; - p->next->prev = n; - p->next = n; - (void)ccan_list_debug(h, abortstr); -} - -/** - * ccan_list_add - add an entry at the start of a linked list. - * @h: the ccan_list_head to add the node to - * @n: the ccan_list_node to add to the list. - * - * The ccan_list_node does not need to be initialized; it will be overwritten. - * Example: - * struct child *child = malloc(sizeof(*child)); - * - * child->name = "marvin"; - * ccan_list_add(&parent->children, &child->list); - * parent->num_children++; - */ -#define ccan_list_add(h, n) ccan_list_add_(h, n, CCAN_LIST_LOC) -static inline void ccan_list_add_(struct ccan_list_head *h, - struct ccan_list_node *n, - const char *abortstr) -{ - ccan_list_add_after_(h, &h->n, n, abortstr); -} - -/** - * ccan_list_add_before - add an entry before an existing node in a linked list - * @h: the ccan_list_head to add the node to (for debugging) - * @p: the existing ccan_list_node to add the node before - * @n: the new ccan_list_node to add to the list. - * - * The existing ccan_list_node must already be a member of the list. - * The new ccan_list_node does not need to be initialized; it will be overwritten. - * - * Example: - * ccan_list_head_init(&h); - * ccan_list_add_tail(&h, &c1.list); - * ccan_list_add_tail(&h, &c3.list); - * ccan_list_add_before(&h, &c3.list, &c2.list); - */ -#define ccan_list_add_before(h, p, n) ccan_list_add_before_(h, p, n, CCAN_LIST_LOC) -static inline void ccan_list_add_before_(struct ccan_list_head *h, - struct ccan_list_node *p, - struct ccan_list_node *n, - const char *abortstr) -{ - n->next = p; - n->prev = p->prev; - p->prev->next = n; - p->prev = n; - (void)ccan_list_debug(h, abortstr); -} - -/** - * ccan_list_add_tail - add an entry at the end of a linked list. - * @h: the ccan_list_head to add the node to - * @n: the ccan_list_node to add to the list. - * - * The ccan_list_node does not need to be initialized; it will be overwritten. - * Example: - * ccan_list_add_tail(&parent->children, &child->list); - * parent->num_children++; - */ -#define ccan_list_add_tail(h, n) ccan_list_add_tail_(h, n, CCAN_LIST_LOC) -static inline void ccan_list_add_tail_(struct ccan_list_head *h, - struct ccan_list_node *n, - const char *abortstr) -{ - ccan_list_add_before_(h, &h->n, n, abortstr); -} - -/** - * ccan_list_empty - is a list empty? - * @h: the ccan_list_head - * - * If the list is empty, returns true. - * - * Example: - * assert(ccan_list_empty(&parent->children) == (parent->num_children == 0)); - */ -#define ccan_list_empty(h) ccan_list_empty_(h, CCAN_LIST_LOC) -static inline int ccan_list_empty_(const struct ccan_list_head *h, const char* abortstr) -{ - (void)ccan_list_debug(h, abortstr); - return h->n.next == &h->n; -} - -/** - * ccan_list_empty_nodebug - is a list empty (and don't perform debug checks)? - * @h: the ccan_list_head - * - * If the list is empty, returns true. - * This differs from list_empty() in that if CCAN_LIST_DEBUG is set it - * will NOT perform debug checks. Only use this function if you REALLY - * know what you're doing. - * - * Example: - * assert(ccan_list_empty_nodebug(&parent->children) == (parent->num_children == 0)); - */ -#ifndef CCAN_LIST_DEBUG -#define ccan_list_empty_nodebug(h) ccan_list_empty(h) -#else -static inline int ccan_list_empty_nodebug(const struct ccan_list_head *h) -{ - return h->n.next == &h->n; -} -#endif - -/** - * ccan_list_empty_nocheck - is a list empty? - * @h: the ccan_list_head - * - * If the list is empty, returns true. This doesn't perform any - * debug check for list consistency, so it can be called without - * locks, racing with the list being modified. This is ok for - * checks where an incorrect result is not an issue (optimized - * bail out path for example). - */ -static inline bool ccan_list_empty_nocheck(const struct ccan_list_head *h) -{ - return h->n.next == &h->n; -} - -/** - * ccan_list_del - delete an entry from an (unknown) linked list. - * @n: the ccan_list_node to delete from the list. - * - * Note that this leaves @n in an undefined state; it can be added to - * another list, but not deleted again. - * - * See also: - * ccan_list_del_from(), ccan_list_del_init() - * - * Example: - * ccan_list_del(&child->list); - * parent->num_children--; - */ -#define ccan_list_del(n) ccan_list_del_(n, CCAN_LIST_LOC) -static inline void ccan_list_del_(struct ccan_list_node *n, const char* abortstr) -{ - (void)ccan_list_debug_node(n, abortstr); - n->next->prev = n->prev; - n->prev->next = n->next; -#ifdef CCAN_LIST_DEBUG - /* Catch use-after-del. */ - n->next = n->prev = NULL; -#endif -} - -/** - * ccan_list_del_init - delete a node, and reset it so it can be deleted again. - * @n: the ccan_list_node to be deleted. - * - * ccan_list_del(@n) or ccan_list_del_init() again after this will be safe, - * which can be useful in some cases. - * - * See also: - * ccan_list_del_from(), ccan_list_del() - * - * Example: - * ccan_list_del_init(&child->list); - * parent->num_children--; - */ -#define ccan_list_del_init(n) ccan_list_del_init_(n, CCAN_LIST_LOC) -static inline void ccan_list_del_init_(struct ccan_list_node *n, const char *abortstr) -{ - ccan_list_del_(n, abortstr); - ccan_list_node_init(n); -} - -/** - * ccan_list_del_from - delete an entry from a known linked list. - * @h: the ccan_list_head the node is in. - * @n: the ccan_list_node to delete from the list. - * - * This explicitly indicates which list a node is expected to be in, - * which is better documentation and can catch more bugs. - * - * See also: ccan_list_del() - * - * Example: - * ccan_list_del_from(&parent->children, &child->list); - * parent->num_children--; - */ -static inline void ccan_list_del_from(struct ccan_list_head *h, struct ccan_list_node *n) -{ -#ifdef CCAN_LIST_DEBUG - { - /* Thorough check: make sure it was in list! */ - struct ccan_list_node *i; - for (i = h->n.next; i != n; i = i->next) - assert(i != &h->n); - } -#endif /* CCAN_LIST_DEBUG */ - - /* Quick test that catches a surprising number of bugs. */ - assert(!ccan_list_empty(h)); - ccan_list_del(n); -} - -/** - * ccan_list_swap - swap out an entry from an (unknown) linked list for a new one. - * @o: the ccan_list_node to replace from the list. - * @n: the ccan_list_node to insert in place of the old one. - * - * Note that this leaves @o in an undefined state; it can be added to - * another list, but not deleted/swapped again. - * - * See also: - * ccan_list_del() - * - * Example: - * struct child x1, x2; - * CCAN_LIST_HEAD(xh); - * - * ccan_list_add(&xh, &x1.list); - * ccan_list_swap(&x1.list, &x2.list); - */ -#define ccan_list_swap(o, n) ccan_list_swap_(o, n, CCAN_LIST_LOC) -static inline void ccan_list_swap_(struct ccan_list_node *o, - struct ccan_list_node *n, - const char* abortstr) -{ - (void)ccan_list_debug_node(o, abortstr); - *n = *o; - n->next->prev = n; - n->prev->next = n; -#ifdef CCAN_LIST_DEBUG - /* Catch use-after-del. */ - o->next = o->prev = NULL; -#endif -} - -/** - * ccan_list_entry - convert a ccan_list_node back into the structure containing it. - * @n: the ccan_list_node - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * Example: - * // First list entry is children.next; convert back to child. - * child = ccan_list_entry(parent->children.n.next, struct child, list); - * - * See Also: - * ccan_list_top(), ccan_list_for_each() - */ -#define ccan_list_entry(n, type, member) ccan_container_of(n, type, member) - -/** - * ccan_list_top - get the first entry in a list - * @h: the ccan_list_head - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * If the list is empty, returns NULL. - * - * Example: - * struct child *first; - * first = ccan_list_top(&parent->children, struct child, list); - * if (!first) - * printf("Empty list!\n"); - */ -#define ccan_list_top(h, type, member) \ - ((type *)ccan_list_top_((h), ccan_list_off_(type, member))) - -static inline const void *ccan_list_top_(const struct ccan_list_head *h, size_t off) -{ - if (ccan_list_empty(h)) - return NULL; - return (const char *)h->n.next - off; -} - -/** - * ccan_list_pop - remove the first entry in a list - * @h: the ccan_list_head - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * If the list is empty, returns NULL. - * - * Example: - * struct child *one; - * one = ccan_list_pop(&parent->children, struct child, list); - * if (!one) - * printf("Empty list!\n"); - */ -#define ccan_list_pop(h, type, member) \ - ((type *)ccan_list_pop_((h), ccan_list_off_(type, member))) - -static inline const void *ccan_list_pop_(const struct ccan_list_head *h, size_t off) -{ - struct ccan_list_node *n; - - if (ccan_list_empty(h)) - return NULL; - n = h->n.next; - ccan_list_del(n); - return (const char *)n - off; -} - -/** - * ccan_list_tail - get the last entry in a list - * @h: the ccan_list_head - * @type: the type of the entry - * @member: the ccan_list_node member of the type - * - * If the list is empty, returns NULL. - * - * Example: - * struct child *last; - * last = ccan_list_tail(&parent->children, struct child, list); - * if (!last) - * printf("Empty list!\n"); - */ -#define ccan_list_tail(h, type, member) \ - ((type *)ccan_list_tail_((h), ccan_list_off_(type, member))) - -static inline const void *ccan_list_tail_(const struct ccan_list_head *h, size_t off) -{ - if (ccan_list_empty(h)) - return NULL; - return (const char *)h->n.prev - off; -} - -/** - * ccan_list_for_each - iterate through a list. - * @h: the ccan_list_head (warning: evaluated multiple times!) - * @i: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list. It's - * a for loop, so you can break and continue as normal. - * - * Example: - * ccan_list_for_each(&parent->children, child, list) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each(h, i, member) \ - ccan_list_for_each_off(h, i, ccan_list_off_var_(i, member)) - -/** - * ccan_list_for_each_rev - iterate through a list backwards. - * @h: the ccan_list_head - * @i: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list. It's - * a for loop, so you can break and continue as normal. - * - * Example: - * ccan_list_for_each_rev(&parent->children, child, list) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_rev(h, i, member) \ - ccan_list_for_each_rev_off(h, i, ccan_list_off_var_(i, member)) - -/** - * ccan_list_for_each_rev_safe - iterate through a list backwards, - * maybe during deletion - * @h: the ccan_list_head - * @i: the structure containing the ccan_list_node - * @nxt: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list backwards. - * It's a for loop, so you can break and continue as normal. The extra - * variable * @nxt is used to hold the next element, so you can delete @i - * from the list. - * - * Example: - * struct child *next; - * ccan_list_for_each_rev_safe(&parent->children, child, next, list) { - * printf("Name: %s\n", child->name); - * } - */ -#define ccan_list_for_each_rev_safe(h, i, nxt, member) \ - ccan_list_for_each_rev_safe_off(h, i, nxt, ccan_list_off_var_(i, member)) - -/** - * ccan_list_for_each_safe - iterate through a list, maybe during deletion - * @h: the ccan_list_head - * @i: the structure containing the ccan_list_node - * @nxt: the structure containing the ccan_list_node - * @member: the ccan_list_node member of the structure - * - * This is a convenient wrapper to iterate @i over the entire list. It's - * a for loop, so you can break and continue as normal. The extra variable - * @nxt is used to hold the next element, so you can delete @i from the list. - * - * Example: - * ccan_list_for_each_safe(&parent->children, child, next, list) { - * ccan_list_del(&child->list); - * parent->num_children--; - * } - */ -#define ccan_list_for_each_safe(h, i, nxt, member) \ - ccan_list_for_each_safe_off(h, i, nxt, ccan_list_off_var_(i, member)) - -/** - * ccan_list_next - get the next entry in a list - * @h: the ccan_list_head - * @i: a pointer to an entry in the list. - * @member: the ccan_list_node member of the structure - * - * If @i was the last entry in the list, returns NULL. - * - * Example: - * struct child *second; - * second = ccan_list_next(&parent->children, first, list); - * if (!second) - * printf("No second child!\n"); - */ -#define ccan_list_next(h, i, member) \ - ((ccan_list_typeof(i))ccan_list_entry_or_null(ccan_list_debug(h, \ - __FILE__ ":" ccan_stringify(__LINE__)), \ - (i)->member.next, \ - ccan_list_off_var_((i), member))) - -/** - * ccan_list_prev - get the previous entry in a list - * @h: the ccan_list_head - * @i: a pointer to an entry in the list. - * @member: the ccan_list_node member of the structure - * - * If @i was the first entry in the list, returns NULL. - * - * Example: - * first = ccan_list_prev(&parent->children, second, list); - * if (!first) - * printf("Can't go back to first child?!\n"); - */ -#define ccan_list_prev(h, i, member) \ - ((ccan_list_typeof(i))ccan_list_entry_or_null(ccan_list_debug(h, \ - __FILE__ ":" ccan_stringify(__LINE__)), \ - (i)->member.prev, \ - ccan_list_off_var_((i), member))) - -/** - * ccan_list_append_list - empty one list onto the end of another. - * @to: the list to append into - * @from: the list to empty. - * - * This takes the entire contents of @from and moves it to the end of - * @to. After this @from will be empty. - * - * Example: - * struct ccan_list_head adopter; - * - * ccan_list_append_list(&adopter, &parent->children); - * assert(ccan_list_empty(&parent->children)); - * parent->num_children = 0; - */ -#define ccan_list_append_list(t, f) ccan_list_append_list_(t, f, \ - __FILE__ ":" ccan_stringify(__LINE__)) -static inline void ccan_list_append_list_(struct ccan_list_head *to, - struct ccan_list_head *from, - const char *abortstr) -{ - struct ccan_list_node *from_tail = ccan_list_debug(from, abortstr)->n.prev; - struct ccan_list_node *to_tail = ccan_list_debug(to, abortstr)->n.prev; - - /* Sew in head and entire list. */ - to->n.prev = from_tail; - from_tail->next = &to->n; - to_tail->next = &from->n; - from->n.prev = to_tail; - - /* Now remove head. */ - ccan_list_del(&from->n); - ccan_list_head_init(from); -} - -/** - * ccan_list_prepend_list - empty one list into the start of another. - * @to: the list to prepend into - * @from: the list to empty. - * - * This takes the entire contents of @from and moves it to the start - * of @to. After this @from will be empty. - * - * Example: - * ccan_list_prepend_list(&adopter, &parent->children); - * assert(ccan_list_empty(&parent->children)); - * parent->num_children = 0; - */ -#define ccan_list_prepend_list(t, f) ccan_list_prepend_list_(t, f, CCAN_LIST_LOC) -static inline void ccan_list_prepend_list_(struct ccan_list_head *to, - struct ccan_list_head *from, - const char *abortstr) -{ - struct ccan_list_node *from_tail = ccan_list_debug(from, abortstr)->n.prev; - struct ccan_list_node *to_head = ccan_list_debug(to, abortstr)->n.next; - - /* Sew in head and entire list. */ - to->n.next = &from->n; - from->n.prev = &to->n; - to_head->prev = from_tail; - from_tail->next = to_head; - - /* Now remove head. */ - ccan_list_del(&from->n); - ccan_list_head_init(from); -} - -/* internal macros, do not use directly */ -#define ccan_list_for_each_off_dir_(h, i, off, dir) \ - for (i = 0, \ - i = ccan_list_node_to_off_(ccan_list_debug(h, CCAN_LIST_LOC)->n.dir, \ - (off)); \ - ccan_list_node_from_off_((void *)i, (off)) != &(h)->n; \ - i = ccan_list_node_to_off_(ccan_list_node_from_off_((void *)i, (off))->dir, \ - (off))) - -#define ccan_list_for_each_safe_off_dir_(h, i, nxt, off, dir) \ - for (i = 0, \ - i = ccan_list_node_to_off_(ccan_list_debug(h, CCAN_LIST_LOC)->n.dir, \ - (off)), \ - nxt = ccan_list_node_to_off_(ccan_list_node_from_off_(i, (off))->dir, \ - (off)); \ - ccan_list_node_from_off_(i, (off)) != &(h)->n; \ - i = nxt, \ - nxt = ccan_list_node_to_off_(ccan_list_node_from_off_(i, (off))->dir, \ - (off))) - -/** - * ccan_list_for_each_off - iterate through a list of memory regions. - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @off: offset(relative to @i) at which list node data resides. - * - * This is a low-level wrapper to iterate @i over the entire list, used to - * implement all other, more high-level, for-each constructs. It's a for loop, - * so you can break and continue as normal. - * - * WARNING! Being the low-level macro that it is, this wrapper doesn't know - * nor care about the type of @i. The only assumption made is that @i points - * to a chunk of memory that at some @offset, relative to @i, contains a - * properly filled `struct ccan_list_node' which in turn contains pointers to - * memory chunks and it's turtles all the way down. With all that in mind - * remember that given the wrong pointer/offset couple this macro will - * happily churn all you memory until SEGFAULT stops it, in other words - * caveat emptor. - * - * It is worth mentioning that one of legitimate use-cases for that wrapper - * is operation on opaque types with known offset for `struct ccan_list_node' - * member(preferably 0), because it allows you not to disclose the type of - * @i. - * - * Example: - * ccan_list_for_each_off(&parent->children, child, - * offsetof(struct child, list)) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_off(h, i, off) \ - ccan_list_for_each_off_dir_((h),(i),(off),next) - -/** - * ccan_list_for_each_rev_off - iterate through a list of memory regions backwards - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @off: offset(relative to @i) at which list node data resides. - * - * See ccan_list_for_each_off for details - */ -#define ccan_list_for_each_rev_off(h, i, off) \ - ccan_list_for_each_off_dir_((h),(i),(off),prev) - -/** - * ccan_list_for_each_safe_off - iterate through a list of memory regions, maybe - * during deletion - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @nxt: the structure containing the ccan_list_node - * @off: offset(relative to @i) at which list node data resides. - * - * For details see `ccan_list_for_each_off' and `ccan_list_for_each_safe' - * descriptions. - * - * Example: - * ccan_list_for_each_safe_off(&parent->children, child, - * next, offsetof(struct child, list)) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_safe_off(h, i, nxt, off) \ - ccan_list_for_each_safe_off_dir_((h),(i),(nxt),(off),next) - -/** - * ccan_list_for_each_rev_safe_off - iterate backwards through a list of - * memory regions, maybe during deletion - * @h: the ccan_list_head - * @i: the pointer to a memory region which contains list node data. - * @nxt: the structure containing the ccan_list_node - * @off: offset(relative to @i) at which list node data resides. - * - * For details see `ccan_list_for_each_rev_off' and `ccan_list_for_each_rev_safe' - * descriptions. - * - * Example: - * ccan_list_for_each_rev_safe_off(&parent->children, child, - * next, offsetof(struct child, list)) - * printf("Name: %s\n", child->name); - */ -#define ccan_list_for_each_rev_safe_off(h, i, nxt, off) \ - ccan_list_for_each_safe_off_dir_((h),(i),(nxt),(off),prev) - -/* Other -off variants. */ -#define ccan_list_entry_off(n, type, off) \ - ((type *)ccan_list_node_from_off_((n), (off))) - -#define ccan_list_head_off(h, type, off) \ - ((type *)ccan_list_head_off((h), (off))) - -#define ccan_list_tail_off(h, type, off) \ - ((type *)ccan_list_tail_((h), (off))) - -#define ccan_list_add_off(h, n, off) \ - ccan_list_add((h), ccan_list_node_from_off_((n), (off))) - -#define ccan_list_del_off(n, off) \ - ccan_list_del(ccan_list_node_from_off_((n), (off))) - -#define ccan_list_del_from_off(h, n, off) \ - ccan_list_del_from(h, ccan_list_node_from_off_((n), (off))) - -/* Offset helper functions so we only single-evaluate. */ -static inline void *ccan_list_node_to_off_(struct ccan_list_node *node, size_t off) -{ - return (void *)((char *)node - off); -} -static inline struct ccan_list_node *ccan_list_node_from_off_(void *ptr, size_t off) -{ - return (struct ccan_list_node *)((char *)ptr + off); -} - -/* Get the offset of the member, but make sure it's a ccan_list_node. */ -#define ccan_list_off_(type, member) \ - (ccan_container_off(type, member) + \ - ccan_check_type(((type *)0)->member, struct ccan_list_node)) - -#define ccan_list_off_var_(var, member) \ - (ccan_container_off_var(var, member) + \ - ccan_check_type(var->member, struct ccan_list_node)) - -#if defined(HAVE_TYPEOF) && HAVE_TYPEOF -#define ccan_list_typeof(var) typeof(var) -#else -#define ccan_list_typeof(var) void * -#endif - -/* Returns member, or NULL if at end of list. */ -static inline void *ccan_list_entry_or_null(const struct ccan_list_head *h, - const struct ccan_list_node *n, - size_t off) -{ - if (n == &h->n) - return NULL; - return (char *)n - off; -} - -#endif /* CCAN_LIST_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h deleted file mode 100644 index 6d4cf62..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h +++ /dev/null @@ -1,17 +0,0 @@ -/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */ -#ifndef CCAN_STR_H -#define CCAN_STR_H -/** - * ccan_stringify - Turn expression into a string literal - * @expr: any C expression - * - * Example: - * #define PRINT_COND_IF_FALSE(cond) \ - * ((cond) || printf("%s is false!", ccan_stringify(cond))) - */ -#define stringify(expr) ccan_stringify_1(expr) -#define ccan_stringify(expr) ccan_stringify_1(expr) -/* Double-indirection required to stringify expansions */ -#define ccan_stringify_1(expr) #expr - -#endif /* CCAN_STR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/constant.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/constant.h deleted file mode 100644 index 90a68d4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/constant.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CONSTANT_H -#define CONSTANT_H -/********************************************************************** - - constant.h - - - $Author$ - created at: Sun Nov 15 00:09:33 2009 - - Copyright (C) 2009 Yusuke Endoh - -**********************************************************************/ -#include "ruby/ruby.h" -#include "id_table.h" - -typedef enum { - CONST_DEPRECATED = 0x100, - - CONST_VISIBILITY_MASK = 0xff, - CONST_PUBLIC = 0x00, - CONST_PRIVATE, - CONST_VISIBILITY_MAX -} rb_const_flag_t; - -#define RB_CONST_PRIVATE_P(ce) \ - (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE) -#define RB_CONST_PUBLIC_P(ce) \ - (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC) - -#define RB_CONST_DEPRECATED_P(ce) \ - ((ce)->flag & CONST_DEPRECATED) - -typedef struct rb_const_entry_struct { - rb_const_flag_t flag; - int line; - VALUE value; /* should be mark */ - VALUE file; /* should be mark */ -} rb_const_entry_t; - -VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj); -VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj); -VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj); -void rb_free_const_table(struct rb_id_table *tbl); -VALUE rb_const_source_location(VALUE, ID); - -int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag); -rb_const_entry_t *rb_const_lookup(VALUE klass, ID id); -VALUE rb_public_const_get_at(VALUE klass, ID id); -VALUE rb_public_const_get_from(VALUE klass, ID id); -int rb_public_const_defined_from(VALUE klass, ID id); -VALUE rb_const_source_location_at(VALUE, ID); - -#endif /* CONSTANT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/darray.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/darray.h deleted file mode 100644 index 08b53d8..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/darray.h +++ /dev/null @@ -1,209 +0,0 @@ -#ifndef RUBY_DARRAY_H -#define RUBY_DARRAY_H - -#include -#include -#include - -#include "internal/bits.h" - -// Type for a dynamic array. Use to declare a dynamic array. -// It is a pointer so it fits in st_table nicely. Designed -// to be fairly type-safe. -// -// NULL is a valid empty dynamic array. -// -// Example: -// rb_darray(char) char_array = NULL; -// rb_darray_append(&char_array, 'e'); -// printf("pushed %c\n", *rb_darray_ref(char_array, 0)); -// rb_darray_free(char_array); -// -#define rb_darray(T) struct { rb_darray_meta_t meta; T data[]; } * - -// Copy an element out of the array. Warning: not bounds checked. -// -// T rb_darray_get(rb_darray(T) ary, size_t idx); -// -#define rb_darray_get(ary, idx) ((ary)->data[(idx)]) - -// Assign to an element. Warning: not bounds checked. -// -// void rb_darray_set(rb_darray(T) ary, size_t idx, T element); -// -#define rb_darray_set(ary, idx, element) ((ary)->data[(idx)] = (element)) - -// Get a pointer to an element. Warning: not bounds checked. -// -// T *rb_darray_ref(rb_darray(T) ary, size_t idx); -// -#define rb_darray_ref(ary, idx) (&((ary)->data[(idx)])) - -/* Copy a new element into the array. ptr_to_ary is evaluated multiple times. - * - * void rb_darray_append(rb_darray(T) *ptr_to_ary, T element); - */ -#define rb_darray_append(ptr_to_ary, element) do { \ - rb_darray_ensure_space((ptr_to_ary), \ - sizeof(**(ptr_to_ary)), \ - sizeof((*(ptr_to_ary))->data[0])); \ - rb_darray_set(*(ptr_to_ary), \ - (*(ptr_to_ary))->meta.size, \ - (element)); \ - (*(ptr_to_ary))->meta.size++; \ -} while (0) - -#define rb_darray_insert(ptr_to_ary, idx, element) do { \ - rb_darray_ensure_space((ptr_to_ary), \ - sizeof(**(ptr_to_ary)), \ - sizeof((*(ptr_to_ary))->data[0])); \ - MEMMOVE( \ - rb_darray_ref(*(ptr_to_ary), idx + 1), \ - rb_darray_ref(*(ptr_to_ary), idx), \ - sizeof((*(ptr_to_ary))->data[0]), \ - rb_darray_size(*(ptr_to_ary)) - idx); \ - rb_darray_set(*(ptr_to_ary), idx, element); \ - (*(ptr_to_ary))->meta.size++; \ -} while (0) - -// Iterate over items of the array in a for loop -// -#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \ - for (size_t idx_name = 0; idx_name < rb_darray_size(ary) && ((elem_ptr_var) = rb_darray_ref(ary, idx_name)); ++idx_name) - -// Iterate over valid indices in the array in a for loop -// -#define rb_darray_for(ary, idx_name) \ - for (size_t idx_name = 0; idx_name < rb_darray_size(ary); ++idx_name) - -/* Make a dynamic array of a certain size. All bytes backing the elements are set to zero. - * Return 1 on success and 0 on failure. - * - * Note that NULL is a valid empty dynamic array. - * - * void rb_darray_make(rb_darray(T) *ptr_to_ary, size_t size); - */ -#define rb_darray_make(ptr_to_ary, size) \ - rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), sizeof((*(ptr_to_ary))->data[0])) - -/* Resize the darray to a new capacity. The new capacity must be greater than - * or equal to the size of the darray. - * - * void rb_darray_resize_capa(rb_darray(T) *ptr_to_ary, size_t capa); - */ -#define rb_darray_resize_capa(ptr_to_ary, capa) \ - rb_darray_resize_capa_impl((ptr_to_ary), capa, sizeof(**(ptr_to_ary)), sizeof((*(ptr_to_ary))->data[0])) - -#define rb_darray_data_ptr(ary) ((ary)->data) - -typedef struct rb_darray_meta { - size_t size; - size_t capa; -} rb_darray_meta_t; - -/* Set the size of the array to zero without freeing the backing memory. - * Allows reusing the same array. */ -static inline void -rb_darray_clear(void *ary) -{ - rb_darray_meta_t *meta = ary; - if (meta) { - meta->size = 0; - } -} - -// Get the size of the dynamic array. -// -static inline size_t -rb_darray_size(const void *ary) -{ - const rb_darray_meta_t *meta = ary; - return meta ? meta->size : 0; -} - - -static inline void -rb_darray_pop(void *ary, size_t count) -{ - rb_darray_meta_t *meta = ary; - meta->size -= count; -} - -// Get the capacity of the dynamic array. -// -static inline size_t -rb_darray_capa(const void *ary) -{ - const rb_darray_meta_t *meta = ary; - return meta ? meta->capa : 0; -} - -/* Free the dynamic array. */ -static inline void -rb_darray_free(void *ary) -{ - xfree(ary); -} - -/* Internal function. Resizes the capacity of a darray. The new capacity must - * be greater than or equal to the size of the darray. */ -static inline void -rb_darray_resize_capa_impl(void *ptr_to_ary, size_t new_capa, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; - - rb_darray_meta_t *new_ary = xrealloc(meta, new_capa * element_size + header_size); - - if (meta == NULL) { - /* First allocation. Initialize size. On subsequence allocations - * realloc takes care of carrying over the size. */ - new_ary->size = 0; - } - - RUBY_ASSERT(new_ary->size <= new_capa); - - new_ary->capa = new_capa; - - // We don't have access to the type of the dynamic array in function context. - // Write out result with memcpy to avoid strict aliasing issue. - memcpy(ptr_to_ary, &new_ary, sizeof(new_ary)); -} - -// Internal function -// Ensure there is space for one more element. -// Note: header_size can be bigger than sizeof(rb_darray_meta_t) when T is __int128_t, for example. -static inline void -rb_darray_ensure_space(void *ptr_to_ary, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; - size_t current_capa = rb_darray_capa(meta); - if (rb_darray_size(meta) < current_capa) return; - - // Double the capacity - size_t new_capa = current_capa == 0 ? 1 : current_capa * 2; - - rb_darray_resize_capa_impl(ptr_to_ary, new_capa, header_size, element_size); -} - -static inline void -rb_darray_make_impl(void *ptr_to_ary, size_t array_size, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - if (array_size == 0) { - *ptr_to_ptr_to_meta = NULL; - return; - } - - rb_darray_meta_t *meta = xcalloc(array_size * element_size + header_size, 1); - - meta->size = array_size; - meta->capa = array_size; - - // We don't have access to the type of the dynamic array in function context. - // Write out result with memcpy to avoid strict aliasing issue. - memcpy(ptr_to_ary, &meta, sizeof(meta)); -} - -#endif /* RUBY_DARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/debug_counter.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/debug_counter.h deleted file mode 100644 index 481a072..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/debug_counter.h +++ /dev/null @@ -1,423 +0,0 @@ -/********************************************************************** - - debug_counter.h - - - created at: Tue Feb 21 16:51:18 2017 - - Copyright (C) 2017 Koichi Sasada - -**********************************************************************/ - -#ifndef USE_DEBUG_COUNTER -#define USE_DEBUG_COUNTER 0 -#endif - -#ifdef RB_DEBUG_COUNTER - -// method cache (IMC: inline method cache) -RB_DEBUG_COUNTER(mc_inline_hit) // IMC hit -RB_DEBUG_COUNTER(mc_inline_miss_klass) // IMC miss by different class -RB_DEBUG_COUNTER(mc_inline_miss_invalidated) // IMC miss by invalidated ME -RB_DEBUG_COUNTER(mc_inline_miss_empty) // IMC miss because prev is empty slot -RB_DEBUG_COUNTER(mc_inline_miss_same_cc) // IMC miss, but same CC -RB_DEBUG_COUNTER(mc_inline_miss_same_cme) // IMC miss, but same CME -RB_DEBUG_COUNTER(mc_inline_miss_same_def) // IMC miss, but same definition -RB_DEBUG_COUNTER(mc_inline_miss_diff) // IMC miss, different methods - -RB_DEBUG_COUNTER(cvar_write_inline_hit) // cvar cache hit on write -RB_DEBUG_COUNTER(cvar_read_inline_hit) // cvar cache hit on read -RB_DEBUG_COUNTER(cvar_inline_miss) // miss inline cache -RB_DEBUG_COUNTER(cvar_class_invalidate) // invalidate cvar cache when define a cvar that's defined on a subclass -RB_DEBUG_COUNTER(cvar_include_invalidate) // invalidate cvar cache on module include or prepend - -RB_DEBUG_COUNTER(mc_cme_complement) // number of acquiring complement CME -RB_DEBUG_COUNTER(mc_cme_complement_hit) // number of cache hit for complemented CME - -RB_DEBUG_COUNTER(mc_search) // count for method lookup in class tree -RB_DEBUG_COUNTER(mc_search_notfound) // method lookup, but not found -RB_DEBUG_COUNTER(mc_search_super) // total traversed classes - -// callinfo -RB_DEBUG_COUNTER(ci_packed) // number of packed CI -RB_DEBUG_COUNTER(ci_kw) // non-packed CI w/ keywords -RB_DEBUG_COUNTER(ci_nokw) // non-packed CI w/o keywords -RB_DEBUG_COUNTER(ci_runtime) // creating temporary CI - -// callcache -RB_DEBUG_COUNTER(cc_new) // number of CC -RB_DEBUG_COUNTER(cc_temp) // dummy CC (stack-allocated) -RB_DEBUG_COUNTER(cc_found_in_ccs) // count for CC lookup success in CCS -RB_DEBUG_COUNTER(cc_not_found_in_ccs) // count for CC lookup success in CCS - -RB_DEBUG_COUNTER(cc_ent_invalidate) // count for invalidating cc (cc->klass = 0) -RB_DEBUG_COUNTER(cc_cme_invalidate) // count for invalidating CME - -RB_DEBUG_COUNTER(cc_invalidate_leaf) // count for invalidating klass if klass has no-subclasses -RB_DEBUG_COUNTER(cc_invalidate_leaf_ccs) // corresponding CCS -RB_DEBUG_COUNTER(cc_invalidate_leaf_callable) // complimented cache (no-subclasses) -RB_DEBUG_COUNTER(cc_invalidate_tree) // count for invalidating klass if klass has subclasses -RB_DEBUG_COUNTER(cc_invalidate_tree_cme) // cme if cme is found in this class or superclasses -RB_DEBUG_COUNTER(cc_invalidate_tree_callable) // complimented cache (subclasses) -RB_DEBUG_COUNTER(cc_invalidate_negative) // count for invalidating negative cache - -RB_DEBUG_COUNTER(ccs_free) // count for free'ing ccs -RB_DEBUG_COUNTER(ccs_maxlen) // maximum length of ccs -RB_DEBUG_COUNTER(ccs_found) // count for finding corresponding ccs on method lookup -RB_DEBUG_COUNTER(ccs_not_found) // count for not found corresponding ccs on method lookup - -// vm_eval.c -RB_DEBUG_COUNTER(call0_public) -RB_DEBUG_COUNTER(call0_other) -RB_DEBUG_COUNTER(gccct_hit) -RB_DEBUG_COUNTER(gccct_miss) -RB_DEBUG_COUNTER(gccct_null) - -// iseq -RB_DEBUG_COUNTER(iseq_num) // number of total created iseq -RB_DEBUG_COUNTER(iseq_cd_num) // number of total created cd (call_data) - -/* - * call cache fastpath usage - */ -RB_DEBUG_COUNTER(ccf_general) -RB_DEBUG_COUNTER(ccf_iseq_setup) -RB_DEBUG_COUNTER(ccf_iseq_setup_0start) -RB_DEBUG_COUNTER(ccf_iseq_setup_tailcall_0start) -RB_DEBUG_COUNTER(ccf_iseq_fix) /* several functions created with tool/mk_call_iseq_optimized.rb */ -RB_DEBUG_COUNTER(ccf_iseq_opt) /* has_opt == TRUE (has optional parameters), but other flags are FALSE */ -RB_DEBUG_COUNTER(ccf_iseq_kw1) /* vm_call_iseq_setup_kwparm_kwarg() */ -RB_DEBUG_COUNTER(ccf_iseq_kw2) /* vm_call_iseq_setup_kwparm_nokwarg() */ -RB_DEBUG_COUNTER(ccf_cfunc) -RB_DEBUG_COUNTER(ccf_cfunc_with_frame) -RB_DEBUG_COUNTER(ccf_ivar) /* attr_reader */ -RB_DEBUG_COUNTER(ccf_attrset) /* attr_writer */ -RB_DEBUG_COUNTER(ccf_method_missing) -RB_DEBUG_COUNTER(ccf_zsuper) -RB_DEBUG_COUNTER(ccf_bmethod) -RB_DEBUG_COUNTER(ccf_opt_send) -RB_DEBUG_COUNTER(ccf_opt_call) -RB_DEBUG_COUNTER(ccf_opt_block_call) -RB_DEBUG_COUNTER(ccf_opt_struct_aref) -RB_DEBUG_COUNTER(ccf_opt_struct_aset) -RB_DEBUG_COUNTER(ccf_super_method) -RB_DEBUG_COUNTER(ccf_cfunc_other) -RB_DEBUG_COUNTER(ccf_cfunc_only_splat) -RB_DEBUG_COUNTER(ccf_cfunc_only_splat_kw) -RB_DEBUG_COUNTER(ccf_iseq_bmethod) -RB_DEBUG_COUNTER(ccf_noniseq_bmethod) -RB_DEBUG_COUNTER(ccf_opt_send_complex) -RB_DEBUG_COUNTER(ccf_opt_send_simple) - -/* - * control frame push counts. - * - * * frame_push: frame push counts. - * * frame_push_*: frame push counts per each type. - * * frame_R2R: Ruby frame to Ruby frame - * * frame_R2C: Ruby frame to C frame - * * frame_C2C: C frame to C frame - * * frame_C2R: C frame to Ruby frame - */ -RB_DEBUG_COUNTER(frame_push) -RB_DEBUG_COUNTER(frame_push_method) -RB_DEBUG_COUNTER(frame_push_block) -RB_DEBUG_COUNTER(frame_push_class) -RB_DEBUG_COUNTER(frame_push_top) -RB_DEBUG_COUNTER(frame_push_cfunc) -RB_DEBUG_COUNTER(frame_push_ifunc) -RB_DEBUG_COUNTER(frame_push_eval) -RB_DEBUG_COUNTER(frame_push_rescue) -RB_DEBUG_COUNTER(frame_push_dummy) - -RB_DEBUG_COUNTER(frame_R2R) -RB_DEBUG_COUNTER(frame_R2C) -RB_DEBUG_COUNTER(frame_C2C) -RB_DEBUG_COUNTER(frame_C2R) - -/* instance variable counts */ -RB_DEBUG_COUNTER(ivar_get_obj_hit) // Only T_OBJECT hits -RB_DEBUG_COUNTER(ivar_get_obj_miss) // Only T_OBJECT misses -RB_DEBUG_COUNTER(ivar_get_ic_hit) // All hits -RB_DEBUG_COUNTER(ivar_get_ic_miss) // All misses -RB_DEBUG_COUNTER(ivar_set_ic_hit) // All hits -RB_DEBUG_COUNTER(ivar_set_obj_hit) // Only T_OBJECT hits -RB_DEBUG_COUNTER(ivar_set_obj_miss) // Only T_OBJECT misses -RB_DEBUG_COUNTER(ivar_set_ic_miss) // All misses -RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject) // Miss because non T_OBJECT -RB_DEBUG_COUNTER(ivar_get_base) // Calls to `rb_ivar_get` (very slow path) -RB_DEBUG_COUNTER(ivar_set_base) // Calls to `ivar_set` (very slow path) -RB_DEBUG_COUNTER(ivar_get_ic_miss_set) // Misses on IV reads where the cache was wrong -RB_DEBUG_COUNTER(ivar_get_cc_miss_set) // Misses on attr_reader where the cache was wrong -RB_DEBUG_COUNTER(ivar_get_ic_miss_unset) // Misses on IV read where the cache wasn't set -RB_DEBUG_COUNTER(ivar_get_cc_miss_unset) // Misses on attr_reader where the cache wasn't set - -/* local variable counts - * - * * lvar_get: total lvar get counts (VM insn) - * * lvar_get_dynamic: lvar get counts if accessing upper env (VM insn) - * * lvar_set*: same as "get" - * * lvar_set_slowpath: counts using vm_env_write_slowpath() - */ -RB_DEBUG_COUNTER(lvar_get) -RB_DEBUG_COUNTER(lvar_get_dynamic) -RB_DEBUG_COUNTER(lvar_set) -RB_DEBUG_COUNTER(lvar_set_dynamic) -RB_DEBUG_COUNTER(lvar_set_slowpath) - -/* GC counts: - * - * * count: simple count - * * _minor: minor gc - * * _major: major gc - * * other suffix is corresponding to last_gc_info or - * gc_profile_record_flag in gc.c. - */ -RB_DEBUG_COUNTER(gc_count) -RB_DEBUG_COUNTER(gc_minor_newobj) -RB_DEBUG_COUNTER(gc_minor_malloc) -RB_DEBUG_COUNTER(gc_minor_method) -RB_DEBUG_COUNTER(gc_minor_capi) -RB_DEBUG_COUNTER(gc_minor_stress) -RB_DEBUG_COUNTER(gc_major_nofree) -RB_DEBUG_COUNTER(gc_major_oldgen) -RB_DEBUG_COUNTER(gc_major_shady) -RB_DEBUG_COUNTER(gc_major_force) -RB_DEBUG_COUNTER(gc_major_oldmalloc) - -RB_DEBUG_COUNTER(gc_enter_start) -RB_DEBUG_COUNTER(gc_enter_continue) -RB_DEBUG_COUNTER(gc_enter_rest) -RB_DEBUG_COUNTER(gc_enter_finalizer) - -RB_DEBUG_COUNTER(gc_isptr_trial) -RB_DEBUG_COUNTER(gc_isptr_range) -RB_DEBUG_COUNTER(gc_isptr_align) -RB_DEBUG_COUNTER(gc_isptr_maybe) - -/* object allocation counts: - * - * * obj_newobj: newobj counts - * * obj_newobj_slowpath: newobj with slowpath counts - * * obj_newobj_wb_unprotected: newobj for wb_unprotected. - * * obj_free: obj_free() counts - * * obj_promote: promoted counts (oldgen) - * * obj_wb_unprotect: wb unprotect counts - * - * * obj_[type]_[attr]: *free'ed counts* for each type. - * Note that it is not a allocated counts. - * * [type] - * * _obj: T_OBJECT - * * _str: T_STRING - * * _ary: T_ARRAY - * * _xxx: T_XXX (hash, struct, ...) - * - * * [attr] - * * _ptr: R?? is not embed. - * * _embed: R?? is embed. - * * type specific attr. - * * str_shared: str is shared. - * * str_nofree: nofree - * * str_fstr: fstr - * * hash_empty: hash is empty - * * hash_1_4: has 1 to 4 entries - * * hash_5_8: has 5 to 8 entries - * * hash_g8: has n entries (n>8) - * * match_under4: has under 4 oniguruma regions allocated - * * match_ge4: has n regions allocated (4<=n<8) - * * match_ge8: has n regions allocated (8<=n) - * * data_empty: T_DATA but no memory free. - * * data_xfree: free'ed by xfree(). - * * data_imm_free: free'ed immediately. - * * data_zombie: free'ed with zombie. - * * imemo_*: T_IMEMO with each type. - */ -RB_DEBUG_COUNTER(obj_newobj) -RB_DEBUG_COUNTER(obj_newobj_slowpath) -RB_DEBUG_COUNTER(obj_newobj_wb_unprotected) -RB_DEBUG_COUNTER(obj_free) -RB_DEBUG_COUNTER(obj_promote) -RB_DEBUG_COUNTER(obj_wb_unprotect) - -RB_DEBUG_COUNTER(obj_obj_embed) -RB_DEBUG_COUNTER(obj_obj_ptr) -RB_DEBUG_COUNTER(obj_obj_too_complex) - -RB_DEBUG_COUNTER(obj_str_ptr) -RB_DEBUG_COUNTER(obj_str_embed) -RB_DEBUG_COUNTER(obj_str_shared) -RB_DEBUG_COUNTER(obj_str_nofree) -RB_DEBUG_COUNTER(obj_str_fstr) - -RB_DEBUG_COUNTER(obj_ary_embed) -RB_DEBUG_COUNTER(obj_ary_ptr) -RB_DEBUG_COUNTER(obj_ary_extracapa) -/* - ary_shared_create: shared ary by Array#dup and so on. - ary_shared: finished in shard. - ary_shared_root_occupied: shared_root but has only 1 refcnt. - The number (ary_shared - ary_shared_root_occupied) is meaningful. - */ -RB_DEBUG_COUNTER(obj_ary_shared_create) -RB_DEBUG_COUNTER(obj_ary_shared) -RB_DEBUG_COUNTER(obj_ary_shared_root_occupied) - -RB_DEBUG_COUNTER(obj_hash_empty) -RB_DEBUG_COUNTER(obj_hash_1) -RB_DEBUG_COUNTER(obj_hash_2) -RB_DEBUG_COUNTER(obj_hash_3) -RB_DEBUG_COUNTER(obj_hash_4) -RB_DEBUG_COUNTER(obj_hash_5_8) -RB_DEBUG_COUNTER(obj_hash_g8) - -RB_DEBUG_COUNTER(obj_hash_null) -RB_DEBUG_COUNTER(obj_hash_ar) -RB_DEBUG_COUNTER(obj_hash_st) -RB_DEBUG_COUNTER(obj_hash_force_convert) - -RB_DEBUG_COUNTER(obj_struct_embed) -RB_DEBUG_COUNTER(obj_struct_ptr) - -RB_DEBUG_COUNTER(obj_data_empty) -RB_DEBUG_COUNTER(obj_data_xfree) -RB_DEBUG_COUNTER(obj_data_imm_free) -RB_DEBUG_COUNTER(obj_data_zombie) - -RB_DEBUG_COUNTER(obj_match_under4) -RB_DEBUG_COUNTER(obj_match_ge4) -RB_DEBUG_COUNTER(obj_match_ge8) -RB_DEBUG_COUNTER(obj_match_ptr) - -RB_DEBUG_COUNTER(obj_iclass_ptr) -RB_DEBUG_COUNTER(obj_class_ptr) -RB_DEBUG_COUNTER(obj_module_ptr) - -RB_DEBUG_COUNTER(obj_bignum_ptr) -RB_DEBUG_COUNTER(obj_bignum_embed) -RB_DEBUG_COUNTER(obj_float) -RB_DEBUG_COUNTER(obj_complex) -RB_DEBUG_COUNTER(obj_rational) - -RB_DEBUG_COUNTER(obj_regexp_ptr) -RB_DEBUG_COUNTER(obj_file_ptr) -RB_DEBUG_COUNTER(obj_symbol) - -RB_DEBUG_COUNTER(obj_imemo_ment) -RB_DEBUG_COUNTER(obj_imemo_iseq) -RB_DEBUG_COUNTER(obj_imemo_env) -RB_DEBUG_COUNTER(obj_imemo_tmpbuf) -RB_DEBUG_COUNTER(obj_imemo_ast) -RB_DEBUG_COUNTER(obj_imemo_cref) -RB_DEBUG_COUNTER(obj_imemo_svar) -RB_DEBUG_COUNTER(obj_imemo_throw_data) -RB_DEBUG_COUNTER(obj_imemo_ifunc) -RB_DEBUG_COUNTER(obj_imemo_memo) -RB_DEBUG_COUNTER(obj_imemo_parser_strterm) -RB_DEBUG_COUNTER(obj_imemo_callinfo) -RB_DEBUG_COUNTER(obj_imemo_callcache) -RB_DEBUG_COUNTER(obj_imemo_constcache) - -/* ar_table */ -RB_DEBUG_COUNTER(artable_hint_hit) -RB_DEBUG_COUNTER(artable_hint_miss) -RB_DEBUG_COUNTER(artable_hint_notfound) - -/* heap function counts - * - * * heap_xmalloc/realloc/xfree: call counts - */ -RB_DEBUG_COUNTER(heap_xmalloc) -RB_DEBUG_COUNTER(heap_xrealloc) -RB_DEBUG_COUNTER(heap_xfree) - -// VM sync -RB_DEBUG_COUNTER(vm_sync_lock) -RB_DEBUG_COUNTER(vm_sync_lock_enter) -RB_DEBUG_COUNTER(vm_sync_lock_enter_nb) -RB_DEBUG_COUNTER(vm_sync_lock_enter_cr) -RB_DEBUG_COUNTER(vm_sync_barrier) - -/* load (not implemented yet) */ -/* -RB_DEBUG_COUNTER(load_files) -RB_DEBUG_COUNTER(load_path_is_not_realpath) -*/ -#endif - -#ifndef RUBY_DEBUG_COUNTER_H -#define RUBY_DEBUG_COUNTER_H 1 - -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/ruby.h" /* for VALUE */ - -#if !defined(__GNUC__) && USE_DEBUG_COUNTER -#error "USE_DEBUG_COUNTER is not supported by other than __GNUC__" -#endif - -enum rb_debug_counter_type { -#define RB_DEBUG_COUNTER(name) RB_DEBUG_COUNTER_##name, -#include "debug_counter.h" - RB_DEBUG_COUNTER_MAX -#undef RB_DEBUG_COUNTER -}; - -#if USE_DEBUG_COUNTER -extern size_t rb_debug_counter[]; -RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; -RUBY_EXTERN void rb_debug_counter_add_atomic(enum rb_debug_counter_type type, int add); - -inline static int -rb_debug_counter_add(enum rb_debug_counter_type type, int add, int cond) -{ - if (cond) { - if (ruby_single_main_ractor != NULL) { - rb_debug_counter[(int)type] += add; - } - else { - rb_debug_counter_add_atomic(type, add); - } - } - return cond; -} - -inline static int -rb_debug_counter_max(enum rb_debug_counter_type type, unsigned int num) -{ - // TODO: sync - if (rb_debug_counter[(int)type] < num) { - rb_debug_counter[(int)type] = num; - return 1; - } - else { - return 0; - } -} - -VALUE rb_debug_counter_reset(VALUE klass); -VALUE rb_debug_counter_show(VALUE klass); - -#define RB_DEBUG_COUNTER_INC(type) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, 1) -#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !(cond))) -#define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !!(cond)) -#define RB_DEBUG_COUNTER_ADD(type, num) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, (num), 1) -#define RB_DEBUG_COUNTER_SETMAX(type, num) rb_debug_counter_max(RB_DEBUG_COUNTER_##type, (unsigned int)(num)) - -#else -#define RB_DEBUG_COUNTER_INC(type) ((void)0) -#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!!(cond)) -#define RB_DEBUG_COUNTER_INC_IF(type, cond) (!!(cond)) -#define RB_DEBUG_COUNTER_ADD(type, num) ((void)0) -#define RB_DEBUG_COUNTER_SETMAX(type, num) 0 -#endif - -void rb_debug_counter_show_results(const char *msg); - -RUBY_SYMBOL_EXPORT_BEGIN - -size_t ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr); -void ruby_debug_counter_reset(void); -void ruby_debug_counter_show_at_exit(int enable); - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_DEBUG_COUNTER_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/dln.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/dln.h deleted file mode 100644 index d624bb6..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/dln.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef DLN_H -#define DLN_H -/********************************************************************** - - dln.h - - - $Author$ - created at: Wed Jan 19 16:53:09 JST 1994 - - Copyright (C) 1993-2007 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby/defines.h" /* for RUBY_SYMBOL_EXPORT_BEGIN */ - -RUBY_SYMBOL_EXPORT_BEGIN - -#ifndef DLN_FIND_EXTRA_ARG -#define DLN_FIND_EXTRA_ARG -#endif -#ifndef DLN_FIND_EXTRA_ARG_DECL -#define DLN_FIND_EXTRA_ARG_DECL -#endif - -char *dln_find_exe_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL); -char *dln_find_file_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL); -void *dln_load(const char*); -void *dln_symbol(void*,const char*); - -RUBY_SYMBOL_EXPORT_END - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/encindex.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/encindex.h deleted file mode 100644 index e6ddb1b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/encindex.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef RUBY_ENCINDEX_H -#define RUBY_ENCINDEX_H 1 -/********************************************************************** - - encindex.h - - - $Author$ - created at: Tue Sep 15 13:21:14 JST 2015 - - Copyright (C) 2015 Yukihiro Matsumoto - -**********************************************************************/ - -#include "ruby/encoding.h" /* rb_ascii8bit_encindex etc. */ -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -enum ruby_preserved_encindex { - RUBY_ENCINDEX_ASCII_8BIT, - RUBY_ENCINDEX_UTF_8, - RUBY_ENCINDEX_US_ASCII, - - /* preserved indexes */ - RUBY_ENCINDEX_UTF_16BE, - RUBY_ENCINDEX_UTF_16LE, - RUBY_ENCINDEX_UTF_32BE, - RUBY_ENCINDEX_UTF_32LE, - RUBY_ENCINDEX_UTF_16, - RUBY_ENCINDEX_UTF_32, - RUBY_ENCINDEX_UTF8_MAC, - - /* for old options of regexp */ - RUBY_ENCINDEX_EUC_JP, - RUBY_ENCINDEX_Windows_31J, - - RUBY_ENCINDEX_BUILTIN_MAX -}; - -#define ENCINDEX_ASCII_8BIT RUBY_ENCINDEX_ASCII_8BIT -#define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8 -#define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII -#define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE -#define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE -#define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE -#define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE -#define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16 -#define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32 -#define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC -#define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP -#define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J -#define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX - -#define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII_8BIT -#define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8 -#define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII - -int rb_enc_find_index2(const char *name, long len); - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_ENCINDEX_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h deleted file mode 100644 index 9a55112..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h +++ /dev/null @@ -1,324 +0,0 @@ -#ifndef RUBY_EVAL_INTERN_H -#define RUBY_EVAL_INTERN_H - -#include "ruby/ruby.h" -#include "vm_core.h" - -static inline void -vm_passed_block_handler_set(rb_execution_context_t *ec, VALUE block_handler) -{ - vm_block_handler_verify(block_handler); - ec->passed_block_handler = block_handler; -} - -static inline void -pass_passed_block_handler(rb_execution_context_t *ec) -{ - VALUE block_handler = rb_vm_frame_block_handler(ec->cfp); - vm_passed_block_handler_set(ec, block_handler); - VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_PASSED); -} - -#define PASS_PASSED_BLOCK_HANDLER_EC(ec) pass_passed_block_handler(ec) -#define PASS_PASSED_BLOCK_HANDLER() pass_passed_block_handler(GET_EC()) - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif - -#include -#if defined(__wasm__) && !defined(__EMSCRIPTEN__) -# include "wasm/setjmp.h" -#else -# include -#endif - -#ifdef __APPLE__ -# ifdef HAVE_CRT_EXTERNS_H -# include -# else -# include "missing/crt_externs.h" -# endif -#endif - -#ifndef HAVE_STRING_H -char *strrchr(const char *, const char); -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_NET_SOCKET_H -#include -#endif - -#define ruby_setjmp(env) RUBY_SETJMP(env) -#define ruby_longjmp(env,val) RUBY_LONGJMP((env),(val)) -#ifdef __CYGWIN__ -# ifndef _setjmp -int _setjmp(jmp_buf); -# endif -# ifndef _longjmp -NORETURN(void _longjmp(jmp_buf, int)); -# endif -#endif - -#include -#include -#include - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -/* - Solaris sys/select.h switches select to select_large_fdset to support larger - file descriptors if FD_SETSIZE is larger than 1024 on 32bit environment. - But Ruby doesn't change FD_SETSIZE because fd_set is allocated dynamically. - So following definition is required to use select_large_fdset. -*/ -#ifdef HAVE_SELECT_LARGE_FDSET -#define select(n, r, w, e, t) select_large_fdset((n), (r), (w), (e), (t)) -extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval *); -#endif - -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#include - -#define EC_PUSH_TAG(ec) do { \ - rb_execution_context_t * const _ec = (ec); \ - struct rb_vm_tag _tag; \ - _tag.state = TAG_NONE; \ - _tag.tag = Qundef; \ - _tag.prev = _ec->tag; \ - _tag.lock_rec = rb_ec_vm_lock_rec(_ec); \ - rb_vm_tag_jmpbuf_init(&_tag.buf); \ - -#define EC_POP_TAG() \ - _ec->tag = _tag.prev; \ - rb_vm_tag_jmpbuf_deinit(&_tag.buf); \ -} while (0) - -#define EC_TMPPOP_TAG() \ - _ec->tag = _tag.prev - -#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag) - -#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || defined __clang__ -/* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings. - * This macro also prevents Clang from dumping core in EC_EXEC_TAG(). - * (I confirmed Clang 4.0.1 and 5.0.0.) - */ -# define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var)) -# define VAR_INITIALIZED(var) ((var) = VAR_FROM_MEMORY(var)) -# define VAR_NOCLOBBERED(var) volatile var -#else -# define VAR_FROM_MEMORY(var) (var) -# define VAR_INITIALIZED(var) ((void)&(var)) -# define VAR_NOCLOBBERED(var) var -#endif - -static inline void -rb_ec_vm_lock_rec_check(const rb_execution_context_t *ec, unsigned int recorded_lock_rec) -{ - unsigned int current_lock_rec = rb_ec_vm_lock_rec(ec); - if (current_lock_rec != recorded_lock_rec) { - rb_ec_vm_lock_rec_release(ec, recorded_lock_rec, current_lock_rec); - } -} - -/* clear ec->tag->state, and return the value */ -static inline int -rb_ec_tag_state(const rb_execution_context_t *ec) -{ - struct rb_vm_tag *tag = ec->tag; - enum ruby_tag_type state = tag->state; - tag->state = TAG_NONE; - rb_ec_vm_lock_rec_check(ec, tag->lock_rec); - RBIMPL_ASSUME(state > TAG_NONE); - RBIMPL_ASSUME(state <= TAG_FATAL); - return state; -} - -NORETURN(static inline void rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st)); -static inline void -rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st) -{ - RUBY_ASSERT(st > TAG_NONE && st <= TAG_FATAL, ": Invalid tag jump: %d", (int)st); - ec->tag->state = st; - ruby_longjmp(RB_VM_TAG_JMPBUF_GET(ec->tag->buf), 1); -} - -/* - setjmp() in assignment expression rhs is undefined behavior - [ISO/IEC 9899:1999] 7.13.1.1 -*/ -#define EC_EXEC_TAG() \ - (UNLIKELY(ruby_setjmp(RB_VM_TAG_JMPBUF_GET(_tag.buf))) ? rb_ec_tag_state(VAR_FROM_MEMORY(_ec)) : (EC_REPUSH_TAG(), 0)) - -#define EC_JUMP_TAG(ec, st) rb_ec_tag_jump(ec, st) - -#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc) - -/* CREF operators */ - -#define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1 -#define CREF_FL_OMOD_SHARED IMEMO_FL_USER2 -#define CREF_FL_SINGLETON IMEMO_FL_USER3 - -static inline int CREF_SINGLETON(const rb_cref_t *cref); - -static inline VALUE -CREF_CLASS(const rb_cref_t *cref) -{ - if (CREF_SINGLETON(cref)) { - return CLASS_OF(cref->klass_or_self); - } - else { - return cref->klass_or_self; - } -} - -static inline VALUE -CREF_CLASS_FOR_DEFINITION(const rb_cref_t *cref) -{ - if (CREF_SINGLETON(cref)) { - return rb_singleton_class(cref->klass_or_self); - } - else { - return cref->klass_or_self; - } -} - -static inline rb_cref_t * -CREF_NEXT(const rb_cref_t *cref) -{ - return cref->next; -} - -static inline const rb_scope_visibility_t * -CREF_SCOPE_VISI(const rb_cref_t *cref) -{ - return &cref->scope_visi; -} - -static inline VALUE -CREF_REFINEMENTS(const rb_cref_t *cref) -{ - return cref->refinements; -} - -static inline void -CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs) -{ - RB_OBJ_WRITE(cref, &cref->refinements, refs); -} - -static inline int -CREF_PUSHED_BY_EVAL(const rb_cref_t *cref) -{ - return cref->flags & CREF_FL_PUSHED_BY_EVAL; -} - -static inline void -CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref) -{ - cref->flags |= CREF_FL_PUSHED_BY_EVAL; -} - -static inline int -CREF_SINGLETON(const rb_cref_t *cref) -{ - return cref->flags & CREF_FL_SINGLETON; -} - -static inline void -CREF_SINGLETON_SET(rb_cref_t *cref) -{ - cref->flags |= CREF_FL_SINGLETON; -} - -static inline int -CREF_OMOD_SHARED(const rb_cref_t *cref) -{ - return cref->flags & CREF_FL_OMOD_SHARED; -} - -static inline void -CREF_OMOD_SHARED_SET(rb_cref_t *cref) -{ - cref->flags |= CREF_FL_OMOD_SHARED; -} - -static inline void -CREF_OMOD_SHARED_UNSET(rb_cref_t *cref) -{ - cref->flags &= ~CREF_FL_OMOD_SHARED; -} - -enum { - RAISED_EXCEPTION = 1, - RAISED_STACKOVERFLOW = 2, - RAISED_NOMEMORY = 4 -}; -#define rb_ec_raised_set(ec, f) ((ec)->raised_flag |= (f)) -#define rb_ec_raised_reset(ec, f) ((ec)->raised_flag &= ~(f)) -#define rb_ec_raised_p(ec, f) (((ec)->raised_flag & (f)) != 0) -#define rb_ec_raised_clear(ec) ((ec)->raised_flag = 0) -int rb_ec_set_raised(rb_execution_context_t *ec); -int rb_ec_reset_raised(rb_execution_context_t *ec); -int rb_ec_stack_check(rb_execution_context_t *ec); - -VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self); -VALUE rb_make_exception(int argc, const VALUE *argv); - -NORETURN(void rb_method_name_error(VALUE, VALUE)); - -NORETURN(void rb_fiber_start(rb_fiber_t*)); - -NORETURN(void rb_print_undef(VALUE, ID, rb_method_visibility_t)); -NORETURN(void rb_print_undef_str(VALUE, VALUE)); -NORETURN(void rb_print_inaccessible(VALUE, ID, rb_method_visibility_t)); -NORETURN(void rb_vm_localjump_error(const char *,VALUE, int)); -NORETURN(void rb_vm_jump_tag_but_local_jump(enum ruby_tag_type)); - -VALUE rb_vm_make_jump_tag_but_local_jump(enum ruby_tag_type state, VALUE val); -rb_cref_t *rb_vm_cref(void); -rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void); -VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, VALUE block_handler, VALUE filename); -void rb_vm_set_progname(VALUE filename); -VALUE rb_vm_cbase(void); - -/* vm_backtrace.c */ -VALUE rb_ec_backtrace_object(const rb_execution_context_t *ec); -VALUE rb_ec_backtrace_str_ary(const rb_execution_context_t *ec, long lev, long n); -VALUE rb_ec_backtrace_location_ary(const rb_execution_context_t *ec, long lev, long n, bool skip_internal); - -#ifndef CharNext /* defined as CharNext[AW] on Windows. */ -# ifdef HAVE_MBLEN -# define CharNext(p) rb_char_next(p) -static inline char * -rb_char_next(const char *p) -{ - if (p) { - int len = mblen(p, RUBY_MBCHAR_MAXSIZE); - p += len > 0 ? len : 1; - } - return (char *)p; -} -# else -# define CharNext(p) ((p) + 1) -# endif -#endif - -#endif /* RUBY_EVAL_INTERN_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/hrtime.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/hrtime.h deleted file mode 100644 index 2ca7b0c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/hrtime.h +++ /dev/null @@ -1,237 +0,0 @@ -#ifndef RB_HRTIME_H -#define RB_HRTIME_H -#include "ruby/ruby.h" -#include -#if defined(HAVE_SYS_TIME_H) -# include -#endif - -#include "internal/compilers.h" - -/* - * Hi-res monotonic clock. It is currently nsec resolution, which has over - * 500 years of range (with an unsigned 64-bit integer). Developers - * targeting small systems may try 32-bit and low-resolution (milliseconds). - * - * TBD: Is nsec even necessary? usec resolution seems enough for userspace - * and it'll be suitable for use with devices lasting over 500,000 years - * (maybe some devices designed for long-term space travel) - * - * Current API: - * - * * rb_hrtime_now - current clock value (monotonic if available) - * * rb_hrtime_mul - multiply with overflow check - * * rb_hrtime_add - add with overflow check - * * rb_timeval2hrtime - convert from timeval - * * rb_timespec2hrtime - convert from timespec - * * rb_msec2hrtime - convert from millisecond - * * rb_sec2hrtime - convert from time_t (seconds) - * * rb_hrtime2timeval - convert to timeval - * * rb_hrtime2timespec - convert to timespec - * - * Note: no conversion to milliseconds is provided here because different - * functions have different limits (e.g. epoll_wait vs w32_wait_events). - * So we provide RB_HRTIME_PER_MSEC and similar macros for implementing - * this for each use case. - */ -#define RB_HRTIME_PER_USEC ((rb_hrtime_t)1000) -#define RB_HRTIME_PER_MSEC (RB_HRTIME_PER_USEC * (rb_hrtime_t)1000) -#define RB_HRTIME_PER_SEC (RB_HRTIME_PER_MSEC * (rb_hrtime_t)1000) -#define RB_HRTIME_MAX UINT64_MAX -#define RB_HRTIME_MIN ((rb_hrtime_t)0) - -/* - * Lets try to support time travelers. Lets assume anybody with a time machine - * also has access to a modern gcc or clang with 128-bit int support - */ -#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL -typedef int128_t rb_hrtime_t; -#else -typedef uint64_t rb_hrtime_t; -#endif - -/* thread.c */ -/* returns the value of the monotonic clock (if available) */ -rb_hrtime_t rb_hrtime_now(void); - -/* - * multiply @a and @b with overflow check and return the - * (clamped to RB_HRTIME_MAX) result. - */ -static inline rb_hrtime_t -rb_hrtime_mul(rb_hrtime_t a, rb_hrtime_t b) -{ - rb_hrtime_t c; - -#ifdef ckd_mul - if (ckd_mul(&c, a, b)) - return RB_HRTIME_MAX; - -#elif __has_builtin(__builtin_mul_overflow) - if (__builtin_mul_overflow(a, b, &c)) - return RB_HRTIME_MAX; -#else - if (b != 0 && a > RB_HRTIME_MAX / b) /* overflow */ - return RB_HRTIME_MAX; - c = a * b; -#endif - return c; -} - -/* - * add @a and @b with overflow check and return the - * (clamped to RB_HRTIME_MAX) result. - */ -static inline rb_hrtime_t -rb_hrtime_add(rb_hrtime_t a, rb_hrtime_t b) -{ - rb_hrtime_t c; - -#ifdef ckd_add - if (ckd_add(&c, a, b)) - return RB_HRTIME_MAX; - -#elif __has_builtin(__builtin_add_overflow) - if (__builtin_add_overflow(a, b, &c)) - return RB_HRTIME_MAX; -#else - c = a + b; - if (c < a) /* overflow */ - return RB_HRTIME_MAX; -#endif - return c; -} - -static inline rb_hrtime_t -rb_hrtime_sub(rb_hrtime_t a, rb_hrtime_t b) -{ - if (a < b) { - return RB_HRTIME_MIN; - } - return a - b; -} - -/* - * convert a timeval struct to rb_hrtime_t, clamping at RB_HRTIME_MAX - */ -static inline rb_hrtime_t -rb_timeval2hrtime(const struct timeval *tv) -{ - rb_hrtime_t s = rb_hrtime_mul((rb_hrtime_t)tv->tv_sec, RB_HRTIME_PER_SEC); - rb_hrtime_t u = rb_hrtime_mul((rb_hrtime_t)tv->tv_usec, RB_HRTIME_PER_USEC); - - return rb_hrtime_add(s, u); -} - -/* - * convert a timespec struct to rb_hrtime_t, clamping at RB_HRTIME_MAX - */ -static inline rb_hrtime_t -rb_timespec2hrtime(const struct timespec *ts) -{ - rb_hrtime_t s = rb_hrtime_mul((rb_hrtime_t)ts->tv_sec, RB_HRTIME_PER_SEC); - - return rb_hrtime_add(s, (rb_hrtime_t)ts->tv_nsec); -} - -/* - * convert a millisecond value to rb_hrtime_t, clamping at RB_HRTIME_MAX - */ -static inline rb_hrtime_t -rb_msec2hrtime(unsigned long msec) -{ - return rb_hrtime_mul((rb_hrtime_t)msec, RB_HRTIME_PER_MSEC); -} - -/* - * convert a time_t value to rb_hrtime_t, clamping at RB_HRTIME_MAX - * Negative values will be clamped at 0. - */ -static inline rb_hrtime_t -rb_sec2hrtime(time_t sec) -{ - if (sec <= 0) return 0; - - return rb_hrtime_mul((rb_hrtime_t)sec, RB_HRTIME_PER_SEC); -} - -/* - * convert a rb_hrtime_t value to a timespec, suitable for calling - * functions like ppoll(2) or kevent(2) - */ -static inline struct timespec * -rb_hrtime2timespec(struct timespec *ts, const rb_hrtime_t *hrt) -{ - if (hrt) { - ts->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC); - ts->tv_nsec = (int32_t)(*hrt % RB_HRTIME_PER_SEC); - return ts; - } - return 0; -} - -/* - * convert a rb_hrtime_t value to a timeval, suitable for calling - * functions like select(2) - */ -static inline struct timeval * -rb_hrtime2timeval(struct timeval *tv, const rb_hrtime_t *hrt) -{ - if (hrt) { - tv->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC); - tv->tv_usec = (int32_t)((*hrt % RB_HRTIME_PER_SEC)/RB_HRTIME_PER_USEC); - - return tv; - } - return 0; -} - -#include "internal/warnings.h" -#include "internal/time.h" - -/* - * Back when we used "struct timeval", not all platforms implemented - * tv_sec as time_t. Nowadays we use "struct timespec" and tv_sec - * seems to be implemented more consistently across platforms. - * At least other parts of our code hasn't had to deal with non-time_t - * tv_sec in timespec... - */ -#define TIMESPEC_SEC_MAX TIMET_MAX -#define TIMESPEC_SEC_MIN TIMET_MIN - -COMPILER_WARNING_PUSH -#if __has_warning("-Wimplicit-int-float-conversion") -COMPILER_WARNING_IGNORED(-Wimplicit-int-float-conversion) -#elif defined(_MSC_VER) -/* C4305: 'initializing': truncation from '__int64' to 'const double' */ -COMPILER_WARNING_IGNORED(4305) -#endif -static const double TIMESPEC_SEC_MAX_as_double = TIMESPEC_SEC_MAX; -COMPILER_WARNING_POP - -static inline rb_hrtime_t * -double2hrtime(rb_hrtime_t *hrt, double d) -{ - /* assume timespec.tv_sec has same signedness as time_t */ - const double TIMESPEC_SEC_MAX_PLUS_ONE = 2.0 * (TIMESPEC_SEC_MAX_as_double / 2.0 + 1.0); - - if (TIMESPEC_SEC_MAX_PLUS_ONE <= d) { - *hrt = RB_HRTIME_MAX; - return NULL; - } - else if (d <= 0) { - *hrt = 0; - } - else { - *hrt = (rb_hrtime_t)(d * (double)RB_HRTIME_PER_SEC); - } - return hrt; -} - -static inline double -hrtime2double(rb_hrtime_t hrt) -{ - return (double)hrt / (double)RB_HRTIME_PER_SEC; -} - -#endif /* RB_HRTIME_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id.h deleted file mode 100644 index 32afa0f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id.h +++ /dev/null @@ -1,347 +0,0 @@ -/* DO NOT EDIT THIS FILE DIRECTLY */ -/********************************************************************** - - id.h - - - $Author$ - created at: Sun Oct 19 21:12:51 2008 - - Copyright (C) 2007 Koichi Sasada - -**********************************************************************/ - -#ifndef RUBY_ID_H -#define RUBY_ID_H - -enum ruby_id_types { - RUBY_ID_STATIC_SYM = 0x01, - RUBY_ID_LOCAL = 0x00, - RUBY_ID_INSTANCE = (0x01<<1), - RUBY_ID_GLOBAL = (0x03<<1), - RUBY_ID_ATTRSET = (0x04<<1), - RUBY_ID_CONST = (0x05<<1), - RUBY_ID_CLASS = (0x06<<1), - RUBY_ID_JUNK = (0x07<<1), - RUBY_ID_INTERNAL = RUBY_ID_JUNK, - RUBY_ID_SCOPE_SHIFT = 4, - RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1) -}; - -#define ID_STATIC_SYM RUBY_ID_STATIC_SYM -#define ID_SCOPE_SHIFT RUBY_ID_SCOPE_SHIFT -#define ID_SCOPE_MASK RUBY_ID_SCOPE_MASK -#define ID_LOCAL RUBY_ID_LOCAL -#define ID_INSTANCE RUBY_ID_INSTANCE -#define ID_GLOBAL RUBY_ID_GLOBAL -#define ID_ATTRSET RUBY_ID_ATTRSET -#define ID_CONST RUBY_ID_CONST -#define ID_CLASS RUBY_ID_CLASS -#define ID_JUNK RUBY_ID_JUNK -#define ID_INTERNAL RUBY_ID_INTERNAL - -#define symIFUNC ID2SYM(idIFUNC) -#define symCFUNC ID2SYM(idCFUNC) - -#define RUBY_TOKEN_DOT2 128 -#define RUBY_TOKEN_DOT3 129 -#define RUBY_TOKEN_BDOT2 130 -#define RUBY_TOKEN_BDOT3 131 -#define RUBY_TOKEN_UPLUS 132 -#define RUBY_TOKEN_UMINUS 133 -#define RUBY_TOKEN_POW 134 -#define RUBY_TOKEN_CMP 135 -#define RUBY_TOKEN_LSHFT 136 -#define RUBY_TOKEN_RSHFT 137 -#define RUBY_TOKEN_LEQ 138 -#define RUBY_TOKEN_GEQ 139 -#define RUBY_TOKEN_EQ 140 -#define RUBY_TOKEN_EQQ 141 -#define RUBY_TOKEN_NEQ 142 -#define RUBY_TOKEN_MATCH 143 -#define RUBY_TOKEN_NMATCH 144 -#define RUBY_TOKEN_AREF 145 -#define RUBY_TOKEN_ASET 146 -#define RUBY_TOKEN_COLON2 147 -#define RUBY_TOKEN_ANDOP 148 -#define RUBY_TOKEN_OROP 149 -#define RUBY_TOKEN_ANDDOT 150 -#define RUBY_TOKEN(t) RUBY_TOKEN_##t - -#define RUBY_TOKEN2ID_TYPE(tok, type) ((tok<> ID_SCOPE_SHIFT -}; - -#endif /* RUBY_ID_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id_table.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id_table.h deleted file mode 100644 index f72e2d1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id_table.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef RUBY_ID_TABLE_H -#define RUBY_ID_TABLE_H 1 -#include "ruby/internal/config.h" -#include -#include "ruby/ruby.h" - -struct rb_id_table; - -/* compatible with ST_* */ -enum rb_id_table_iterator_result { - ID_TABLE_CONTINUE = ST_CONTINUE, - ID_TABLE_STOP = ST_STOP, - ID_TABLE_DELETE = ST_DELETE, - ID_TABLE_REPLACE = ST_REPLACE, - ID_TABLE_ITERATOR_RESULT_END -}; - -struct rb_id_table *rb_id_table_create(size_t size); -void rb_id_table_free(struct rb_id_table *tbl); -void rb_id_table_clear(struct rb_id_table *tbl); - -size_t rb_id_table_memsize(const struct rb_id_table *tbl); - -int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val); -int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp); -int rb_id_table_delete(struct rb_id_table *tbl, ID id); - -typedef enum rb_id_table_iterator_result rb_id_table_update_value_callback_func_t(VALUE *val, void *data, int existing); -typedef enum rb_id_table_iterator_result rb_id_table_foreach_func_t(ID id, VALUE val, void *data); -typedef enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t(VALUE val, void *data); -void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data); -void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data); -void rb_id_table_foreach_values_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, rb_id_table_update_value_callback_func_t *replace, void *data); - -RUBY_SYMBOL_EXPORT_BEGIN -size_t rb_id_table_size(const struct rb_id_table *tbl); -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_ID_TABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns.inc deleted file mode 100644 index ebec10f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns.inc +++ /dev/null @@ -1,265 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file contains YARV instruction list. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/insns.inc.erb" - or tool/insns2vm.rb - */ - -/* BIN : Basic Instruction Name */ -#define BIN(n) YARVINSN_##n - -enum ruby_vminsn_type { - BIN(nop), - BIN(getlocal), - BIN(setlocal), - BIN(getblockparam), - BIN(setblockparam), - BIN(getblockparamproxy), - BIN(getspecial), - BIN(setspecial), - BIN(getinstancevariable), - BIN(setinstancevariable), - BIN(getclassvariable), - BIN(setclassvariable), - BIN(opt_getconstant_path), - BIN(getconstant), - BIN(setconstant), - BIN(getglobal), - BIN(setglobal), - BIN(putnil), - BIN(putself), - BIN(putobject), - BIN(putspecialobject), - BIN(putstring), - BIN(putchilledstring), - BIN(concatstrings), - BIN(anytostring), - BIN(toregexp), - BIN(intern), - BIN(newarray), - BIN(pushtoarraykwsplat), - BIN(duparray), - BIN(duphash), - BIN(expandarray), - BIN(concatarray), - BIN(concattoarray), - BIN(pushtoarray), - BIN(splatarray), - BIN(splatkw), - BIN(newhash), - BIN(newrange), - BIN(pop), - BIN(dup), - BIN(dupn), - BIN(swap), - BIN(opt_reverse), - BIN(topn), - BIN(setn), - BIN(adjuststack), - BIN(defined), - BIN(definedivar), - BIN(checkmatch), - BIN(checkkeyword), - BIN(checktype), - BIN(defineclass), - BIN(definemethod), - BIN(definesmethod), - BIN(send), - BIN(sendforward), - BIN(opt_send_without_block), - BIN(objtostring), - BIN(opt_ary_freeze), - BIN(opt_hash_freeze), - BIN(opt_str_freeze), - BIN(opt_nil_p), - BIN(opt_str_uminus), - BIN(opt_newarray_send), - BIN(invokesuper), - BIN(invokesuperforward), - BIN(invokeblock), - BIN(leave), - BIN(throw), - BIN(jump), - BIN(branchif), - BIN(branchunless), - BIN(branchnil), - BIN(once), - BIN(opt_case_dispatch), - BIN(opt_plus), - BIN(opt_minus), - BIN(opt_mult), - BIN(opt_div), - BIN(opt_mod), - BIN(opt_eq), - BIN(opt_neq), - BIN(opt_lt), - BIN(opt_le), - BIN(opt_gt), - BIN(opt_ge), - BIN(opt_ltlt), - BIN(opt_and), - BIN(opt_or), - BIN(opt_aref), - BIN(opt_aset), - BIN(opt_aset_with), - BIN(opt_aref_with), - BIN(opt_length), - BIN(opt_size), - BIN(opt_empty_p), - BIN(opt_succ), - BIN(opt_not), - BIN(opt_regexpmatch2), - BIN(invokebuiltin), - BIN(opt_invokebuiltin_delegate), - BIN(opt_invokebuiltin_delegate_leave), - BIN(getlocal_WC_0), - BIN(getlocal_WC_1), - BIN(setlocal_WC_0), - BIN(setlocal_WC_1), - BIN(putobject_INT2FIX_0_), - BIN(putobject_INT2FIX_1_), - BIN(trace_nop), - BIN(trace_getlocal), - BIN(trace_setlocal), - BIN(trace_getblockparam), - BIN(trace_setblockparam), - BIN(trace_getblockparamproxy), - BIN(trace_getspecial), - BIN(trace_setspecial), - BIN(trace_getinstancevariable), - BIN(trace_setinstancevariable), - BIN(trace_getclassvariable), - BIN(trace_setclassvariable), - BIN(trace_opt_getconstant_path), - BIN(trace_getconstant), - BIN(trace_setconstant), - BIN(trace_getglobal), - BIN(trace_setglobal), - BIN(trace_putnil), - BIN(trace_putself), - BIN(trace_putobject), - BIN(trace_putspecialobject), - BIN(trace_putstring), - BIN(trace_putchilledstring), - BIN(trace_concatstrings), - BIN(trace_anytostring), - BIN(trace_toregexp), - BIN(trace_intern), - BIN(trace_newarray), - BIN(trace_pushtoarraykwsplat), - BIN(trace_duparray), - BIN(trace_duphash), - BIN(trace_expandarray), - BIN(trace_concatarray), - BIN(trace_concattoarray), - BIN(trace_pushtoarray), - BIN(trace_splatarray), - BIN(trace_splatkw), - BIN(trace_newhash), - BIN(trace_newrange), - BIN(trace_pop), - BIN(trace_dup), - BIN(trace_dupn), - BIN(trace_swap), - BIN(trace_opt_reverse), - BIN(trace_topn), - BIN(trace_setn), - BIN(trace_adjuststack), - BIN(trace_defined), - BIN(trace_definedivar), - BIN(trace_checkmatch), - BIN(trace_checkkeyword), - BIN(trace_checktype), - BIN(trace_defineclass), - BIN(trace_definemethod), - BIN(trace_definesmethod), - BIN(trace_send), - BIN(trace_sendforward), - BIN(trace_opt_send_without_block), - BIN(trace_objtostring), - BIN(trace_opt_ary_freeze), - BIN(trace_opt_hash_freeze), - BIN(trace_opt_str_freeze), - BIN(trace_opt_nil_p), - BIN(trace_opt_str_uminus), - BIN(trace_opt_newarray_send), - BIN(trace_invokesuper), - BIN(trace_invokesuperforward), - BIN(trace_invokeblock), - BIN(trace_leave), - BIN(trace_throw), - BIN(trace_jump), - BIN(trace_branchif), - BIN(trace_branchunless), - BIN(trace_branchnil), - BIN(trace_once), - BIN(trace_opt_case_dispatch), - BIN(trace_opt_plus), - BIN(trace_opt_minus), - BIN(trace_opt_mult), - BIN(trace_opt_div), - BIN(trace_opt_mod), - BIN(trace_opt_eq), - BIN(trace_opt_neq), - BIN(trace_opt_lt), - BIN(trace_opt_le), - BIN(trace_opt_gt), - BIN(trace_opt_ge), - BIN(trace_opt_ltlt), - BIN(trace_opt_and), - BIN(trace_opt_or), - BIN(trace_opt_aref), - BIN(trace_opt_aset), - BIN(trace_opt_aset_with), - BIN(trace_opt_aref_with), - BIN(trace_opt_length), - BIN(trace_opt_size), - BIN(trace_opt_empty_p), - BIN(trace_opt_succ), - BIN(trace_opt_not), - BIN(trace_opt_regexpmatch2), - BIN(trace_invokebuiltin), - BIN(trace_opt_invokebuiltin_delegate), - BIN(trace_opt_invokebuiltin_delegate_leave), - BIN(trace_getlocal_WC_0), - BIN(trace_getlocal_WC_1), - BIN(trace_setlocal_WC_0), - BIN(trace_setlocal_WC_1), - BIN(trace_putobject_INT2FIX_0_), - BIN(trace_putobject_INT2FIX_1_), - VM_INSTRUCTION_SIZE -}; - -#define ASSERT_VM_INSTRUCTION_SIZE(array) \ - STATIC_ASSERT(numberof_##array, numberof(array) == VM_INSTRUCTION_SIZE) diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns_info.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns_info.inc deleted file mode 100644 index 706067c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns_info.inc +++ /dev/null @@ -1,9902 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file contains instruction information for yarv instruction sequence.. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/insns_info.inc.erb" - or tool/insns2vm.rb - */ - -enum ruby_insn_type_chars { - TS_VARIABLE = '.', - TS_CALLDATA = 'C', - TS_CDHASH = 'H', - TS_IC = 'K', - TS_IVC = 'A', - TS_ICVARC = 'J', - TS_ID = 'I', - TS_ISE = 'T', - TS_ISEQ = 'S', - TS_OFFSET = 'O', - TS_VALUE = 'V', - TS_LINDEX = 'L', - TS_FUNCPTR = 'F', - TS_NUM = 'N', - TS_BUILTIN = 'R', -}; - -static inline union iseq_inline_storage_entry * -ISEQ_IS_ENTRY_START(const struct rb_iseq_constant_body *body, char op_type) -{ - unsigned int relative_ic_offset = 0; - switch (op_type) { - case TS_IC: - relative_ic_offset += body->ise_size; - case TS_ISE: - relative_ic_offset += body->icvarc_size; - case TS_ICVARC: - relative_ic_offset += body->ivc_size; - case TS_IVC: - break; - default: - rb_bug("Wrong op type"); - } - return &body->is_entries[relative_ic_offset]; -} - -CONSTFUNC(MAYBE_UNUSED(static const char *insn_name(VALUE insn))); - -RUBY_SYMBOL_EXPORT_BEGIN /* for debuggers */ -extern const int rb_vm_max_insn_name_size; -extern const char rb_vm_insn_name_base[]; -extern const unsigned short rb_vm_insn_name_offset[VM_INSTRUCTION_SIZE]; -RUBY_SYMBOL_EXPORT_END - -#ifdef RUBY_VM_INSNS_INFO -const int rb_vm_max_insn_name_size = 38; - -const char rb_vm_insn_name_base[] = - "nop" "\0" - "getlocal" "\0" - "setlocal" "\0" - "getblockparam" "\0" - "setblockparam" "\0" - "getblockparamproxy" "\0" - "getspecial" "\0" - "setspecial" "\0" - "getinstancevariable" "\0" - "setinstancevariable" "\0" - "getclassvariable" "\0" - "setclassvariable" "\0" - "opt_getconstant_path" "\0" - "getconstant" "\0" - "setconstant" "\0" - "getglobal" "\0" - "setglobal" "\0" - "putnil" "\0" - "putself" "\0" - "putobject" "\0" - "putspecialobject" "\0" - "putstring" "\0" - "putchilledstring" "\0" - "concatstrings" "\0" - "anytostring" "\0" - "toregexp" "\0" - "intern" "\0" - "newarray" "\0" - "pushtoarraykwsplat" "\0" - "duparray" "\0" - "duphash" "\0" - "expandarray" "\0" - "concatarray" "\0" - "concattoarray" "\0" - "pushtoarray" "\0" - "splatarray" "\0" - "splatkw" "\0" - "newhash" "\0" - "newrange" "\0" - "pop" "\0" - "dup" "\0" - "dupn" "\0" - "swap" "\0" - "opt_reverse" "\0" - "topn" "\0" - "setn" "\0" - "adjuststack" "\0" - "defined" "\0" - "definedivar" "\0" - "checkmatch" "\0" - "checkkeyword" "\0" - "checktype" "\0" - "defineclass" "\0" - "definemethod" "\0" - "definesmethod" "\0" - "send" "\0" - "sendforward" "\0" - "opt_send_without_block" "\0" - "objtostring" "\0" - "opt_ary_freeze" "\0" - "opt_hash_freeze" "\0" - "opt_str_freeze" "\0" - "opt_nil_p" "\0" - "opt_str_uminus" "\0" - "opt_newarray_send" "\0" - "invokesuper" "\0" - "invokesuperforward" "\0" - "invokeblock" "\0" - "leave" "\0" - "throw" "\0" - "jump" "\0" - "branchif" "\0" - "branchunless" "\0" - "branchnil" "\0" - "once" "\0" - "opt_case_dispatch" "\0" - "opt_plus" "\0" - "opt_minus" "\0" - "opt_mult" "\0" - "opt_div" "\0" - "opt_mod" "\0" - "opt_eq" "\0" - "opt_neq" "\0" - "opt_lt" "\0" - "opt_le" "\0" - "opt_gt" "\0" - "opt_ge" "\0" - "opt_ltlt" "\0" - "opt_and" "\0" - "opt_or" "\0" - "opt_aref" "\0" - "opt_aset" "\0" - "opt_aset_with" "\0" - "opt_aref_with" "\0" - "opt_length" "\0" - "opt_size" "\0" - "opt_empty_p" "\0" - "opt_succ" "\0" - "opt_not" "\0" - "opt_regexpmatch2" "\0" - "invokebuiltin" "\0" - "opt_invokebuiltin_delegate" "\0" - "opt_invokebuiltin_delegate_leave" "\0" - "getlocal_WC_0" "\0" - "getlocal_WC_1" "\0" - "setlocal_WC_0" "\0" - "setlocal_WC_1" "\0" - "putobject_INT2FIX_0_" "\0" - "putobject_INT2FIX_1_" "\0" - "trace_nop" "\0" - "trace_getlocal" "\0" - "trace_setlocal" "\0" - "trace_getblockparam" "\0" - "trace_setblockparam" "\0" - "trace_getblockparamproxy" "\0" - "trace_getspecial" "\0" - "trace_setspecial" "\0" - "trace_getinstancevariable" "\0" - "trace_setinstancevariable" "\0" - "trace_getclassvariable" "\0" - "trace_setclassvariable" "\0" - "trace_opt_getconstant_path" "\0" - "trace_getconstant" "\0" - "trace_setconstant" "\0" - "trace_getglobal" "\0" - "trace_setglobal" "\0" - "trace_putnil" "\0" - "trace_putself" "\0" - "trace_putobject" "\0" - "trace_putspecialobject" "\0" - "trace_putstring" "\0" - "trace_putchilledstring" "\0" - "trace_concatstrings" "\0" - "trace_anytostring" "\0" - "trace_toregexp" "\0" - "trace_intern" "\0" - "trace_newarray" "\0" - "trace_pushtoarraykwsplat" "\0" - "trace_duparray" "\0" - "trace_duphash" "\0" - "trace_expandarray" "\0" - "trace_concatarray" "\0" - "trace_concattoarray" "\0" - "trace_pushtoarray" "\0" - "trace_splatarray" "\0" - "trace_splatkw" "\0" - "trace_newhash" "\0" - "trace_newrange" "\0" - "trace_pop" "\0" - "trace_dup" "\0" - "trace_dupn" "\0" - "trace_swap" "\0" - "trace_opt_reverse" "\0" - "trace_topn" "\0" - "trace_setn" "\0" - "trace_adjuststack" "\0" - "trace_defined" "\0" - "trace_definedivar" "\0" - "trace_checkmatch" "\0" - "trace_checkkeyword" "\0" - "trace_checktype" "\0" - "trace_defineclass" "\0" - "trace_definemethod" "\0" - "trace_definesmethod" "\0" - "trace_send" "\0" - "trace_sendforward" "\0" - "trace_opt_send_without_block" "\0" - "trace_objtostring" "\0" - "trace_opt_ary_freeze" "\0" - "trace_opt_hash_freeze" "\0" - "trace_opt_str_freeze" "\0" - "trace_opt_nil_p" "\0" - "trace_opt_str_uminus" "\0" - "trace_opt_newarray_send" "\0" - "trace_invokesuper" "\0" - "trace_invokesuperforward" "\0" - "trace_invokeblock" "\0" - "trace_leave" "\0" - "trace_throw" "\0" - "trace_jump" "\0" - "trace_branchif" "\0" - "trace_branchunless" "\0" - "trace_branchnil" "\0" - "trace_once" "\0" - "trace_opt_case_dispatch" "\0" - "trace_opt_plus" "\0" - "trace_opt_minus" "\0" - "trace_opt_mult" "\0" - "trace_opt_div" "\0" - "trace_opt_mod" "\0" - "trace_opt_eq" "\0" - "trace_opt_neq" "\0" - "trace_opt_lt" "\0" - "trace_opt_le" "\0" - "trace_opt_gt" "\0" - "trace_opt_ge" "\0" - "trace_opt_ltlt" "\0" - "trace_opt_and" "\0" - "trace_opt_or" "\0" - "trace_opt_aref" "\0" - "trace_opt_aset" "\0" - "trace_opt_aset_with" "\0" - "trace_opt_aref_with" "\0" - "trace_opt_length" "\0" - "trace_opt_size" "\0" - "trace_opt_empty_p" "\0" - "trace_opt_succ" "\0" - "trace_opt_not" "\0" - "trace_opt_regexpmatch2" "\0" - "trace_invokebuiltin" "\0" - "trace_opt_invokebuiltin_delegate" "\0" - "trace_opt_invokebuiltin_delegate_leave" "\0" - "trace_getlocal_WC_0" "\0" - "trace_getlocal_WC_1" "\0" - "trace_setlocal_WC_0" "\0" - "trace_setlocal_WC_1" "\0" - "trace_putobject_INT2FIX_0_" "\0" - "trace_putobject_INT2FIX_1_" "\0" - ; - -const unsigned short rb_vm_insn_name_offset[] = { - 0, 4, 13, 22, 36, 50, 69, 80, 91, 111, 131, 148, - 165, 186, 198, 210, 220, 230, 237, 245, 255, 272, 282, 299, - 313, 325, 334, 341, 350, 369, 378, 386, 398, 410, 424, 436, - 447, 455, 463, 472, 476, 480, 485, 490, 502, 507, 512, 524, - 532, 544, 555, 568, 578, 590, 603, 617, 622, 634, 657, 669, - 684, 700, 715, 725, 740, 758, 770, 789, 801, 807, 813, 818, - 827, 840, 850, 855, 873, 882, 892, 901, 909, 917, 924, 932, - 939, 946, 953, 960, 969, 977, 984, 993, 1002, 1016, 1030, 1041, - 1050, 1062, 1071, 1079, 1096, 1110, 1137, 1170, 1184, 1198, 1212, 1226, - 1247, 1268, 1278, 1293, 1308, 1328, 1348, 1373, 1390, 1407, 1433, 1459, - 1482, 1505, 1532, 1550, 1568, 1584, 1600, 1613, 1627, 1643, 1666, 1682, - 1705, 1725, 1743, 1758, 1771, 1786, 1811, 1826, 1840, 1858, 1876, 1896, - 1914, 1931, 1945, 1959, 1974, 1984, 1994, 2005, 2016, 2034, 2045, 2056, - 2074, 2088, 2106, 2123, 2142, 2158, 2176, 2195, 2215, 2226, 2244, 2273, - 2291, 2312, 2334, 2355, 2371, 2392, 2416, 2434, 2459, 2477, 2489, 2501, - 2512, 2527, 2546, 2562, 2573, 2597, 2612, 2628, 2643, 2657, 2671, 2684, - 2698, 2711, 2724, 2737, 2750, 2765, 2779, 2792, 2807, 2822, 2842, 2862, - 2879, 2894, 2912, 2927, 2941, 2964, 2984, 3017, 3056, 3076, 3096, 3116, - 3136, 3163, -}; - -ASSERT_VM_INSTRUCTION_SIZE(rb_vm_insn_name_offset); -#endif - -const char * -insn_name(VALUE i) -{ - return &rb_vm_insn_name_base[rb_vm_insn_name_offset[i]]; -} - -CONSTFUNC(MAYBE_UNUSED(static int insn_len(VALUE insn))); - -RUBY_SYMBOL_EXPORT_BEGIN /* for debuggers */ -extern const uint8_t rb_vm_insn_len_info[VM_INSTRUCTION_SIZE]; -RUBY_SYMBOL_EXPORT_END - -#ifdef RUBY_VM_INSNS_INFO -const uint8_t rb_vm_insn_len_info[] = { - 1, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, - 2, 1, 3, 1, 2, 1, 2, 2, 3, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, - 2, 4, 4, 2, 3, 2, 4, 3, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 3, 3, 3, 2, 1, - 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 1, 1, 1, 3, 3, 3, 3, 3, - 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 3, 1, 2, 1, - 2, 2, 3, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 4, 4, 2, 3, 2, - 4, 3, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 3, 3, 3, 2, 1, 2, 2, 2, 2, 2, 3, - 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, - 2, 2, 2, 3, 3, 2, 2, 2, 2, 1, 1, -}; - -ASSERT_VM_INSTRUCTION_SIZE(rb_vm_insn_len_info); -#endif - -int -insn_len(VALUE i) -{ - return rb_vm_insn_len_info[i]; -} - -CONSTFUNC(MAYBE_UNUSED(static const char *insn_op_types(VALUE insn))); -CONSTFUNC(MAYBE_UNUSED(static int insn_op_type(VALUE insn, long pos))); - -RUBY_SYMBOL_EXPORT_BEGIN /* for debuggers */ -extern const char rb_vm_insn_op_base[]; -extern const unsigned short rb_vm_insn_op_offset[VM_INSTRUCTION_SIZE]; -RUBY_SYMBOL_EXPORT_END - -#ifdef RUBY_VM_INSNS_INFO -const char rb_vm_insn_op_base[] = - "" "\0" "LN" "\0" "LN" "\0" "LN" "\0" "LN" "\0" - "LN" "\0" "NN" "\0" "N" "\0" "IA" "\0" "IA" "\0" - "IJ" "\0" "IJ" "\0" "K" "\0" "I" "\0" "I" "\0" - "I" "\0" "I" "\0" "" "\0" "" "\0" "V" "\0" - "N" "\0" "V" "\0" "V" "\0" "N" "\0" "" "\0" - "NN" "\0" "" "\0" "N" "\0" "" "\0" "V" "\0" - "V" "\0" "NN" "\0" "" "\0" "" "\0" "N" "\0" - "V" "\0" "" "\0" "N" "\0" "N" "\0" "" "\0" - "" "\0" "N" "\0" "" "\0" "N" "\0" "N" "\0" - "N" "\0" "N" "\0" "NVV" "\0" "IAV" "\0" "N" "\0" - "LL" "\0" "N" "\0" "ISN" "\0" "IS" "\0" "IS" "\0" - "CS" "\0" "CS" "\0" "C" "\0" "C" "\0" "VC" "\0" - "VC" "\0" "VC" "\0" "C" "\0" "VC" "\0" "NN" "\0" - "CS" "\0" "CS" "\0" "C" "\0" "" "\0" "N" "\0" - "O" "\0" "O" "\0" "O" "\0" "O" "\0" "ST" "\0" - "HO" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "CC" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "VC" "\0" "VC" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "R" "\0" "RN" "\0" "RN" "\0" "L" "\0" "L" "\0" - "L" "\0" "L" "\0" "" "\0" "" "\0" "" "\0" - "LN" "\0" "LN" "\0" "LN" "\0" "LN" "\0" "LN" "\0" - "NN" "\0" "N" "\0" "IA" "\0" "IA" "\0" "IJ" "\0" - "IJ" "\0" "K" "\0" "I" "\0" "I" "\0" "I" "\0" - "I" "\0" "" "\0" "" "\0" "V" "\0" "N" "\0" - "V" "\0" "V" "\0" "N" "\0" "" "\0" "NN" "\0" - "" "\0" "N" "\0" "" "\0" "V" "\0" "V" "\0" - "NN" "\0" "" "\0" "" "\0" "N" "\0" "V" "\0" - "" "\0" "N" "\0" "N" "\0" "" "\0" "" "\0" - "N" "\0" "" "\0" "N" "\0" "N" "\0" "N" "\0" - "N" "\0" "NVV" "\0" "IAV" "\0" "N" "\0" "LL" "\0" - "N" "\0" "ISN" "\0" "IS" "\0" "IS" "\0" "CS" "\0" - "CS" "\0" "C" "\0" "C" "\0" "VC" "\0" "VC" "\0" - "VC" "\0" "C" "\0" "VC" "\0" "NN" "\0" "CS" "\0" - "CS" "\0" "C" "\0" "" "\0" "N" "\0" "O" "\0" - "O" "\0" "O" "\0" "O" "\0" "ST" "\0" "HO" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "CC" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "C" "\0" - "C" "\0" "VC" "\0" "VC" "\0" "C" "\0" "C" "\0" - "C" "\0" "C" "\0" "C" "\0" "C" "\0" "R" "\0" - "RN" "\0" "RN" "\0" "L" "\0" "L" "\0" "L" "\0" - "L" "\0" "" "\0" "" "\0" - ; - -const unsigned short rb_vm_insn_op_offset[] = { - 0, 1, 4, 7, 10, 13, 16, 19, 21, 24, 27, 30, - 33, 35, 37, 39, 41, 43, 44, 45, 47, 49, 51, 53, - 55, 56, 59, 60, 62, 63, 65, 67, 70, 71, 72, 74, - 76, 77, 79, 81, 82, 83, 85, 86, 88, 90, 92, 94, - 98, 102, 104, 107, 109, 113, 116, 119, 122, 125, 127, 129, - 132, 135, 138, 140, 143, 146, 149, 152, 154, 155, 157, 159, - 161, 163, 165, 168, 171, 173, 175, 177, 179, 181, 183, 186, - 188, 190, 192, 194, 196, 198, 200, 202, 204, 207, 210, 212, - 214, 216, 218, 220, 222, 224, 227, 230, 232, 234, 236, 238, - 239, 240, 241, 244, 247, 250, 253, 256, 259, 261, 264, 267, - 270, 273, 275, 277, 279, 281, 283, 284, 285, 287, 289, 291, - 293, 295, 296, 299, 300, 302, 303, 305, 307, 310, 311, 312, - 314, 316, 317, 319, 321, 322, 323, 325, 326, 328, 330, 332, - 334, 338, 342, 344, 347, 349, 353, 356, 359, 362, 365, 367, - 369, 372, 375, 378, 380, 383, 386, 389, 392, 394, 395, 397, - 399, 401, 403, 405, 408, 411, 413, 415, 417, 419, 421, 423, - 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 447, 450, - 452, 454, 456, 458, 460, 462, 464, 467, 470, 472, 474, 476, - 478, 479, -}; - -ASSERT_VM_INSTRUCTION_SIZE(rb_vm_insn_op_offset); -#endif - -const char * -insn_op_types(VALUE i) -{ - return &rb_vm_insn_op_base[rb_vm_insn_op_offset[i]]; -} - -int -insn_op_type(VALUE i, long j) -{ - if (j >= insn_len(i)) { - return 0; - } - else { - return insn_op_types(i)[j]; - } -} - -#line 10 "tool/ruby_vm/views/_leaf_helpers.erb" - -#include "iseq.h" - -// This is used to tell RJIT that this insn would be leaf if CHECK_INTS didn't exist. -// It should be used only when RUBY_VM_CHECK_INTS is directly written in insns.def. -static bool leafness_of_check_ints = false; - -static bool -leafness_of_defined(rb_num_t op_type) -{ - /* see also: vm_insnhelper.c:vm_defined() */ - switch (op_type) { - case DEFINED_IVAR: - case DEFINED_GVAR: - case DEFINED_CVAR: - case DEFINED_YIELD: - case DEFINED_REF: - case DEFINED_ZSUPER: - return false; - case DEFINED_CONST: - case DEFINED_CONST_FROM: - /* has rb_autoload_load(); */ - return false; - case DEFINED_FUNC: - case DEFINED_METHOD: - /* calls #respond_to_missing? */ - return false; - default: - rb_bug("unknown operand %ld: blame @shyouhei.", op_type); - } -} - -static bool -leafness_of_checkmatch(rb_num_t flag) -{ - /* see also: vm_insnhelper.c:check_match() */ - if (flag == VM_CHECKMATCH_TYPE_WHEN) { - return true; - } - else { - /* has rb_funcallv() */ - return false; - } -} -#line 512 "insns_info.inc" - -#line 10 "tool/ruby_vm/views/_sp_inc_helpers.erb" - -static rb_snum_t -sp_inc_of_sendish(const struct rb_callinfo *ci) -{ - /* Send-ish instructions will: - * - * 1. Pop block argument, if any. - * 2. Pop ordinal arguments. - * 3. Pop receiver. - * 4. Push return value. - */ - const int argb = (vm_ci_flag(ci) & (VM_CALL_ARGS_BLOCKARG | VM_CALL_FORWARDING)) ? 1 : 0; - const int argc = vm_ci_argc(ci); - const int recv = 1; - const int retn = 1; - - /* 1. 2. 3. 4. */ - return 0 - argb - argc - recv + retn; -} - -static rb_snum_t -sp_inc_of_invokeblock(const struct rb_callinfo *ci) -{ - /* sp_inc of invokeblock is almost identical to that of sendish - * instructions, except that it does not pop receiver. */ - return sp_inc_of_sendish(ci) + 1; -} -#line 542 "insns_info.inc" - -#ifndef RUBY_VM_EXEC_H -/* can't #include "vm_exec.h" here... */ -typedef long OFFSET; -typedef unsigned long lindex_t; -typedef VALUE GENTRY; -typedef rb_iseq_t *ISEQ; -#endif - -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_nop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_nop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_nop(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_nop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_nop(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setlocal(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setblockparam(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getblockparamproxy(lindex_t idx, rb_num_t level))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getspecial(rb_num_t key, rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setspecial(rb_num_t key))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setinstancevariable(ID id, IVC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setclassvariable(ID id, ICVARC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_getconstant_path(IC ic))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setconstant(ID id))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setglobal(ID gid))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putnil(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putself(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putself(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putself(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putself(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putself(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putobject(VALUE val))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putspecialobject(rb_num_t value_type))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putchilledstring(VALUE str))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_concatstrings(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_anytostring(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_toregexp(rb_num_t opt, rb_num_t cnt))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_intern(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_intern(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_intern(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_intern(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_intern(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_pushtoarraykwsplat(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_duparray(VALUE ary))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_duphash(VALUE hash))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_expandarray(rb_num_t num, rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_concatarray(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_concattoarray(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_pushtoarray(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_splatarray(VALUE flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_splatkw(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newhash(rb_num_t num))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_newrange(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_pop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_pop(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_pop(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_pop(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_pop(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_dup(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_dup(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_dup(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_dup(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_dup(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_dupn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_swap(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_swap(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_swap(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_swap(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_swap(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_reverse(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_topn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setn(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_adjuststack(rb_num_t n))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_defined(rb_num_t op_type, VALUE obj, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_definedivar(ID id, IVC ic, VALUE pushval))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_checkmatch(rb_num_t flag))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_checkkeyword(lindex_t kw_bits_index, lindex_t keyword_index))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_checktype(rb_num_t type))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_defineclass(ID id, ISEQ class_iseq, rb_num_t flags))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_definemethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_definesmethod(ID id, ISEQ iseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_send(CALL_INFO ci, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_send(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_sendforward(CALL_INFO ci, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_sendforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_opt_send_without_block(CALL_INFO ci))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_send_without_block(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_objtostring(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_ary_freeze(VALUE ary, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_hash_freeze(VALUE hash, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_str_freeze(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_nil_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_str_uminus(VALUE str, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_newarray_send(rb_num_t num, rb_num_t method))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_invokesuper(CALL_INFO ci, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokesuper(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_invokesuperforward(CALL_INFO ci, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokesuperforward(CALL_DATA cd, ISEQ blockiseq))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_comptime_sp_inc_invokeblock(CALL_INFO ci))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokeblock(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_leave(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_leave(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_leave(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_leave(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_leave(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_throw(rb_num_t throw_state))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_jump(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_branchif(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_branchunless(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_branchnil(OFFSET dst))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_once(ISEQ iseq, ISE ise))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_case_dispatch(CDHASH hash, OFFSET else_offset))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_plus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_minus(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_mult(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_div(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_mod(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_eq(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_neq(CALL_DATA cd_eq, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_lt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_le(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_gt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_ge(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_ltlt(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_and(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_or(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aref(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aset(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aset_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_aref_with(VALUE key, CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_length(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_size(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_empty_p(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_succ(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_not(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_regexpmatch2(CALL_DATA cd))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_invokebuiltin(RB_BUILTIN bf))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_invokebuiltin_delegate(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_opt_invokebuiltin_delegate_leave(RB_BUILTIN bf, rb_num_t index))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_getlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setlocal_WC_0(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_setlocal_WC_1(lindex_t idx))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putobject_INT2FIX_0_(void))); -PUREFUNC(MAYBE_UNUSED(static enum ruby_vminsn_type attr_bin_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_handles_sp_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static bool attr_leaf_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static const char* attr_name_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_open_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_popn_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_retn_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_snum_t attr_sp_inc_putobject_INT2FIX_1_(void))); -PUREFUNC(MAYBE_UNUSED(static rb_num_t attr_width_putobject_INT2FIX_1_(void))); - -/* attr enum ruby_vminsn_type bin @ nop()()() */ -enum ruby_vminsn_type -attr_bin_nop(void) -{ - return BIN(nop); -} - -/* attr bool handles_sp @ nop()()() */ -bool -attr_handles_sp_nop(void) -{ - return false; -} - -/* attr bool leaf @ nop()()() */ -bool -attr_leaf_nop(void) -{ - return true; -} - -/* attr const char* name @ nop()()() */ -const char* -attr_name_nop(void) -{ - return insn_name(BIN(nop)); -} - -/* attr rb_num_t open @ nop()()() */ -rb_num_t -attr_open_nop(void) -{ - return 0; -} - -/* attr rb_num_t popn @ nop()()() */ -rb_num_t -attr_popn_nop(void) -{ - return 0; -} - -/* attr rb_num_t retn @ nop()()() */ -rb_num_t -attr_retn_nop(void) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ nop()()() */ -rb_snum_t -attr_sp_inc_nop(void) -{ - return 0; -} - -/* attr rb_num_t width @ nop()()() */ -rb_num_t -attr_width_nop(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ getlocal(idx, level)()(val) */ -enum ruby_vminsn_type -attr_bin_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(getlocal); -} - -/* attr bool handles_sp @ getlocal(idx, level)()(val) */ -bool -attr_handles_sp_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ getlocal(idx, level)()(val) */ -bool -attr_leaf_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ getlocal(idx, level)()(val) */ -const char* -attr_name_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(getlocal)); -} - -/* attr rb_num_t open @ getlocal(idx, level)()(val) */ -rb_num_t -attr_open_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getlocal(idx, level)()(val) */ -rb_num_t -attr_popn_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getlocal(idx, level)()(val) */ -rb_num_t -attr_retn_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getlocal(idx, level)()(val) */ -rb_snum_t -attr_sp_inc_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t width @ getlocal(idx, level)()(val) */ -rb_num_t -attr_width_getlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setlocal(idx, level)(val)() */ -enum ruby_vminsn_type -attr_bin_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(setlocal); -} - -/* attr bool handles_sp @ setlocal(idx, level)(val)() */ -bool -attr_handles_sp_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ setlocal(idx, level)(val)() */ -bool -attr_leaf_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ setlocal(idx, level)(val)() */ -const char* -attr_name_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(setlocal)); -} - -/* attr rb_num_t open @ setlocal(idx, level)(val)() */ -rb_num_t -attr_open_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setlocal(idx, level)(val)() */ -rb_num_t -attr_popn_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setlocal(idx, level)(val)() */ -rb_num_t -attr_retn_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setlocal(idx, level)(val)() */ -rb_snum_t -attr_sp_inc_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return -1; -} - -/* attr rb_num_t width @ setlocal(idx, level)(val)() */ -rb_num_t -attr_width_setlocal( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getblockparam(idx, level)()(val) */ -enum ruby_vminsn_type -attr_bin_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(getblockparam); -} - -/* attr bool handles_sp @ getblockparam(idx, level)()(val) */ -bool -attr_handles_sp_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ getblockparam(idx, level)()(val) */ -bool -attr_leaf_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ getblockparam(idx, level)()(val) */ -const char* -attr_name_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(getblockparam)); -} - -/* attr rb_num_t open @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_open_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_popn_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_retn_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getblockparam(idx, level)()(val) */ -rb_snum_t -attr_sp_inc_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t width @ getblockparam(idx, level)()(val) */ -rb_num_t -attr_width_getblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setblockparam(idx, level)(val)() */ -enum ruby_vminsn_type -attr_bin_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(setblockparam); -} - -/* attr bool handles_sp @ setblockparam(idx, level)(val)() */ -bool -attr_handles_sp_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ setblockparam(idx, level)(val)() */ -bool -attr_leaf_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ setblockparam(idx, level)(val)() */ -const char* -attr_name_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(setblockparam)); -} - -/* attr rb_num_t open @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_open_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_popn_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_retn_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setblockparam(idx, level)(val)() */ -rb_snum_t -attr_sp_inc_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return -1; -} - -/* attr rb_num_t width @ setblockparam(idx, level)(val)() */ -rb_num_t -attr_width_setblockparam( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getblockparamproxy(idx, level)()(val) */ -enum ruby_vminsn_type -attr_bin_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return BIN(getblockparamproxy); -} - -/* attr bool handles_sp @ getblockparamproxy(idx, level)()(val) */ -bool -attr_handles_sp_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return false; -} - -/* attr bool leaf @ getblockparamproxy(idx, level)()(val) */ -bool -attr_leaf_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return true; -} - -/* attr const char* name @ getblockparamproxy(idx, level)()(val) */ -const char* -attr_name_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return insn_name(BIN(getblockparamproxy)); -} - -/* attr rb_num_t open @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_open_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_popn_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_retn_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getblockparamproxy(idx, level)()(val) */ -rb_snum_t -attr_sp_inc_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 1; -} - -/* attr rb_num_t width @ getblockparamproxy(idx, level)()(val) */ -rb_num_t -attr_width_getblockparamproxy( - MAYBE_UNUSED(lindex_t idx), - MAYBE_UNUSED(rb_num_t level) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getspecial(key, type)()(val) */ -enum ruby_vminsn_type -attr_bin_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return BIN(getspecial); -} - -/* attr bool handles_sp @ getspecial(key, type)()(val) */ -bool -attr_handles_sp_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return false; -} - -/* attr bool leaf @ getspecial(key, type)()(val) */ -bool -attr_leaf_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return -#line 192 "insns.def" -(type == 0) ? true : false; -#line 2084 "insns_info.inc" -} - -/* attr const char* name @ getspecial(key, type)()(val) */ -const char* -attr_name_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return insn_name(BIN(getspecial)); -} - -/* attr rb_num_t open @ getspecial(key, type)()(val) */ -rb_num_t -attr_open_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getspecial(key, type)()(val) */ -rb_num_t -attr_popn_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getspecial(key, type)()(val) */ -rb_num_t -attr_retn_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getspecial(key, type)()(val) */ -rb_snum_t -attr_sp_inc_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 1; -} - -/* attr rb_num_t width @ getspecial(key, type)()(val) */ -rb_num_t -attr_width_getspecial( - MAYBE_UNUSED(rb_num_t key), - MAYBE_UNUSED(rb_num_t type) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setspecial(key)(obj)() */ -enum ruby_vminsn_type -attr_bin_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return BIN(setspecial); -} - -/* attr bool handles_sp @ setspecial(key)(obj)() */ -bool -attr_handles_sp_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return false; -} - -/* attr bool leaf @ setspecial(key)(obj)() */ -bool -attr_leaf_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return true; -} - -/* attr const char* name @ setspecial(key)(obj)() */ -const char* -attr_name_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return insn_name(BIN(setspecial)); -} - -/* attr rb_num_t open @ setspecial(key)(obj)() */ -rb_num_t -attr_open_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 1; -} - -/* attr rb_num_t popn @ setspecial(key)(obj)() */ -rb_num_t -attr_popn_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 1; -} - -/* attr rb_num_t retn @ setspecial(key)(obj)() */ -rb_num_t -attr_retn_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setspecial(key)(obj)() */ -rb_snum_t -attr_sp_inc_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return -1; -} - -/* attr rb_num_t width @ setspecial(key)(obj)() */ -rb_num_t -attr_width_setspecial(MAYBE_UNUSED(rb_num_t key)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getinstancevariable(id, ic)()(val) */ -enum ruby_vminsn_type -attr_bin_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return BIN(getinstancevariable); -} - -/* attr bool handles_sp @ getinstancevariable(id, ic)()(val) */ -bool -attr_handles_sp_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return false; -} - -/* attr bool leaf @ getinstancevariable(id, ic)()(val) */ -bool -attr_leaf_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return -#line 214 "insns.def" -false; -#line 2240 "insns_info.inc" -} - -/* attr const char* name @ getinstancevariable(id, ic)()(val) */ -const char* -attr_name_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return insn_name(BIN(getinstancevariable)); -} - -/* attr rb_num_t open @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_open_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_popn_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_retn_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getinstancevariable(id, ic)()(val) */ -rb_snum_t -attr_sp_inc_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 1; -} - -/* attr rb_num_t width @ getinstancevariable(id, ic)()(val) */ -rb_num_t -attr_width_getinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setinstancevariable(id, ic)(val)() */ -enum ruby_vminsn_type -attr_bin_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return BIN(setinstancevariable); -} - -/* attr bool handles_sp @ setinstancevariable(id, ic)(val)() */ -bool -attr_handles_sp_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return false; -} - -/* attr bool leaf @ setinstancevariable(id, ic)(val)() */ -bool -attr_leaf_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return -#line 225 "insns.def" -false; -#line 2333 "insns_info.inc" -} - -/* attr const char* name @ setinstancevariable(id, ic)(val)() */ -const char* -attr_name_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return insn_name(BIN(setinstancevariable)); -} - -/* attr rb_num_t open @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_open_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_popn_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_retn_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setinstancevariable(id, ic)(val)() */ -rb_snum_t -attr_sp_inc_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return -1; -} - -/* attr rb_num_t width @ setinstancevariable(id, ic)(val)() */ -rb_num_t -attr_width_setinstancevariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getclassvariable(id, ic)()(val) */ -enum ruby_vminsn_type -attr_bin_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return BIN(getclassvariable); -} - -/* attr bool handles_sp @ getclassvariable(id, ic)()(val) */ -bool -attr_handles_sp_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return false; -} - -/* attr bool leaf @ getclassvariable(id, ic)()(val) */ -bool -attr_leaf_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return -#line 237 "insns.def" -false; -#line 2426 "insns_info.inc" -} - -/* attr const char* name @ getclassvariable(id, ic)()(val) */ -const char* -attr_name_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return insn_name(BIN(getclassvariable)); -} - -/* attr rb_num_t open @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_open_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_popn_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 0; -} - -/* attr rb_num_t retn @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_retn_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getclassvariable(id, ic)()(val) */ -rb_snum_t -attr_sp_inc_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 1; -} - -/* attr rb_num_t width @ getclassvariable(id, ic)()(val) */ -rb_num_t -attr_width_getclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ setclassvariable(id, ic)(val)() */ -enum ruby_vminsn_type -attr_bin_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return BIN(setclassvariable); -} - -/* attr bool handles_sp @ setclassvariable(id, ic)(val)() */ -bool -attr_handles_sp_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return false; -} - -/* attr bool leaf @ setclassvariable(id, ic)(val)() */ -bool -attr_leaf_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return -#line 250 "insns.def" -false; -#line 2519 "insns_info.inc" -} - -/* attr const char* name @ setclassvariable(id, ic)(val)() */ -const char* -attr_name_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return insn_name(BIN(setclassvariable)); -} - -/* attr rb_num_t open @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_open_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 2; -} - -/* attr rb_num_t popn @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_popn_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 1; -} - -/* attr rb_num_t retn @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_retn_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setclassvariable(id, ic)(val)() */ -rb_snum_t -attr_sp_inc_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return -1; -} - -/* attr rb_num_t width @ setclassvariable(id, ic)(val)() */ -rb_num_t -attr_width_setclassvariable( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ICVARC ic) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_getconstant_path(ic)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return BIN(opt_getconstant_path); -} - -/* attr bool handles_sp @ opt_getconstant_path(ic)()(val) */ -bool -attr_handles_sp_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return false; -} - -/* attr bool leaf @ opt_getconstant_path(ic)()(val) */ -bool -attr_leaf_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return -#line 261 "insns.def" -false; -#line 2603 "insns_info.inc" -} - -/* attr const char* name @ opt_getconstant_path(ic)()(val) */ -const char* -attr_name_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return insn_name(BIN(opt_getconstant_path)); -} - -/* attr rb_num_t open @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_open_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_popn_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_retn_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_getconstant_path(ic)()(val) */ -rb_snum_t -attr_sp_inc_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 1; -} - -/* attr rb_num_t width @ opt_getconstant_path(ic)()(val) */ -rb_num_t -attr_width_opt_getconstant_path(MAYBE_UNUSED(IC ic)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getconstant(id)(klass, allow_nil)(val) */ -enum ruby_vminsn_type -attr_bin_getconstant(MAYBE_UNUSED(ID id)) -{ - return BIN(getconstant); -} - -/* attr bool handles_sp @ getconstant(id)(klass, allow_nil)(val) */ -bool -attr_handles_sp_getconstant(MAYBE_UNUSED(ID id)) -{ - return false; -} - -/* attr bool leaf @ getconstant(id)(klass, allow_nil)(val) */ -bool -attr_leaf_getconstant(MAYBE_UNUSED(ID id)) -{ - return -#line 276 "insns.def" -false; -#line 2669 "insns_info.inc" -} - -/* attr const char* name @ getconstant(id)(klass, allow_nil)(val) */ -const char* -attr_name_getconstant(MAYBE_UNUSED(ID id)) -{ - return insn_name(BIN(getconstant)); -} - -/* attr rb_num_t open @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_open_getconstant(MAYBE_UNUSED(ID id)) -{ - return 1; -} - -/* attr rb_num_t popn @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_popn_getconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr rb_num_t retn @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_retn_getconstant(MAYBE_UNUSED(ID id)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getconstant(id)(klass, allow_nil)(val) */ -rb_snum_t -attr_sp_inc_getconstant(MAYBE_UNUSED(ID id)) -{ - return -1; -} - -/* attr rb_num_t width @ getconstant(id)(klass, allow_nil)(val) */ -rb_num_t -attr_width_getconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setconstant(id)(val, cbase)() */ -enum ruby_vminsn_type -attr_bin_setconstant(MAYBE_UNUSED(ID id)) -{ - return BIN(setconstant); -} - -/* attr bool handles_sp @ setconstant(id)(val, cbase)() */ -bool -attr_handles_sp_setconstant(MAYBE_UNUSED(ID id)) -{ - return false; -} - -/* attr bool leaf @ setconstant(id)(val, cbase)() */ -bool -attr_leaf_setconstant(MAYBE_UNUSED(ID id)) -{ - return -#line 292 "insns.def" -false; -#line 2735 "insns_info.inc" -} - -/* attr const char* name @ setconstant(id)(val, cbase)() */ -const char* -attr_name_setconstant(MAYBE_UNUSED(ID id)) -{ - return insn_name(BIN(setconstant)); -} - -/* attr rb_num_t open @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_open_setconstant(MAYBE_UNUSED(ID id)) -{ - return 1; -} - -/* attr rb_num_t popn @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_popn_setconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr rb_num_t retn @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_retn_setconstant(MAYBE_UNUSED(ID id)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setconstant(id)(val, cbase)() */ -rb_snum_t -attr_sp_inc_setconstant(MAYBE_UNUSED(ID id)) -{ - return -2; -} - -/* attr rb_num_t width @ setconstant(id)(val, cbase)() */ -rb_num_t -attr_width_setconstant(MAYBE_UNUSED(ID id)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getglobal(gid)()(val) */ -enum ruby_vminsn_type -attr_bin_getglobal(MAYBE_UNUSED(ID gid)) -{ - return BIN(getglobal); -} - -/* attr bool handles_sp @ getglobal(gid)()(val) */ -bool -attr_handles_sp_getglobal(MAYBE_UNUSED(ID gid)) -{ - return false; -} - -/* attr bool leaf @ getglobal(gid)()(val) */ -bool -attr_leaf_getglobal(MAYBE_UNUSED(ID gid)) -{ - return -#line 305 "insns.def" -false; -#line 2801 "insns_info.inc" -} - -/* attr const char* name @ getglobal(gid)()(val) */ -const char* -attr_name_getglobal(MAYBE_UNUSED(ID gid)) -{ - return insn_name(BIN(getglobal)); -} - -/* attr rb_num_t open @ getglobal(gid)()(val) */ -rb_num_t -attr_open_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t popn @ getglobal(gid)()(val) */ -rb_num_t -attr_popn_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 0; -} - -/* attr rb_num_t retn @ getglobal(gid)()(val) */ -rb_num_t -attr_retn_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getglobal(gid)()(val) */ -rb_snum_t -attr_sp_inc_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t width @ getglobal(gid)()(val) */ -rb_num_t -attr_width_getglobal(MAYBE_UNUSED(ID gid)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setglobal(gid)(val)() */ -enum ruby_vminsn_type -attr_bin_setglobal(MAYBE_UNUSED(ID gid)) -{ - return BIN(setglobal); -} - -/* attr bool handles_sp @ setglobal(gid)(val)() */ -bool -attr_handles_sp_setglobal(MAYBE_UNUSED(ID gid)) -{ - return false; -} - -/* attr bool leaf @ setglobal(gid)(val)() */ -bool -attr_leaf_setglobal(MAYBE_UNUSED(ID gid)) -{ - return -#line 316 "insns.def" -false; -#line 2867 "insns_info.inc" -} - -/* attr const char* name @ setglobal(gid)(val)() */ -const char* -attr_name_setglobal(MAYBE_UNUSED(ID gid)) -{ - return insn_name(BIN(setglobal)); -} - -/* attr rb_num_t open @ setglobal(gid)(val)() */ -rb_num_t -attr_open_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t popn @ setglobal(gid)(val)() */ -rb_num_t -attr_popn_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 1; -} - -/* attr rb_num_t retn @ setglobal(gid)(val)() */ -rb_num_t -attr_retn_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setglobal(gid)(val)() */ -rb_snum_t -attr_sp_inc_setglobal(MAYBE_UNUSED(ID gid)) -{ - return -1; -} - -/* attr rb_num_t width @ setglobal(gid)(val)() */ -rb_num_t -attr_width_setglobal(MAYBE_UNUSED(ID gid)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putnil()()(val) */ -enum ruby_vminsn_type -attr_bin_putnil(void) -{ - return BIN(putnil); -} - -/* attr bool handles_sp @ putnil()()(val) */ -bool -attr_handles_sp_putnil(void) -{ - return false; -} - -/* attr bool leaf @ putnil()()(val) */ -bool -attr_leaf_putnil(void) -{ - return true; -} - -/* attr const char* name @ putnil()()(val) */ -const char* -attr_name_putnil(void) -{ - return insn_name(BIN(putnil)); -} - -/* attr rb_num_t open @ putnil()()(val) */ -rb_num_t -attr_open_putnil(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putnil()()(val) */ -rb_num_t -attr_popn_putnil(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putnil()()(val) */ -rb_num_t -attr_retn_putnil(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putnil()()(val) */ -rb_snum_t -attr_sp_inc_putnil(void) -{ - return 1; -} - -/* attr rb_num_t width @ putnil()()(val) */ -rb_num_t -attr_width_putnil(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ putself()()(val) */ -enum ruby_vminsn_type -attr_bin_putself(void) -{ - return BIN(putself); -} - -/* attr bool handles_sp @ putself()()(val) */ -bool -attr_handles_sp_putself(void) -{ - return false; -} - -/* attr bool leaf @ putself()()(val) */ -bool -attr_leaf_putself(void) -{ - return true; -} - -/* attr const char* name @ putself()()(val) */ -const char* -attr_name_putself(void) -{ - return insn_name(BIN(putself)); -} - -/* attr rb_num_t open @ putself()()(val) */ -rb_num_t -attr_open_putself(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putself()()(val) */ -rb_num_t -attr_popn_putself(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putself()()(val) */ -rb_num_t -attr_retn_putself(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putself()()(val) */ -rb_snum_t -attr_sp_inc_putself(void) -{ - return 1; -} - -/* attr rb_num_t width @ putself()()(val) */ -rb_num_t -attr_width_putself(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ putobject(val)()(val) */ -enum ruby_vminsn_type -attr_bin_putobject(MAYBE_UNUSED(VALUE val)) -{ - return BIN(putobject); -} - -/* attr bool handles_sp @ putobject(val)()(val) */ -bool -attr_handles_sp_putobject(MAYBE_UNUSED(VALUE val)) -{ - return false; -} - -/* attr bool leaf @ putobject(val)()(val) */ -bool -attr_leaf_putobject(MAYBE_UNUSED(VALUE val)) -{ - return true; -} - -/* attr const char* name @ putobject(val)()(val) */ -const char* -attr_name_putobject(MAYBE_UNUSED(VALUE val)) -{ - return insn_name(BIN(putobject)); -} - -/* attr rb_num_t open @ putobject(val)()(val) */ -rb_num_t -attr_open_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 1; -} - -/* attr rb_num_t popn @ putobject(val)()(val) */ -rb_num_t -attr_popn_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 0; -} - -/* attr rb_num_t retn @ putobject(val)()(val) */ -rb_num_t -attr_retn_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putobject(val)()(val) */ -rb_snum_t -attr_sp_inc_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 1; -} - -/* attr rb_num_t width @ putobject(val)()(val) */ -rb_num_t -attr_width_putobject(MAYBE_UNUSED(VALUE val)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putspecialobject(value_type)()(val) */ -enum ruby_vminsn_type -attr_bin_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return BIN(putspecialobject); -} - -/* attr bool handles_sp @ putspecialobject(value_type)()(val) */ -bool -attr_handles_sp_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return false; -} - -/* attr bool leaf @ putspecialobject(value_type)()(val) */ -bool -attr_leaf_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return -#line 363 "insns.def" -(value_type == VM_SPECIAL_OBJECT_VMCORE); -#line 3122 "insns_info.inc" -} - -/* attr const char* name @ putspecialobject(value_type)()(val) */ -const char* -attr_name_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return insn_name(BIN(putspecialobject)); -} - -/* attr rb_num_t open @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_open_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 1; -} - -/* attr rb_num_t popn @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_popn_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 0; -} - -/* attr rb_num_t retn @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_retn_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putspecialobject(value_type)()(val) */ -rb_snum_t -attr_sp_inc_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 1; -} - -/* attr rb_num_t width @ putspecialobject(value_type)()(val) */ -rb_num_t -attr_width_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putstring(str)()(val) */ -enum ruby_vminsn_type -attr_bin_putstring(MAYBE_UNUSED(VALUE str)) -{ - return BIN(putstring); -} - -/* attr bool handles_sp @ putstring(str)()(val) */ -bool -attr_handles_sp_putstring(MAYBE_UNUSED(VALUE str)) -{ - return false; -} - -/* attr bool leaf @ putstring(str)()(val) */ -bool -attr_leaf_putstring(MAYBE_UNUSED(VALUE str)) -{ - return true; -} - -/* attr const char* name @ putstring(str)()(val) */ -const char* -attr_name_putstring(MAYBE_UNUSED(VALUE str)) -{ - return insn_name(BIN(putstring)); -} - -/* attr rb_num_t open @ putstring(str)()(val) */ -rb_num_t -attr_open_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t popn @ putstring(str)()(val) */ -rb_num_t -attr_popn_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 0; -} - -/* attr rb_num_t retn @ putstring(str)()(val) */ -rb_num_t -attr_retn_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putstring(str)()(val) */ -rb_snum_t -attr_sp_inc_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t width @ putstring(str)()(val) */ -rb_num_t -attr_width_putstring(MAYBE_UNUSED(VALUE str)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putchilledstring(str)()(val) */ -enum ruby_vminsn_type -attr_bin_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return BIN(putchilledstring); -} - -/* attr bool handles_sp @ putchilledstring(str)()(val) */ -bool -attr_handles_sp_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return false; -} - -/* attr bool leaf @ putchilledstring(str)()(val) */ -bool -attr_leaf_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return true; -} - -/* attr const char* name @ putchilledstring(str)()(val) */ -const char* -attr_name_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return insn_name(BIN(putchilledstring)); -} - -/* attr rb_num_t open @ putchilledstring(str)()(val) */ -rb_num_t -attr_open_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t popn @ putchilledstring(str)()(val) */ -rb_num_t -attr_popn_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 0; -} - -/* attr rb_num_t retn @ putchilledstring(str)()(val) */ -rb_num_t -attr_retn_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putchilledstring(str)()(val) */ -rb_snum_t -attr_sp_inc_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 1; -} - -/* attr rb_num_t width @ putchilledstring(str)()(val) */ -rb_num_t -attr_width_putchilledstring(MAYBE_UNUSED(VALUE str)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ concatstrings(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(concatstrings); -} - -/* attr bool handles_sp @ concatstrings(num)(...)(val) */ -bool -attr_handles_sp_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ concatstrings(num)(...)(val) */ -bool -attr_leaf_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 399 "insns.def" -false; -#line 3314 "insns_info.inc" -} - -/* attr const char* name @ concatstrings(num)(...)(val) */ -const char* -attr_name_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(concatstrings)); -} - -/* attr rb_num_t open @ concatstrings(num)(...)(val) */ -rb_num_t -attr_open_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ concatstrings(num)(...)(val) */ -rb_num_t -attr_popn_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ concatstrings(num)(...)(val) */ -rb_num_t -attr_retn_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ concatstrings(num)(...)(val) */ -rb_snum_t -attr_sp_inc_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 400 "insns.def" -1 - (rb_snum_t)num; -#line 3352 "insns_info.inc" -} - -/* attr rb_num_t width @ concatstrings(num)(...)(val) */ -rb_num_t -attr_width_concatstrings(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ anytostring()(val, str)(val) */ -enum ruby_vminsn_type -attr_bin_anytostring(void) -{ - return BIN(anytostring); -} - -/* attr bool handles_sp @ anytostring()(val, str)(val) */ -bool -attr_handles_sp_anytostring(void) -{ - return false; -} - -/* attr bool leaf @ anytostring()(val, str)(val) */ -bool -attr_leaf_anytostring(void) -{ - return true; -} - -/* attr const char* name @ anytostring()(val, str)(val) */ -const char* -attr_name_anytostring(void) -{ - return insn_name(BIN(anytostring)); -} - -/* attr rb_num_t open @ anytostring()(val, str)(val) */ -rb_num_t -attr_open_anytostring(void) -{ - return 0; -} - -/* attr rb_num_t popn @ anytostring()(val, str)(val) */ -rb_num_t -attr_popn_anytostring(void) -{ - return 2; -} - -/* attr rb_num_t retn @ anytostring()(val, str)(val) */ -rb_num_t -attr_retn_anytostring(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ anytostring()(val, str)(val) */ -rb_snum_t -attr_sp_inc_anytostring(void) -{ - return -1; -} - -/* attr rb_num_t width @ anytostring()(val, str)(val) */ -rb_num_t -attr_width_anytostring(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ toregexp(opt, cnt)(...)(val) */ -enum ruby_vminsn_type -attr_bin_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return BIN(toregexp); -} - -/* attr bool handles_sp @ toregexp(opt, cnt)(...)(val) */ -bool -attr_handles_sp_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return false; -} - -/* attr bool leaf @ toregexp(opt, cnt)(...)(val) */ -bool -attr_leaf_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return -#line 426 "insns.def" -false; -#line 3455 "insns_info.inc" -} - -/* attr const char* name @ toregexp(opt, cnt)(...)(val) */ -const char* -attr_name_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return insn_name(BIN(toregexp)); -} - -/* attr rb_num_t open @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_open_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 2; -} - -/* attr rb_num_t popn @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_popn_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 0; -} - -/* attr rb_num_t retn @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_retn_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ toregexp(opt, cnt)(...)(val) */ -rb_snum_t -attr_sp_inc_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return -#line 427 "insns.def" -1 - (rb_snum_t)cnt; -#line 3508 "insns_info.inc" -} - -/* attr rb_num_t width @ toregexp(opt, cnt)(...)(val) */ -rb_num_t -attr_width_toregexp( - MAYBE_UNUSED(rb_num_t opt), - MAYBE_UNUSED(rb_num_t cnt) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ intern()(str)(sym) */ -enum ruby_vminsn_type -attr_bin_intern(void) -{ - return BIN(intern); -} - -/* attr bool handles_sp @ intern()(str)(sym) */ -bool -attr_handles_sp_intern(void) -{ - return false; -} - -/* attr bool leaf @ intern()(str)(sym) */ -bool -attr_leaf_intern(void) -{ - return true; -} - -/* attr const char* name @ intern()(str)(sym) */ -const char* -attr_name_intern(void) -{ - return insn_name(BIN(intern)); -} - -/* attr rb_num_t open @ intern()(str)(sym) */ -rb_num_t -attr_open_intern(void) -{ - return 0; -} - -/* attr rb_num_t popn @ intern()(str)(sym) */ -rb_num_t -attr_popn_intern(void) -{ - return 1; -} - -/* attr rb_num_t retn @ intern()(str)(sym) */ -rb_num_t -attr_retn_intern(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ intern()(str)(sym) */ -rb_snum_t -attr_sp_inc_intern(void) -{ - return 0; -} - -/* attr rb_num_t width @ intern()(str)(sym) */ -rb_num_t -attr_width_intern(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ newarray(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(newarray); -} - -/* attr bool handles_sp @ newarray(num)(...)(val) */ -bool -attr_handles_sp_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ newarray(num)(...)(val) */ -bool -attr_leaf_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return true; -} - -/* attr const char* name @ newarray(num)(...)(val) */ -const char* -attr_name_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(newarray)); -} - -/* attr rb_num_t open @ newarray(num)(...)(val) */ -rb_num_t -attr_open_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ newarray(num)(...)(val) */ -rb_num_t -attr_popn_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ newarray(num)(...)(val) */ -rb_num_t -attr_retn_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newarray(num)(...)(val) */ -rb_snum_t -attr_sp_inc_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 450 "insns.def" -1 - (rb_snum_t)num; -#line 3640 "insns_info.inc" -} - -/* attr rb_num_t width @ newarray(num)(...)(val) */ -rb_num_t -attr_width_newarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ pushtoarraykwsplat()(ary, hash)(ary) */ -enum ruby_vminsn_type -attr_bin_pushtoarraykwsplat(void) -{ - return BIN(pushtoarraykwsplat); -} - -/* attr bool handles_sp @ pushtoarraykwsplat()(ary, hash)(ary) */ -bool -attr_handles_sp_pushtoarraykwsplat(void) -{ - return false; -} - -/* attr bool leaf @ pushtoarraykwsplat()(ary, hash)(ary) */ -bool -attr_leaf_pushtoarraykwsplat(void) -{ - return true; -} - -/* attr const char* name @ pushtoarraykwsplat()(ary, hash)(ary) */ -const char* -attr_name_pushtoarraykwsplat(void) -{ - return insn_name(BIN(pushtoarraykwsplat)); -} - -/* attr rb_num_t open @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_open_pushtoarraykwsplat(void) -{ - return 0; -} - -/* attr rb_num_t popn @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_popn_pushtoarraykwsplat(void) -{ - return 2; -} - -/* attr rb_num_t retn @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_retn_pushtoarraykwsplat(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_snum_t -attr_sp_inc_pushtoarraykwsplat(void) -{ - return -1; -} - -/* attr rb_num_t width @ pushtoarraykwsplat()(ary, hash)(ary) */ -rb_num_t -attr_width_pushtoarraykwsplat(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ duparray(ary)()(val) */ -enum ruby_vminsn_type -attr_bin_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return BIN(duparray); -} - -/* attr bool handles_sp @ duparray(ary)()(val) */ -bool -attr_handles_sp_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return false; -} - -/* attr bool leaf @ duparray(ary)()(val) */ -bool -attr_leaf_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return true; -} - -/* attr const char* name @ duparray(ary)()(val) */ -const char* -attr_name_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return insn_name(BIN(duparray)); -} - -/* attr rb_num_t open @ duparray(ary)()(val) */ -rb_num_t -attr_open_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 1; -} - -/* attr rb_num_t popn @ duparray(ary)()(val) */ -rb_num_t -attr_popn_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 0; -} - -/* attr rb_num_t retn @ duparray(ary)()(val) */ -rb_num_t -attr_retn_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ duparray(ary)()(val) */ -rb_snum_t -attr_sp_inc_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 1; -} - -/* attr rb_num_t width @ duparray(ary)()(val) */ -rb_num_t -attr_width_duparray(MAYBE_UNUSED(VALUE ary)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ duphash(hash)()(val) */ -enum ruby_vminsn_type -attr_bin_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return BIN(duphash); -} - -/* attr bool handles_sp @ duphash(hash)()(val) */ -bool -attr_handles_sp_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return false; -} - -/* attr bool leaf @ duphash(hash)()(val) */ -bool -attr_leaf_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return true; -} - -/* attr const char* name @ duphash(hash)()(val) */ -const char* -attr_name_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return insn_name(BIN(duphash)); -} - -/* attr rb_num_t open @ duphash(hash)()(val) */ -rb_num_t -attr_open_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 1; -} - -/* attr rb_num_t popn @ duphash(hash)()(val) */ -rb_num_t -attr_popn_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 0; -} - -/* attr rb_num_t retn @ duphash(hash)()(val) */ -rb_num_t -attr_retn_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ duphash(hash)()(val) */ -rb_snum_t -attr_sp_inc_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 1; -} - -/* attr rb_num_t width @ duphash(hash)()(val) */ -rb_num_t -attr_width_duphash(MAYBE_UNUSED(VALUE hash)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ expandarray(num, flag)(..., ary)(...) */ -enum ruby_vminsn_type -attr_bin_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return BIN(expandarray); -} - -/* attr bool handles_sp @ expandarray(num, flag)(..., ary)(...) */ -bool -attr_handles_sp_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return -#line 505 "insns.def" -true; -#line 3859 "insns_info.inc" -} - -/* attr bool leaf @ expandarray(num, flag)(..., ary)(...) */ -bool -attr_leaf_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return -#line 506 "insns.def" -false; -#line 3872 "insns_info.inc" -} - -/* attr const char* name @ expandarray(num, flag)(..., ary)(...) */ -const char* -attr_name_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return insn_name(BIN(expandarray)); -} - -/* attr rb_num_t open @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_open_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 2; -} - -/* attr rb_num_t popn @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_popn_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 1; -} - -/* attr rb_num_t retn @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_retn_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ expandarray(num, flag)(..., ary)(...) */ -rb_snum_t -attr_sp_inc_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return -#line 507 "insns.def" -(rb_snum_t)num - 1 + (flag & 1 ? 1 : 0); -#line 3925 "insns_info.inc" -} - -/* attr rb_num_t width @ expandarray(num, flag)(..., ary)(...) */ -rb_num_t -attr_width_expandarray( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t flag) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ concatarray()(ary1, ary2)(ary) */ -enum ruby_vminsn_type -attr_bin_concatarray(void) -{ - return BIN(concatarray); -} - -/* attr bool handles_sp @ concatarray()(ary1, ary2)(ary) */ -bool -attr_handles_sp_concatarray(void) -{ - return false; -} - -/* attr bool leaf @ concatarray()(ary1, ary2)(ary) */ -bool -attr_leaf_concatarray(void) -{ - return -#line 520 "insns.def" -false; -#line 3959 "insns_info.inc" -} - -/* attr const char* name @ concatarray()(ary1, ary2)(ary) */ -const char* -attr_name_concatarray(void) -{ - return insn_name(BIN(concatarray)); -} - -/* attr rb_num_t open @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_open_concatarray(void) -{ - return 0; -} - -/* attr rb_num_t popn @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_popn_concatarray(void) -{ - return 2; -} - -/* attr rb_num_t retn @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_retn_concatarray(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ concatarray()(ary1, ary2)(ary) */ -rb_snum_t -attr_sp_inc_concatarray(void) -{ - return -1; -} - -/* attr rb_num_t width @ concatarray()(ary1, ary2)(ary) */ -rb_num_t -attr_width_concatarray(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ concattoarray()(ary1, ary2)(ary) */ -enum ruby_vminsn_type -attr_bin_concattoarray(void) -{ - return BIN(concattoarray); -} - -/* attr bool handles_sp @ concattoarray()(ary1, ary2)(ary) */ -bool -attr_handles_sp_concattoarray(void) -{ - return false; -} - -/* attr bool leaf @ concattoarray()(ary1, ary2)(ary) */ -bool -attr_leaf_concattoarray(void) -{ - return -#line 534 "insns.def" -false; -#line 4025 "insns_info.inc" -} - -/* attr const char* name @ concattoarray()(ary1, ary2)(ary) */ -const char* -attr_name_concattoarray(void) -{ - return insn_name(BIN(concattoarray)); -} - -/* attr rb_num_t open @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_open_concattoarray(void) -{ - return 0; -} - -/* attr rb_num_t popn @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_popn_concattoarray(void) -{ - return 2; -} - -/* attr rb_num_t retn @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_retn_concattoarray(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ concattoarray()(ary1, ary2)(ary) */ -rb_snum_t -attr_sp_inc_concattoarray(void) -{ - return -1; -} - -/* attr rb_num_t width @ concattoarray()(ary1, ary2)(ary) */ -rb_num_t -attr_width_concattoarray(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ pushtoarray(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(pushtoarray); -} - -/* attr bool handles_sp @ pushtoarray(num)(...)(val) */ -bool -attr_handles_sp_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ pushtoarray(num)(...)(val) */ -bool -attr_leaf_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return true; -} - -/* attr const char* name @ pushtoarray(num)(...)(val) */ -const char* -attr_name_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(pushtoarray)); -} - -/* attr rb_num_t open @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_open_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_popn_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_retn_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ pushtoarray(num)(...)(val) */ -rb_snum_t -attr_sp_inc_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 545 "insns.def" --(rb_snum_t)num; -#line 4126 "insns_info.inc" -} - -/* attr rb_num_t width @ pushtoarray(num)(...)(val) */ -rb_num_t -attr_width_pushtoarray(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ splatarray(flag)(ary)(obj) */ -enum ruby_vminsn_type -attr_bin_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return BIN(splatarray); -} - -/* attr bool handles_sp @ splatarray(flag)(ary)(obj) */ -bool -attr_handles_sp_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return false; -} - -/* attr bool leaf @ splatarray(flag)(ary)(obj) */ -bool -attr_leaf_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return -#line 557 "insns.def" -false; -#line 4157 "insns_info.inc" -} - -/* attr const char* name @ splatarray(flag)(ary)(obj) */ -const char* -attr_name_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return insn_name(BIN(splatarray)); -} - -/* attr rb_num_t open @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_open_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 1; -} - -/* attr rb_num_t popn @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_popn_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 1; -} - -/* attr rb_num_t retn @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_retn_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ splatarray(flag)(ary)(obj) */ -rb_snum_t -attr_sp_inc_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 0; -} - -/* attr rb_num_t width @ splatarray(flag)(ary)(obj) */ -rb_num_t -attr_width_splatarray(MAYBE_UNUSED(VALUE flag)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ splatkw()(hash, block)(obj, block) */ -enum ruby_vminsn_type -attr_bin_splatkw(void) -{ - return BIN(splatkw); -} - -/* attr bool handles_sp @ splatkw()(hash, block)(obj, block) */ -bool -attr_handles_sp_splatkw(void) -{ - return false; -} - -/* attr bool leaf @ splatkw()(hash, block)(obj, block) */ -bool -attr_leaf_splatkw(void) -{ - return -#line 568 "insns.def" -false; -#line 4223 "insns_info.inc" -} - -/* attr const char* name @ splatkw()(hash, block)(obj, block) */ -const char* -attr_name_splatkw(void) -{ - return insn_name(BIN(splatkw)); -} - -/* attr rb_num_t open @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_open_splatkw(void) -{ - return 0; -} - -/* attr rb_num_t popn @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_popn_splatkw(void) -{ - return 2; -} - -/* attr rb_num_t retn @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_retn_splatkw(void) -{ - return 2; -} - -/* attr rb_snum_t sp_inc @ splatkw()(hash, block)(obj, block) */ -rb_snum_t -attr_sp_inc_splatkw(void) -{ - return 0; -} - -/* attr rb_num_t width @ splatkw()(hash, block)(obj, block) */ -rb_num_t -attr_width_splatkw(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ newhash(num)(...)(val) */ -enum ruby_vminsn_type -attr_bin_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return BIN(newhash); -} - -/* attr bool handles_sp @ newhash(num)(...)(val) */ -bool -attr_handles_sp_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return false; -} - -/* attr bool leaf @ newhash(num)(...)(val) */ -bool -attr_leaf_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 584 "insns.def" -false; -#line 4289 "insns_info.inc" -} - -/* attr const char* name @ newhash(num)(...)(val) */ -const char* -attr_name_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return insn_name(BIN(newhash)); -} - -/* attr rb_num_t open @ newhash(num)(...)(val) */ -rb_num_t -attr_open_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_num_t popn @ newhash(num)(...)(val) */ -rb_num_t -attr_popn_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 0; -} - -/* attr rb_num_t retn @ newhash(num)(...)(val) */ -rb_num_t -attr_retn_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newhash(num)(...)(val) */ -rb_snum_t -attr_sp_inc_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return -#line 585 "insns.def" -1 - (rb_snum_t)num; -#line 4327 "insns_info.inc" -} - -/* attr rb_num_t width @ newhash(num)(...)(val) */ -rb_num_t -attr_width_newhash(MAYBE_UNUSED(rb_num_t num)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ newrange(flag)(low, high)(val) */ -enum ruby_vminsn_type -attr_bin_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return BIN(newrange); -} - -/* attr bool handles_sp @ newrange(flag)(low, high)(val) */ -bool -attr_handles_sp_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return false; -} - -/* attr bool leaf @ newrange(flag)(low, high)(val) */ -bool -attr_leaf_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return -#line 605 "insns.def" -false; -#line 4358 "insns_info.inc" -} - -/* attr const char* name @ newrange(flag)(low, high)(val) */ -const char* -attr_name_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return insn_name(BIN(newrange)); -} - -/* attr rb_num_t open @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_open_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_num_t popn @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_popn_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr rb_num_t retn @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_retn_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ newrange(flag)(low, high)(val) */ -rb_snum_t -attr_sp_inc_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return -1; -} - -/* attr rb_num_t width @ newrange(flag)(low, high)(val) */ -rb_num_t -attr_width_newrange(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ pop()(val)() */ -enum ruby_vminsn_type -attr_bin_pop(void) -{ - return BIN(pop); -} - -/* attr bool handles_sp @ pop()(val)() */ -bool -attr_handles_sp_pop(void) -{ - return false; -} - -/* attr bool leaf @ pop()(val)() */ -bool -attr_leaf_pop(void) -{ - return true; -} - -/* attr const char* name @ pop()(val)() */ -const char* -attr_name_pop(void) -{ - return insn_name(BIN(pop)); -} - -/* attr rb_num_t open @ pop()(val)() */ -rb_num_t -attr_open_pop(void) -{ - return 0; -} - -/* attr rb_num_t popn @ pop()(val)() */ -rb_num_t -attr_popn_pop(void) -{ - return 1; -} - -/* attr rb_num_t retn @ pop()(val)() */ -rb_num_t -attr_retn_pop(void) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ pop()(val)() */ -rb_snum_t -attr_sp_inc_pop(void) -{ - return -1; -} - -/* attr rb_num_t width @ pop()(val)() */ -rb_num_t -attr_width_pop(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ dup()(val)(val1, val2) */ -enum ruby_vminsn_type -attr_bin_dup(void) -{ - return BIN(dup); -} - -/* attr bool handles_sp @ dup()(val)(val1, val2) */ -bool -attr_handles_sp_dup(void) -{ - return false; -} - -/* attr bool leaf @ dup()(val)(val1, val2) */ -bool -attr_leaf_dup(void) -{ - return true; -} - -/* attr const char* name @ dup()(val)(val1, val2) */ -const char* -attr_name_dup(void) -{ - return insn_name(BIN(dup)); -} - -/* attr rb_num_t open @ dup()(val)(val1, val2) */ -rb_num_t -attr_open_dup(void) -{ - return 0; -} - -/* attr rb_num_t popn @ dup()(val)(val1, val2) */ -rb_num_t -attr_popn_dup(void) -{ - return 1; -} - -/* attr rb_num_t retn @ dup()(val)(val1, val2) */ -rb_num_t -attr_retn_dup(void) -{ - return 2; -} - -/* attr rb_snum_t sp_inc @ dup()(val)(val1, val2) */ -rb_snum_t -attr_sp_inc_dup(void) -{ - return 1; -} - -/* attr rb_num_t width @ dup()(val)(val1, val2) */ -rb_num_t -attr_width_dup(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ dupn(n)(...)(...) */ -enum ruby_vminsn_type -attr_bin_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(dupn); -} - -/* attr bool handles_sp @ dupn(n)(...)(...) */ -bool -attr_handles_sp_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ dupn(n)(...)(...) */ -bool -attr_leaf_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ dupn(n)(...)(...) */ -const char* -attr_name_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(dupn)); -} - -/* attr rb_num_t open @ dupn(n)(...)(...) */ -rb_num_t -attr_open_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ dupn(n)(...)(...) */ -rb_num_t -attr_popn_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ dupn(n)(...)(...) */ -rb_num_t -attr_retn_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ dupn(n)(...)(...) */ -rb_snum_t -attr_sp_inc_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 641 "insns.def" -n; -#line 4585 "insns_info.inc" -} - -/* attr rb_num_t width @ dupn(n)(...)(...) */ -rb_num_t -attr_width_dupn(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ swap()(val, obj)(obj, val) */ -enum ruby_vminsn_type -attr_bin_swap(void) -{ - return BIN(swap); -} - -/* attr bool handles_sp @ swap()(val, obj)(obj, val) */ -bool -attr_handles_sp_swap(void) -{ - return false; -} - -/* attr bool leaf @ swap()(val, obj)(obj, val) */ -bool -attr_leaf_swap(void) -{ - return true; -} - -/* attr const char* name @ swap()(val, obj)(obj, val) */ -const char* -attr_name_swap(void) -{ - return insn_name(BIN(swap)); -} - -/* attr rb_num_t open @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_open_swap(void) -{ - return 0; -} - -/* attr rb_num_t popn @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_popn_swap(void) -{ - return 2; -} - -/* attr rb_num_t retn @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_retn_swap(void) -{ - return 2; -} - -/* attr rb_snum_t sp_inc @ swap()(val, obj)(obj, val) */ -rb_snum_t -attr_sp_inc_swap(void) -{ - return 0; -} - -/* attr rb_num_t width @ swap()(val, obj)(obj, val) */ -rb_num_t -attr_width_swap(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ opt_reverse(n)(...)(...) */ -enum ruby_vminsn_type -attr_bin_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(opt_reverse); -} - -/* attr bool handles_sp @ opt_reverse(n)(...)(...) */ -bool -attr_handles_sp_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ opt_reverse(n)(...)(...) */ -bool -attr_leaf_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ opt_reverse(n)(...)(...) */ -const char* -attr_name_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(opt_reverse)); -} - -/* attr rb_num_t open @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_open_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_popn_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_retn_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ opt_reverse(n)(...)(...) */ -rb_snum_t -attr_sp_inc_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 665 "insns.def" -0; -#line 4714 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_reverse(n)(...)(...) */ -rb_num_t -attr_width_opt_reverse(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ topn(n)(...)(val) */ -enum ruby_vminsn_type -attr_bin_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(topn); -} - -/* attr bool handles_sp @ topn(n)(...)(val) */ -bool -attr_handles_sp_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ topn(n)(...)(val) */ -bool -attr_leaf_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ topn(n)(...)(val) */ -const char* -attr_name_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(topn)); -} - -/* attr rb_num_t open @ topn(n)(...)(val) */ -rb_num_t -attr_open_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ topn(n)(...)(val) */ -rb_num_t -attr_popn_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ topn(n)(...)(val) */ -rb_num_t -attr_retn_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ topn(n)(...)(val) */ -rb_snum_t -attr_sp_inc_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 695 "insns.def" -1; -#line 4780 "insns_info.inc" -} - -/* attr rb_num_t width @ topn(n)(...)(val) */ -rb_num_t -attr_width_topn(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setn(n)(..., val)(val) */ -enum ruby_vminsn_type -attr_bin_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(setn); -} - -/* attr bool handles_sp @ setn(n)(..., val)(val) */ -bool -attr_handles_sp_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ setn(n)(..., val)(val) */ -bool -attr_leaf_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ setn(n)(..., val)(val) */ -const char* -attr_name_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(setn)); -} - -/* attr rb_num_t open @ setn(n)(..., val)(val) */ -rb_num_t -attr_open_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ setn(n)(..., val)(val) */ -rb_num_t -attr_popn_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t retn @ setn(n)(..., val)(val) */ -rb_num_t -attr_retn_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ setn(n)(..., val)(val) */ -rb_snum_t -attr_sp_inc_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 706 "insns.def" -0; -#line 4846 "insns_info.inc" -} - -/* attr rb_num_t width @ setn(n)(..., val)(val) */ -rb_num_t -attr_width_setn(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ adjuststack(n)(...)(...) */ -enum ruby_vminsn_type -attr_bin_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return BIN(adjuststack); -} - -/* attr bool handles_sp @ adjuststack(n)(...)(...) */ -bool -attr_handles_sp_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return false; -} - -/* attr bool leaf @ adjuststack(n)(...)(...) */ -bool -attr_leaf_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return true; -} - -/* attr const char* name @ adjuststack(n)(...)(...) */ -const char* -attr_name_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return insn_name(BIN(adjuststack)); -} - -/* attr rb_num_t open @ adjuststack(n)(...)(...) */ -rb_num_t -attr_open_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 1; -} - -/* attr rb_num_t popn @ adjuststack(n)(...)(...) */ -rb_num_t -attr_popn_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_num_t retn @ adjuststack(n)(...)(...) */ -rb_num_t -attr_retn_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ adjuststack(n)(...)(...) */ -rb_snum_t -attr_sp_inc_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return -#line 717 "insns.def" --(rb_snum_t)n; -#line 4912 "insns_info.inc" -} - -/* attr rb_num_t width @ adjuststack(n)(...)(...) */ -rb_num_t -attr_width_adjuststack(MAYBE_UNUSED(rb_num_t n)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ defined(op_type, obj, pushval)(v)(val) */ -enum ruby_vminsn_type -attr_bin_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return BIN(defined); -} - -/* attr bool handles_sp @ defined(op_type, obj, pushval)(v)(val) */ -bool -attr_handles_sp_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return false; -} - -/* attr bool leaf @ defined(op_type, obj, pushval)(v)(val) */ -bool -attr_leaf_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return -#line 732 "insns.def" -leafness_of_defined(op_type); -#line 4955 "insns_info.inc" -} - -/* attr const char* name @ defined(op_type, obj, pushval)(v)(val) */ -const char* -attr_name_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return insn_name(BIN(defined)); -} - -/* attr rb_num_t open @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_open_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 3; -} - -/* attr rb_num_t popn @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_popn_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_num_t retn @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_retn_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ defined(op_type, obj, pushval)(v)(val) */ -rb_snum_t -attr_sp_inc_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 0; -} - -/* attr rb_num_t width @ defined(op_type, obj, pushval)(v)(val) */ -rb_num_t -attr_width_defined( - MAYBE_UNUSED(rb_num_t op_type), - MAYBE_UNUSED(VALUE obj), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 4; -} - -/* attr enum ruby_vminsn_type bin @ definedivar(id, ic, pushval)()(val) */ -enum ruby_vminsn_type -attr_bin_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return BIN(definedivar); -} - -/* attr bool handles_sp @ definedivar(id, ic, pushval)()(val) */ -bool -attr_handles_sp_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return false; -} - -/* attr bool leaf @ definedivar(id, ic, pushval)()(val) */ -bool -attr_leaf_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return -#line 746 "insns.def" -false; -#line 5057 "insns_info.inc" -} - -/* attr const char* name @ definedivar(id, ic, pushval)()(val) */ -const char* -attr_name_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return insn_name(BIN(definedivar)); -} - -/* attr rb_num_t open @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_open_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 3; -} - -/* attr rb_num_t popn @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_popn_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 0; -} - -/* attr rb_num_t retn @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_retn_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ definedivar(id, ic, pushval)()(val) */ -rb_snum_t -attr_sp_inc_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 1; -} - -/* attr rb_num_t width @ definedivar(id, ic, pushval)()(val) */ -rb_num_t -attr_width_definedivar( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(IVC ic), - MAYBE_UNUSED(VALUE pushval) -) -{ - return 4; -} - -/* attr enum ruby_vminsn_type bin @ checkmatch(flag)(target, pattern)(result) */ -enum ruby_vminsn_type -attr_bin_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return BIN(checkmatch); -} - -/* attr bool handles_sp @ checkmatch(flag)(target, pattern)(result) */ -bool -attr_handles_sp_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return false; -} - -/* attr bool leaf @ checkmatch(flag)(target, pattern)(result) */ -bool -attr_leaf_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return -#line 766 "insns.def" -leafness_of_checkmatch(flag); -#line 5147 "insns_info.inc" -} - -/* attr const char* name @ checkmatch(flag)(target, pattern)(result) */ -const char* -attr_name_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return insn_name(BIN(checkmatch)); -} - -/* attr rb_num_t open @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_open_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_num_t popn @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_popn_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr rb_num_t retn @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_retn_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ checkmatch(flag)(target, pattern)(result) */ -rb_snum_t -attr_sp_inc_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return -1; -} - -/* attr rb_num_t width @ checkmatch(flag)(target, pattern)(result) */ -rb_num_t -attr_width_checkmatch(MAYBE_UNUSED(rb_num_t flag)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -enum ruby_vminsn_type -attr_bin_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return BIN(checkkeyword); -} - -/* attr bool handles_sp @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -bool -attr_handles_sp_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return false; -} - -/* attr bool leaf @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -bool -attr_leaf_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return true; -} - -/* attr const char* name @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -const char* -attr_name_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return insn_name(BIN(checkkeyword)); -} - -/* attr rb_num_t open @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_open_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 2; -} - -/* attr rb_num_t popn @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_popn_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 0; -} - -/* attr rb_num_t retn @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_retn_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_snum_t -attr_sp_inc_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 1; -} - -/* attr rb_num_t width @ checkkeyword(kw_bits_index, keyword_index)()(ret) */ -rb_num_t -attr_width_checkkeyword( - MAYBE_UNUSED(lindex_t kw_bits_index), - MAYBE_UNUSED(lindex_t keyword_index) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ checktype(type)(val)(ret) */ -enum ruby_vminsn_type -attr_bin_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return BIN(checktype); -} - -/* attr bool handles_sp @ checktype(type)(val)(ret) */ -bool -attr_handles_sp_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return false; -} - -/* attr bool leaf @ checktype(type)(val)(ret) */ -bool -attr_leaf_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return true; -} - -/* attr const char* name @ checktype(type)(val)(ret) */ -const char* -attr_name_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return insn_name(BIN(checktype)); -} - -/* attr rb_num_t open @ checktype(type)(val)(ret) */ -rb_num_t -attr_open_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 1; -} - -/* attr rb_num_t popn @ checktype(type)(val)(ret) */ -rb_num_t -attr_popn_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 1; -} - -/* attr rb_num_t retn @ checktype(type)(val)(ret) */ -rb_num_t -attr_retn_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ checktype(type)(val)(ret) */ -rb_snum_t -attr_sp_inc_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 0; -} - -/* attr rb_num_t width @ checktype(type)(val)(ret) */ -rb_num_t -attr_width_checktype(MAYBE_UNUSED(rb_num_t type)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -enum ruby_vminsn_type -attr_bin_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return BIN(defineclass); -} - -/* attr bool handles_sp @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -bool -attr_handles_sp_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return true; -} - -/* attr bool leaf @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -bool -attr_leaf_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return false; -} - -/* attr const char* name @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -const char* -attr_name_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return insn_name(BIN(defineclass)); -} - -/* attr rb_num_t open @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_open_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 3; -} - -/* attr rb_num_t popn @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_popn_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 2; -} - -/* attr rb_num_t retn @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_retn_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_snum_t -attr_sp_inc_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return -1; -} - -/* attr rb_num_t width @ defineclass(id, class_iseq, flags)(cbase, super)(val) */ -rb_num_t -attr_width_defineclass( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ class_iseq), - MAYBE_UNUSED(rb_num_t flags) -) -{ - return 4; -} - -/* attr enum ruby_vminsn_type bin @ definemethod(id, iseq)()() */ -enum ruby_vminsn_type -attr_bin_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return BIN(definemethod); -} - -/* attr bool handles_sp @ definemethod(id, iseq)()() */ -bool -attr_handles_sp_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return true; -} - -/* attr bool leaf @ definemethod(id, iseq)()() */ -bool -attr_leaf_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return false; -} - -/* attr const char* name @ definemethod(id, iseq)()() */ -const char* -attr_name_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return insn_name(BIN(definemethod)); -} - -/* attr rb_num_t open @ definemethod(id, iseq)()() */ -rb_num_t -attr_open_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ definemethod(id, iseq)()() */ -rb_num_t -attr_popn_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ definemethod(id, iseq)()() */ -rb_num_t -attr_retn_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ definemethod(id, iseq)()() */ -rb_snum_t -attr_sp_inc_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_num_t width @ definemethod(id, iseq)()() */ -rb_num_t -attr_width_definemethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ definesmethod(id, iseq)(obj)() */ -enum ruby_vminsn_type -attr_bin_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return BIN(definesmethod); -} - -/* attr bool handles_sp @ definesmethod(id, iseq)(obj)() */ -bool -attr_handles_sp_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return true; -} - -/* attr bool leaf @ definesmethod(id, iseq)(obj)() */ -bool -attr_leaf_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return false; -} - -/* attr const char* name @ definesmethod(id, iseq)(obj)() */ -const char* -attr_name_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return insn_name(BIN(definesmethod)); -} - -/* attr rb_num_t open @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_open_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_popn_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 1; -} - -/* attr rb_num_t retn @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_retn_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ definesmethod(id, iseq)(obj)() */ -rb_snum_t -attr_sp_inc_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return -1; -} - -/* attr rb_num_t width @ definesmethod(id, iseq)(obj)() */ -rb_num_t -attr_width_definesmethod( - MAYBE_UNUSED(ID id), - MAYBE_UNUSED(ISEQ iseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ send(cd, blockiseq)(...)(val) */ -enum ruby_vminsn_type -attr_bin_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return BIN(send); -} - -/* attr rb_snum_t comptime_sp_inc @ send(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_send( - MAYBE_UNUSED(CALL_INFO ci), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 848 "insns.def" -sp_inc_of_sendish(ci); -#line 5644 "insns_info.inc" -} - -/* attr bool handles_sp @ send(cd, blockiseq)(...)(val) */ -bool -attr_handles_sp_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return true; -} - -/* attr bool leaf @ send(cd, blockiseq)(...)(val) */ -bool -attr_leaf_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return false; -} - -/* attr const char* name @ send(cd, blockiseq)(...)(val) */ -const char* -attr_name_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return insn_name(BIN(send)); -} - -/* attr rb_num_t open @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_open_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_popn_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_retn_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ send(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_sp_inc_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 847 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 5717 "insns_info.inc" -} - -/* attr rb_num_t width @ send(cd, blockiseq)(...)(val) */ -rb_num_t -attr_width_send( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ sendforward(cd, blockiseq)(...)(val) */ -enum ruby_vminsn_type -attr_bin_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return BIN(sendforward); -} - -/* attr rb_snum_t comptime_sp_inc @ sendforward(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_sendforward( - MAYBE_UNUSED(CALL_INFO ci), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 867 "insns.def" -sp_inc_of_sendish(ci); -#line 5750 "insns_info.inc" -} - -/* attr bool handles_sp @ sendforward(cd, blockiseq)(...)(val) */ -bool -attr_handles_sp_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return true; -} - -/* attr bool leaf @ sendforward(cd, blockiseq)(...)(val) */ -bool -attr_leaf_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return false; -} - -/* attr const char* name @ sendforward(cd, blockiseq)(...)(val) */ -const char* -attr_name_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return insn_name(BIN(sendforward)); -} - -/* attr rb_num_t open @ sendforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_open_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ sendforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_popn_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ sendforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_retn_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ sendforward(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_sp_inc_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 866 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 5823 "insns_info.inc" -} - -/* attr rb_num_t width @ sendforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_width_sendforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_send_without_block(cd)(...)(val) */ -enum ruby_vminsn_type -attr_bin_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_send_without_block); -} - -/* attr rb_snum_t comptime_sp_inc @ opt_send_without_block(cd)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_opt_send_without_block(MAYBE_UNUSED(CALL_INFO ci)) -{ - return -#line 895 "insns.def" -sp_inc_of_sendish(ci); -#line 5850 "insns_info.inc" -} - -/* attr bool handles_sp @ opt_send_without_block(cd)(...)(val) */ -bool -attr_handles_sp_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 893 "insns.def" -true; -#line 5860 "insns_info.inc" -} - -/* attr bool leaf @ opt_send_without_block(cd)(...)(val) */ -bool -attr_leaf_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return ! attr_handles_sp_opt_send_without_block(cd); -} - -/* attr const char* name @ opt_send_without_block(cd)(...)(val) */ -const char* -attr_name_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_send_without_block)); -} - -/* attr rb_num_t open @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_open_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_popn_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_retn_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_send_without_block(cd)(...)(val) */ -rb_snum_t -attr_sp_inc_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 894 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 5905 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_send_without_block(cd)(...)(val) */ -rb_num_t -attr_width_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ objtostring(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(objtostring); -} - -/* attr bool handles_sp @ objtostring(cd)(recv)(val) */ -bool -attr_handles_sp_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ objtostring(cd)(recv)(val) */ -bool -attr_leaf_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 913 "insns.def" -false; -#line 5936 "insns_info.inc" -} - -/* attr const char* name @ objtostring(cd)(recv)(val) */ -const char* -attr_name_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(objtostring)); -} - -/* attr rb_num_t open @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_open_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_popn_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_retn_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ objtostring(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ objtostring(cd)(recv)(val) */ -rb_num_t -attr_width_objtostring(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_ary_freeze(ary, cd)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_ary_freeze); -} - -/* attr bool handles_sp @ opt_ary_freeze(ary, cd)()(val) */ -bool -attr_handles_sp_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_ary_freeze(ary, cd)()(val) */ -bool -attr_leaf_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_ary_freeze(ary, cd)()(val) */ -const char* -attr_name_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_ary_freeze)); -} - -/* attr rb_num_t open @ opt_ary_freeze(ary, cd)()(val) */ -rb_num_t -attr_open_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_ary_freeze(ary, cd)()(val) */ -rb_num_t -attr_popn_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_ary_freeze(ary, cd)()(val) */ -rb_num_t -attr_retn_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_ary_freeze(ary, cd)()(val) */ -rb_snum_t -attr_sp_inc_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_ary_freeze(ary, cd)()(val) */ -rb_num_t -attr_width_opt_ary_freeze( - MAYBE_UNUSED(VALUE ary), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_hash_freeze(hash, cd)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_hash_freeze); -} - -/* attr bool handles_sp @ opt_hash_freeze(hash, cd)()(val) */ -bool -attr_handles_sp_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_hash_freeze(hash, cd)()(val) */ -bool -attr_leaf_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_hash_freeze(hash, cd)()(val) */ -const char* -attr_name_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_hash_freeze)); -} - -/* attr rb_num_t open @ opt_hash_freeze(hash, cd)()(val) */ -rb_num_t -attr_open_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_hash_freeze(hash, cd)()(val) */ -rb_num_t -attr_popn_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_hash_freeze(hash, cd)()(val) */ -rb_num_t -attr_retn_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_hash_freeze(hash, cd)()(val) */ -rb_snum_t -attr_sp_inc_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_hash_freeze(hash, cd)()(val) */ -rb_num_t -attr_width_opt_hash_freeze( - MAYBE_UNUSED(VALUE hash), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_str_freeze(str, cd)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_str_freeze); -} - -/* attr bool handles_sp @ opt_str_freeze(str, cd)()(val) */ -bool -attr_handles_sp_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_str_freeze(str, cd)()(val) */ -bool -attr_leaf_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_str_freeze(str, cd)()(val) */ -const char* -attr_name_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_str_freeze)); -} - -/* attr rb_num_t open @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_open_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_popn_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_retn_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_str_freeze(str, cd)()(val) */ -rb_snum_t -attr_sp_inc_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_str_freeze(str, cd)()(val) */ -rb_num_t -attr_width_opt_str_freeze( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_nil_p(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_nil_p); -} - -/* attr bool handles_sp @ opt_nil_p(cd)(recv)(val) */ -bool -attr_handles_sp_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_nil_p(cd)(recv)(val) */ -bool -attr_leaf_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_nil_p(cd)(recv)(val) */ -const char* -attr_name_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_nil_p)); -} - -/* attr rb_num_t open @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_open_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_nil_p(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_nil_p(cd)(recv)(val) */ -rb_num_t -attr_width_opt_nil_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_str_uminus(str, cd)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_str_uminus); -} - -/* attr bool handles_sp @ opt_str_uminus(str, cd)()(val) */ -bool -attr_handles_sp_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_str_uminus(str, cd)()(val) */ -bool -attr_leaf_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_str_uminus(str, cd)()(val) */ -const char* -attr_name_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_str_uminus)); -} - -/* attr rb_num_t open @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_open_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_popn_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_retn_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_str_uminus(str, cd)()(val) */ -rb_snum_t -attr_sp_inc_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_str_uminus(str, cd)()(val) */ -rb_num_t -attr_width_opt_str_uminus( - MAYBE_UNUSED(VALUE str), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_newarray_send(num, method)(...)(val) */ -enum ruby_vminsn_type -attr_bin_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return BIN(opt_newarray_send); -} - -/* attr rb_snum_t comptime_sp_inc @ opt_newarray_send(num, method)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return -#line 1005 "insns.def" -1 - (rb_snum_t)num; -#line 6424 "insns_info.inc" -} - -/* attr bool handles_sp @ opt_newarray_send(num, method)(...)(val) */ -bool -attr_handles_sp_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return false; -} - -/* attr bool leaf @ opt_newarray_send(num, method)(...)(val) */ -bool -attr_leaf_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return -#line 1003 "insns.def" -false; -#line 6447 "insns_info.inc" -} - -/* attr const char* name @ opt_newarray_send(num, method)(...)(val) */ -const char* -attr_name_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return insn_name(BIN(opt_newarray_send)); -} - -/* attr rb_num_t open @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_open_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_popn_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_retn_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_newarray_send(num, method)(...)(val) */ -rb_snum_t -attr_sp_inc_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return -#line 1004 "insns.def" -1 - (rb_snum_t)num; -#line 6500 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_newarray_send(num, method)(...)(val) */ -rb_num_t -attr_width_opt_newarray_send( - MAYBE_UNUSED(rb_num_t num), - MAYBE_UNUSED(rb_num_t method) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ invokesuper(cd, blockiseq)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return BIN(invokesuper); -} - -/* attr rb_snum_t comptime_sp_inc @ invokesuper(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_invokesuper( - MAYBE_UNUSED(CALL_INFO ci), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 1035 "insns.def" -sp_inc_of_sendish(ci); -#line 6533 "insns_info.inc" -} - -/* attr bool handles_sp @ invokesuper(cd, blockiseq)(...)(val) */ -bool -attr_handles_sp_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return true; -} - -/* attr bool leaf @ invokesuper(cd, blockiseq)(...)(val) */ -bool -attr_leaf_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return false; -} - -/* attr const char* name @ invokesuper(cd, blockiseq)(...)(val) */ -const char* -attr_name_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return insn_name(BIN(invokesuper)); -} - -/* attr rb_num_t open @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_open_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_popn_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_retn_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokesuper(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_sp_inc_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 1034 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 6606 "insns_info.inc" -} - -/* attr rb_num_t width @ invokesuper(cd, blockiseq)(...)(val) */ -rb_num_t -attr_width_invokesuper( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ invokesuperforward(cd, blockiseq)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return BIN(invokesuperforward); -} - -/* attr rb_snum_t comptime_sp_inc @ invokesuperforward(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_invokesuperforward( - MAYBE_UNUSED(CALL_INFO ci), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 1054 "insns.def" -sp_inc_of_sendish(ci); -#line 6639 "insns_info.inc" -} - -/* attr bool handles_sp @ invokesuperforward(cd, blockiseq)(...)(val) */ -bool -attr_handles_sp_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return true; -} - -/* attr bool leaf @ invokesuperforward(cd, blockiseq)(...)(val) */ -bool -attr_leaf_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return false; -} - -/* attr const char* name @ invokesuperforward(cd, blockiseq)(...)(val) */ -const char* -attr_name_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return insn_name(BIN(invokesuperforward)); -} - -/* attr rb_num_t open @ invokesuperforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_open_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 2; -} - -/* attr rb_num_t popn @ invokesuperforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_popn_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 0; -} - -/* attr rb_num_t retn @ invokesuperforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_retn_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokesuperforward(cd, blockiseq)(...)(val) */ -rb_snum_t -attr_sp_inc_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return -#line 1053 "insns.def" -sp_inc_of_sendish(cd->ci); -#line 6712 "insns_info.inc" -} - -/* attr rb_num_t width @ invokesuperforward(cd, blockiseq)(...)(val) */ -rb_num_t -attr_width_invokesuperforward( - MAYBE_UNUSED(CALL_DATA cd), - MAYBE_UNUSED(ISEQ blockiseq) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ invokeblock(cd)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(invokeblock); -} - -/* attr rb_snum_t comptime_sp_inc @ invokeblock(cd)(...)(val) */ -rb_snum_t -attr_comptime_sp_inc_invokeblock(MAYBE_UNUSED(CALL_INFO ci)) -{ - return -#line 1082 "insns.def" -sp_inc_of_invokeblock(ci); -#line 6739 "insns_info.inc" -} - -/* attr bool handles_sp @ invokeblock(cd)(...)(val) */ -bool -attr_handles_sp_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1080 "insns.def" -true; -#line 6749 "insns_info.inc" -} - -/* attr bool leaf @ invokeblock(cd)(...)(val) */ -bool -attr_leaf_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return ! attr_handles_sp_invokeblock(cd); -} - -/* attr const char* name @ invokeblock(cd)(...)(val) */ -const char* -attr_name_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(invokeblock)); -} - -/* attr rb_num_t open @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_open_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_popn_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t retn @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_retn_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokeblock(cd)(...)(val) */ -rb_snum_t -attr_sp_inc_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1081 "insns.def" -sp_inc_of_invokeblock(cd->ci); -#line 6794 "insns_info.inc" -} - -/* attr rb_num_t width @ invokeblock(cd)(...)(val) */ -rb_num_t -attr_width_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ leave()(val)(val) */ -enum ruby_vminsn_type -attr_bin_leave(void) -{ - return BIN(leave); -} - -/* attr bool handles_sp @ leave()(val)(val) */ -bool -attr_handles_sp_leave(void) -{ - return -#line 1104 "insns.def" -true; -#line 6818 "insns_info.inc" -} - -/* attr bool leaf @ leave()(val)(val) */ -bool -attr_leaf_leave(void) -{ - return -#line 1103 "insns.def" -false; -#line 6828 "insns_info.inc" -} - -/* attr const char* name @ leave()(val)(val) */ -const char* -attr_name_leave(void) -{ - return insn_name(BIN(leave)); -} - -/* attr rb_num_t open @ leave()(val)(val) */ -rb_num_t -attr_open_leave(void) -{ - return 0; -} - -/* attr rb_num_t popn @ leave()(val)(val) */ -rb_num_t -attr_popn_leave(void) -{ - return 1; -} - -/* attr rb_num_t retn @ leave()(val)(val) */ -rb_num_t -attr_retn_leave(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ leave()(val)(val) */ -rb_snum_t -attr_sp_inc_leave(void) -{ - return 0; -} - -/* attr rb_num_t width @ leave()(val)(val) */ -rb_num_t -attr_width_leave(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ throw(throw_state)(throwobj)(val) */ -enum ruby_vminsn_type -attr_bin_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return BIN(throw); -} - -/* attr bool handles_sp @ throw(throw_state)(throwobj)(val) */ -bool -attr_handles_sp_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return false; -} - -/* attr bool leaf @ throw(throw_state)(throwobj)(val) */ -bool -attr_leaf_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return -#line 1137 "insns.def" -false; -#line 6894 "insns_info.inc" -} - -/* attr const char* name @ throw(throw_state)(throwobj)(val) */ -const char* -attr_name_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return insn_name(BIN(throw)); -} - -/* attr rb_num_t open @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_open_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 1; -} - -/* attr rb_num_t popn @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_popn_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 1; -} - -/* attr rb_num_t retn @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_retn_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ throw(throw_state)(throwobj)(val) */ -rb_snum_t -attr_sp_inc_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 0; -} - -/* attr rb_num_t width @ throw(throw_state)(throwobj)(val) */ -rb_num_t -attr_width_throw(MAYBE_UNUSED(rb_num_t throw_state)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ jump(dst)()() */ -enum ruby_vminsn_type -attr_bin_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(jump); -} - -/* attr bool handles_sp @ jump(dst)()() */ -bool -attr_handles_sp_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ jump(dst)()() */ -bool -attr_leaf_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1155 "insns.def" -leafness_of_check_ints; -#line 6960 "insns_info.inc" -} - -/* attr const char* name @ jump(dst)()() */ -const char* -attr_name_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(jump)); -} - -/* attr rb_num_t open @ jump(dst)()() */ -rb_num_t -attr_open_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ jump(dst)()() */ -rb_num_t -attr_popn_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_num_t retn @ jump(dst)()() */ -rb_num_t -attr_retn_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ jump(dst)()() */ -rb_snum_t -attr_sp_inc_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_num_t width @ jump(dst)()() */ -rb_num_t -attr_width_jump(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ branchif(dst)(val)() */ -enum ruby_vminsn_type -attr_bin_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(branchif); -} - -/* attr bool handles_sp @ branchif(dst)(val)() */ -bool -attr_handles_sp_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ branchif(dst)(val)() */ -bool -attr_leaf_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1168 "insns.def" -leafness_of_check_ints; -#line 7026 "insns_info.inc" -} - -/* attr const char* name @ branchif(dst)(val)() */ -const char* -attr_name_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(branchif)); -} - -/* attr rb_num_t open @ branchif(dst)(val)() */ -rb_num_t -attr_open_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ branchif(dst)(val)() */ -rb_num_t -attr_popn_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t retn @ branchif(dst)(val)() */ -rb_num_t -attr_retn_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ branchif(dst)(val)() */ -rb_snum_t -attr_sp_inc_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return -1; -} - -/* attr rb_num_t width @ branchif(dst)(val)() */ -rb_num_t -attr_width_branchif(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ branchunless(dst)(val)() */ -enum ruby_vminsn_type -attr_bin_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(branchunless); -} - -/* attr bool handles_sp @ branchunless(dst)(val)() */ -bool -attr_handles_sp_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ branchunless(dst)(val)() */ -bool -attr_leaf_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1183 "insns.def" -leafness_of_check_ints; -#line 7092 "insns_info.inc" -} - -/* attr const char* name @ branchunless(dst)(val)() */ -const char* -attr_name_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(branchunless)); -} - -/* attr rb_num_t open @ branchunless(dst)(val)() */ -rb_num_t -attr_open_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ branchunless(dst)(val)() */ -rb_num_t -attr_popn_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t retn @ branchunless(dst)(val)() */ -rb_num_t -attr_retn_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ branchunless(dst)(val)() */ -rb_snum_t -attr_sp_inc_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return -1; -} - -/* attr rb_num_t width @ branchunless(dst)(val)() */ -rb_num_t -attr_width_branchunless(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ branchnil(dst)(val)() */ -enum ruby_vminsn_type -attr_bin_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return BIN(branchnil); -} - -/* attr bool handles_sp @ branchnil(dst)(val)() */ -bool -attr_handles_sp_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return false; -} - -/* attr bool leaf @ branchnil(dst)(val)() */ -bool -attr_leaf_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return -#line 1198 "insns.def" -leafness_of_check_ints; -#line 7158 "insns_info.inc" -} - -/* attr const char* name @ branchnil(dst)(val)() */ -const char* -attr_name_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return insn_name(BIN(branchnil)); -} - -/* attr rb_num_t open @ branchnil(dst)(val)() */ -rb_num_t -attr_open_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t popn @ branchnil(dst)(val)() */ -rb_num_t -attr_popn_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 1; -} - -/* attr rb_num_t retn @ branchnil(dst)(val)() */ -rb_num_t -attr_retn_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ branchnil(dst)(val)() */ -rb_snum_t -attr_sp_inc_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return -1; -} - -/* attr rb_num_t width @ branchnil(dst)(val)() */ -rb_num_t -attr_width_branchnil(MAYBE_UNUSED(OFFSET dst)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ once(iseq, ise)()(val) */ -enum ruby_vminsn_type -attr_bin_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return BIN(once); -} - -/* attr bool handles_sp @ once(iseq, ise)()(val) */ -bool -attr_handles_sp_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return true; -} - -/* attr bool leaf @ once(iseq, ise)()(val) */ -bool -attr_leaf_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return false; -} - -/* attr const char* name @ once(iseq, ise)()(val) */ -const char* -attr_name_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return insn_name(BIN(once)); -} - -/* attr rb_num_t open @ once(iseq, ise)()(val) */ -rb_num_t -attr_open_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 2; -} - -/* attr rb_num_t popn @ once(iseq, ise)()(val) */ -rb_num_t -attr_popn_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 0; -} - -/* attr rb_num_t retn @ once(iseq, ise)()(val) */ -rb_num_t -attr_retn_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ once(iseq, ise)()(val) */ -rb_snum_t -attr_sp_inc_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 1; -} - -/* attr rb_num_t width @ once(iseq, ise)()(val) */ -rb_num_t -attr_width_once( - MAYBE_UNUSED(ISEQ iseq), - MAYBE_UNUSED(ISE ise) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_case_dispatch(hash, else_offset)(..., key)() */ -enum ruby_vminsn_type -attr_bin_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return BIN(opt_case_dispatch); -} - -/* attr bool handles_sp @ opt_case_dispatch(hash, else_offset)(..., key)() */ -bool -attr_handles_sp_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return false; -} - -/* attr bool leaf @ opt_case_dispatch(hash, else_offset)(..., key)() */ -bool -attr_leaf_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return true; -} - -/* attr const char* name @ opt_case_dispatch(hash, else_offset)(..., key)() */ -const char* -attr_name_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return insn_name(BIN(opt_case_dispatch)); -} - -/* attr rb_num_t open @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_open_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_popn_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_retn_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_snum_t -attr_sp_inc_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return -#line 1226 "insns.def" --1; -#line 7373 "insns_info.inc" -} - -/* attr rb_num_t width @ opt_case_dispatch(hash, else_offset)(..., key)() */ -rb_num_t -attr_width_opt_case_dispatch( - MAYBE_UNUSED(CDHASH hash), - MAYBE_UNUSED(OFFSET else_offset) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_plus(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_plus); -} - -/* attr bool handles_sp @ opt_plus(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_plus(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_plus(cd)(recv, obj)(val) */ -const char* -attr_name_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_plus)); -} - -/* attr rb_num_t open @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_plus(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_plus(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_plus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_minus(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_minus); -} - -/* attr bool handles_sp @ opt_minus(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_minus(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_minus(cd)(recv, obj)(val) */ -const char* -attr_name_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_minus)); -} - -/* attr rb_num_t open @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_minus(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_minus(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_minus(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_mult(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_mult); -} - -/* attr bool handles_sp @ opt_mult(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_mult(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_mult(cd)(recv, obj)(val) */ -const char* -attr_name_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_mult)); -} - -/* attr rb_num_t open @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_mult(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_mult(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_mult(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_div(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_div); -} - -/* attr bool handles_sp @ opt_div(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_div(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1287 "insns.def" -false; -#line 7596 "insns_info.inc" -} - -/* attr const char* name @ opt_div(cd)(recv, obj)(val) */ -const char* -attr_name_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_div)); -} - -/* attr rb_num_t open @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_div(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_div(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_div(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_mod(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_mod); -} - -/* attr bool handles_sp @ opt_mod(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_mod(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1303 "insns.def" -false; -#line 7662 "insns_info.inc" -} - -/* attr const char* name @ opt_mod(cd)(recv, obj)(val) */ -const char* -attr_name_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_mod)); -} - -/* attr rb_num_t open @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_mod(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_mod(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_eq(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_eq); -} - -/* attr bool handles_sp @ opt_eq(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_eq(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_eq(cd)(recv, obj)(val) */ -const char* -attr_name_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_eq)); -} - -/* attr rb_num_t open @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_eq(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_eq(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_eq(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_neq); -} - -/* attr bool handles_sp @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -bool -attr_leaf_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return true; -} - -/* attr const char* name @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -const char* -attr_name_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_neq)); -} - -/* attr rb_num_t open @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -1; -} - -/* attr rb_num_t width @ opt_neq(cd_eq, cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_neq( - MAYBE_UNUSED(CALL_DATA cd_eq), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_lt(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_lt); -} - -/* attr bool handles_sp @ opt_lt(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_lt(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_lt(cd)(recv, obj)(val) */ -const char* -attr_name_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_lt)); -} - -/* attr rb_num_t open @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_lt(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_lt(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_lt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_le(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_le); -} - -/* attr bool handles_sp @ opt_le(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_le(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_le(cd)(recv, obj)(val) */ -const char* -attr_name_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_le)); -} - -/* attr rb_num_t open @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_le(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_le(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_le(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_gt(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_gt); -} - -/* attr bool handles_sp @ opt_gt(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_gt(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_gt(cd)(recv, obj)(val) */ -const char* -attr_name_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_gt)); -} - -/* attr rb_num_t open @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_gt(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_gt(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_gt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_ge(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_ge); -} - -/* attr bool handles_sp @ opt_ge(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_ge(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_ge(cd)(recv, obj)(val) */ -const char* -attr_name_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_ge)); -} - -/* attr rb_num_t open @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_ge(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_ge(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_ge(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_ltlt(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_ltlt); -} - -/* attr bool handles_sp @ opt_ltlt(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_ltlt(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1405 "insns.def" -false; -#line 8133 "insns_info.inc" -} - -/* attr const char* name @ opt_ltlt(cd)(recv, obj)(val) */ -const char* -attr_name_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_ltlt)); -} - -/* attr rb_num_t open @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_ltlt(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_ltlt(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_and(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_and); -} - -/* attr bool handles_sp @ opt_and(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_and(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_and(cd)(recv, obj)(val) */ -const char* -attr_name_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_and)); -} - -/* attr rb_num_t open @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_and(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_and(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_and(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_or(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_or); -} - -/* attr bool handles_sp @ opt_or(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_or(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_or(cd)(recv, obj)(val) */ -const char* -attr_name_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_or)); -} - -/* attr rb_num_t open @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_or(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_or(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_or(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_aref(cd)(recv, obj)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_aref); -} - -/* attr bool handles_sp @ opt_aref(cd)(recv, obj)(val) */ -bool -attr_handles_sp_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_aref(cd)(recv, obj)(val) */ -bool -attr_leaf_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1452 "insns.def" -false; -#line 8325 "insns_info.inc" -} - -/* attr const char* name @ opt_aref(cd)(recv, obj)(val) */ -const char* -attr_name_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_aref)); -} - -/* attr rb_num_t open @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_open_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_popn_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_retn_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aref(cd)(recv, obj)(val) */ -rb_snum_t -attr_sp_inc_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_aref(cd)(recv, obj)(val) */ -rb_num_t -attr_width_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_aset(cd)(recv, obj, set)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_aset); -} - -/* attr bool handles_sp @ opt_aset(cd)(recv, obj, set)(val) */ -bool -attr_handles_sp_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_aset(cd)(recv, obj, set)(val) */ -bool -attr_leaf_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1469 "insns.def" -false; -#line 8391 "insns_info.inc" -} - -/* attr const char* name @ opt_aset(cd)(recv, obj, set)(val) */ -const char* -attr_name_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_aset)); -} - -/* attr rb_num_t open @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_open_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_popn_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 3; -} - -/* attr rb_num_t retn @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_retn_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aset(cd)(recv, obj, set)(val) */ -rb_snum_t -attr_sp_inc_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -2; -} - -/* attr rb_num_t width @ opt_aset(cd)(recv, obj, set)(val) */ -rb_num_t -attr_width_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_aset_with(key, cd)(recv, val)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_aset_with); -} - -/* attr bool handles_sp @ opt_aset_with(key, cd)(recv, val)(val) */ -bool -attr_handles_sp_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_aset_with(key, cd)(recv, val)(val) */ -bool -attr_leaf_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -#line 1485 "insns.def" -false; -#line 8466 "insns_info.inc" -} - -/* attr const char* name @ opt_aset_with(key, cd)(recv, val)(val) */ -const char* -attr_name_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_aset_with)); -} - -/* attr rb_num_t open @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_open_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_popn_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_retn_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_snum_t -attr_sp_inc_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -1; -} - -/* attr rb_num_t width @ opt_aset_with(key, cd)(recv, val)(val) */ -rb_num_t -attr_width_opt_aset_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_aref_with(key, cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return BIN(opt_aref_with); -} - -/* attr bool handles_sp @ opt_aref_with(key, cd)(recv)(val) */ -bool -attr_handles_sp_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return false; -} - -/* attr bool leaf @ opt_aref_with(key, cd)(recv)(val) */ -bool -attr_leaf_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return -#line 1506 "insns.def" -false; -#line 8559 "insns_info.inc" -} - -/* attr const char* name @ opt_aref_with(key, cd)(recv)(val) */ -const char* -attr_name_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return insn_name(BIN(opt_aref_with)); -} - -/* attr rb_num_t open @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_open_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_popn_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_retn_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_aref_with(key, cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 0; -} - -/* attr rb_num_t width @ opt_aref_with(key, cd)(recv)(val) */ -rb_num_t -attr_width_opt_aref_with( - MAYBE_UNUSED(VALUE key), - MAYBE_UNUSED(CALL_DATA cd) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_length(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_length); -} - -/* attr bool handles_sp @ opt_length(cd)(recv)(val) */ -bool -attr_handles_sp_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_length(cd)(recv)(val) */ -bool -attr_leaf_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_length(cd)(recv)(val) */ -const char* -attr_name_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_length)); -} - -/* attr rb_num_t open @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_open_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_length(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_length(cd)(recv)(val) */ -rb_num_t -attr_width_opt_length(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_size(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_size); -} - -/* attr bool handles_sp @ opt_size(cd)(recv)(val) */ -bool -attr_handles_sp_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_size(cd)(recv)(val) */ -bool -attr_leaf_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_size(cd)(recv)(val) */ -const char* -attr_name_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_size)); -} - -/* attr rb_num_t open @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_open_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_size(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_size(cd)(recv)(val) */ -rb_num_t -attr_width_opt_size(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_empty_p(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_empty_p); -} - -/* attr bool handles_sp @ opt_empty_p(cd)(recv)(val) */ -bool -attr_handles_sp_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_empty_p(cd)(recv)(val) */ -bool -attr_leaf_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_empty_p(cd)(recv)(val) */ -const char* -attr_name_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_empty_p)); -} - -/* attr rb_num_t open @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_open_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_empty_p(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_empty_p(cd)(recv)(val) */ -rb_num_t -attr_width_opt_empty_p(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_succ(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_succ); -} - -/* attr bool handles_sp @ opt_succ(cd)(recv)(val) */ -bool -attr_handles_sp_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_succ(cd)(recv)(val) */ -bool -attr_leaf_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_succ(cd)(recv)(val) */ -const char* -attr_name_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_succ)); -} - -/* attr rb_num_t open @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_open_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_succ(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_succ(cd)(recv)(val) */ -rb_num_t -attr_width_opt_succ(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_not(cd)(recv)(val) */ -enum ruby_vminsn_type -attr_bin_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_not); -} - -/* attr bool handles_sp @ opt_not(cd)(recv)(val) */ -bool -attr_handles_sp_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_not(cd)(recv)(val) */ -bool -attr_leaf_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return true; -} - -/* attr const char* name @ opt_not(cd)(recv)(val) */ -const char* -attr_name_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_not)); -} - -/* attr rb_num_t open @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_open_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_popn_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t retn @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_retn_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_not(cd)(recv)(val) */ -rb_snum_t -attr_sp_inc_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 0; -} - -/* attr rb_num_t width @ opt_not(cd)(recv)(val) */ -rb_num_t -attr_width_opt_not(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -enum ruby_vminsn_type -attr_bin_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return BIN(opt_regexpmatch2); -} - -/* attr bool handles_sp @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -bool -attr_handles_sp_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return false; -} - -/* attr bool leaf @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -bool -attr_leaf_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -#line 1592 "insns.def" -false; -#line 8958 "insns_info.inc" -} - -/* attr const char* name @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -const char* -attr_name_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return insn_name(BIN(opt_regexpmatch2)); -} - -/* attr rb_num_t open @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_open_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_num_t popn @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_popn_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr rb_num_t retn @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_retn_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_snum_t -attr_sp_inc_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return -1; -} - -/* attr rb_num_t width @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ -rb_num_t -attr_width_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ invokebuiltin(bf)(...)(val) */ -enum ruby_vminsn_type -attr_bin_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return BIN(invokebuiltin); -} - -/* attr bool handles_sp @ invokebuiltin(bf)(...)(val) */ -bool -attr_handles_sp_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return false; -} - -/* attr bool leaf @ invokebuiltin(bf)(...)(val) */ -bool -attr_leaf_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return -#line 1607 "insns.def" -false; -#line 9024 "insns_info.inc" -} - -/* attr const char* name @ invokebuiltin(bf)(...)(val) */ -const char* -attr_name_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return insn_name(BIN(invokebuiltin)); -} - -/* attr rb_num_t open @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_open_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 1; -} - -/* attr rb_num_t popn @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_popn_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 0; -} - -/* attr rb_num_t retn @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_retn_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ invokebuiltin(bf)(...)(val) */ -rb_snum_t -attr_sp_inc_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return -#line 1608 "insns.def" -1 - bf->argc; -#line 9062 "insns_info.inc" -} - -/* attr rb_num_t width @ invokebuiltin(bf)(...)(val) */ -rb_num_t -attr_width_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ opt_invokebuiltin_delegate(bf, index)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return BIN(opt_invokebuiltin_delegate); -} - -/* attr bool handles_sp @ opt_invokebuiltin_delegate(bf, index)()(val) */ -bool -attr_handles_sp_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return false; -} - -/* attr bool leaf @ opt_invokebuiltin_delegate(bf, index)()(val) */ -bool -attr_leaf_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return -#line 1619 "insns.def" -false; -#line 9102 "insns_info.inc" -} - -/* attr const char* name @ opt_invokebuiltin_delegate(bf, index)()(val) */ -const char* -attr_name_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return insn_name(BIN(opt_invokebuiltin_delegate)); -} - -/* attr rb_num_t open @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_open_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_popn_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_retn_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_snum_t -attr_sp_inc_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_invokebuiltin_delegate(bf, index)()(val) */ -rb_num_t -attr_width_opt_invokebuiltin_delegate( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -enum ruby_vminsn_type -attr_bin_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return BIN(opt_invokebuiltin_delegate_leave); -} - -/* attr bool handles_sp @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -bool -attr_handles_sp_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return false; -} - -/* attr bool leaf @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -bool -attr_leaf_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return -#line 1630 "insns.def" -false; -#line 9195 "insns_info.inc" -} - -/* attr const char* name @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -const char* -attr_name_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return insn_name(BIN(opt_invokebuiltin_delegate_leave)); -} - -/* attr rb_num_t open @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_open_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 2; -} - -/* attr rb_num_t popn @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_popn_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 0; -} - -/* attr rb_num_t retn @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_retn_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_snum_t -attr_sp_inc_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 1; -} - -/* attr rb_num_t width @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -rb_num_t -attr_width_opt_invokebuiltin_delegate_leave( - MAYBE_UNUSED(RB_BUILTIN bf), - MAYBE_UNUSED(rb_num_t index) -) -{ - return 3; -} - -/* attr enum ruby_vminsn_type bin @ getlocal_WC_0(idx)()(val) */ -enum ruby_vminsn_type -attr_bin_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(getlocal_WC_0); -} - -/* attr bool handles_sp @ getlocal_WC_0(idx)()(val) */ -bool -attr_handles_sp_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ getlocal_WC_0(idx)()(val) */ -bool -attr_leaf_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ getlocal_WC_0(idx)()(val) */ -const char* -attr_name_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(getlocal_WC_0)); -} - -/* attr rb_num_t open @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_open_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_popn_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_num_t retn @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_retn_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getlocal_WC_0(idx)()(val) */ -rb_snum_t -attr_sp_inc_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t width @ getlocal_WC_0(idx)()(val) */ -rb_num_t -attr_width_getlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ getlocal_WC_1(idx)()(val) */ -enum ruby_vminsn_type -attr_bin_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(getlocal_WC_1); -} - -/* attr bool handles_sp @ getlocal_WC_1(idx)()(val) */ -bool -attr_handles_sp_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ getlocal_WC_1(idx)()(val) */ -bool -attr_leaf_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ getlocal_WC_1(idx)()(val) */ -const char* -attr_name_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(getlocal_WC_1)); -} - -/* attr rb_num_t open @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_open_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_popn_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_num_t retn @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_retn_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ getlocal_WC_1(idx)()(val) */ -rb_snum_t -attr_sp_inc_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t width @ getlocal_WC_1(idx)()(val) */ -rb_num_t -attr_width_getlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setlocal_WC_0(idx)(val)() */ -enum ruby_vminsn_type -attr_bin_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(setlocal_WC_0); -} - -/* attr bool handles_sp @ setlocal_WC_0(idx)(val)() */ -bool -attr_handles_sp_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ setlocal_WC_0(idx)(val)() */ -bool -attr_leaf_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ setlocal_WC_0(idx)(val)() */ -const char* -attr_name_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(setlocal_WC_0)); -} - -/* attr rb_num_t open @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_open_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_popn_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t retn @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_retn_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setlocal_WC_0(idx)(val)() */ -rb_snum_t -attr_sp_inc_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return -1; -} - -/* attr rb_num_t width @ setlocal_WC_0(idx)(val)() */ -rb_num_t -attr_width_setlocal_WC_0(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ setlocal_WC_1(idx)(val)() */ -enum ruby_vminsn_type -attr_bin_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return BIN(setlocal_WC_1); -} - -/* attr bool handles_sp @ setlocal_WC_1(idx)(val)() */ -bool -attr_handles_sp_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return false; -} - -/* attr bool leaf @ setlocal_WC_1(idx)(val)() */ -bool -attr_leaf_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return true; -} - -/* attr const char* name @ setlocal_WC_1(idx)(val)() */ -const char* -attr_name_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return insn_name(BIN(setlocal_WC_1)); -} - -/* attr rb_num_t open @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_open_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t popn @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_popn_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 1; -} - -/* attr rb_num_t retn @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_retn_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 0; -} - -/* attr rb_snum_t sp_inc @ setlocal_WC_1(idx)(val)() */ -rb_snum_t -attr_sp_inc_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return -1; -} - -/* attr rb_num_t width @ setlocal_WC_1(idx)(val)() */ -rb_num_t -attr_width_setlocal_WC_1(MAYBE_UNUSED(lindex_t idx)) -{ - return 2; -} - -/* attr enum ruby_vminsn_type bin @ putobject_INT2FIX_0_()()(val) */ -enum ruby_vminsn_type -attr_bin_putobject_INT2FIX_0_(void) -{ - return BIN(putobject_INT2FIX_0_); -} - -/* attr bool handles_sp @ putobject_INT2FIX_0_()()(val) */ -bool -attr_handles_sp_putobject_INT2FIX_0_(void) -{ - return false; -} - -/* attr bool leaf @ putobject_INT2FIX_0_()()(val) */ -bool -attr_leaf_putobject_INT2FIX_0_(void) -{ - return true; -} - -/* attr const char* name @ putobject_INT2FIX_0_()()(val) */ -const char* -attr_name_putobject_INT2FIX_0_(void) -{ - return insn_name(BIN(putobject_INT2FIX_0_)); -} - -/* attr rb_num_t open @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_open_putobject_INT2FIX_0_(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_popn_putobject_INT2FIX_0_(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_retn_putobject_INT2FIX_0_(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putobject_INT2FIX_0_()()(val) */ -rb_snum_t -attr_sp_inc_putobject_INT2FIX_0_(void) -{ - return 1; -} - -/* attr rb_num_t width @ putobject_INT2FIX_0_()()(val) */ -rb_num_t -attr_width_putobject_INT2FIX_0_(void) -{ - return 1; -} - -/* attr enum ruby_vminsn_type bin @ putobject_INT2FIX_1_()()(val) */ -enum ruby_vminsn_type -attr_bin_putobject_INT2FIX_1_(void) -{ - return BIN(putobject_INT2FIX_1_); -} - -/* attr bool handles_sp @ putobject_INT2FIX_1_()()(val) */ -bool -attr_handles_sp_putobject_INT2FIX_1_(void) -{ - return false; -} - -/* attr bool leaf @ putobject_INT2FIX_1_()()(val) */ -bool -attr_leaf_putobject_INT2FIX_1_(void) -{ - return true; -} - -/* attr const char* name @ putobject_INT2FIX_1_()()(val) */ -const char* -attr_name_putobject_INT2FIX_1_(void) -{ - return insn_name(BIN(putobject_INT2FIX_1_)); -} - -/* attr rb_num_t open @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_open_putobject_INT2FIX_1_(void) -{ - return 0; -} - -/* attr rb_num_t popn @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_popn_putobject_INT2FIX_1_(void) -{ - return 0; -} - -/* attr rb_num_t retn @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_retn_putobject_INT2FIX_1_(void) -{ - return 1; -} - -/* attr rb_snum_t sp_inc @ putobject_INT2FIX_1_()()(val) */ -rb_snum_t -attr_sp_inc_putobject_INT2FIX_1_(void) -{ - return 1; -} - -/* attr rb_num_t width @ putobject_INT2FIX_1_()()(val) */ -rb_num_t -attr_width_putobject_INT2FIX_1_(void) -{ - return 1; -} - -PUREFUNC(MAYBE_UNUSED(static int comptime_insn_stack_increase(int depth, int insn, const VALUE *opes))); -PUREFUNC(static rb_snum_t comptime_insn_stack_increase_dispatch(enum ruby_vminsn_type insn, const VALUE *opes)); - -rb_snum_t -comptime_insn_stack_increase_dispatch(enum ruby_vminsn_type insn, const VALUE *opes) -{ - static const signed char t[] = { - 0, 1, -1, 1, -1, 1, 1, -1, - 1, -1, 1, -1, 1, -1, -2, 1, - -1, 1, 1, 1, 1, 1, 1, -127, - -1, -127, 0, -127, -1, 1, 1, -127, - -1, -1, -127, 0, 0, -127, -1, -1, - 1, -127, 0, -127, -127, -127, -127, 0, - 1, -1, 1, 0, -1, 0, -1, -127, - -127, -127, 0, 1, 1, 1, 0, 1, - -127, -127, -127, -127, 0, 0, 0, -1, - -1, -1, 1, -127, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -2, -1, 0, 0, 0, - 0, 0, 0, -1, -127, 1, 1, 1, - 1, -1, -1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, - }; - signed char c = t[insn]; - - ASSERT_VM_INSTRUCTION_SIZE(t); - if (c != -127) { - return c; - } - else switch(insn) { - default: - UNREACHABLE; - case BIN(concatstrings): - return attr_sp_inc_concatstrings(NUM2LONG(opes[0])); - case BIN(toregexp): - return attr_sp_inc_toregexp(NUM2LONG(opes[0]), NUM2LONG(opes[1])); - case BIN(newarray): - return attr_sp_inc_newarray(NUM2LONG(opes[0])); - case BIN(expandarray): - return attr_sp_inc_expandarray(NUM2LONG(opes[0]), NUM2LONG(opes[1])); - case BIN(pushtoarray): - return attr_sp_inc_pushtoarray(NUM2LONG(opes[0])); - case BIN(newhash): - return attr_sp_inc_newhash(NUM2LONG(opes[0])); - case BIN(dupn): - return attr_sp_inc_dupn(NUM2LONG(opes[0])); - case BIN(opt_reverse): - return attr_sp_inc_opt_reverse(NUM2LONG(opes[0])); - case BIN(topn): - return attr_sp_inc_topn(NUM2LONG(opes[0])); - case BIN(setn): - return attr_sp_inc_setn(NUM2LONG(opes[0])); - case BIN(adjuststack): - return attr_sp_inc_adjuststack(NUM2LONG(opes[0])); - case BIN(send): - return attr_comptime_sp_inc_send((CALL_INFO)(opes[0]), (ISEQ)(opes[1])); - case BIN(sendforward): - return attr_comptime_sp_inc_sendforward((CALL_INFO)(opes[0]), (ISEQ)(opes[1])); - case BIN(opt_send_without_block): - return attr_comptime_sp_inc_opt_send_without_block((CALL_INFO)(opes[0])); - case BIN(opt_newarray_send): - return attr_comptime_sp_inc_opt_newarray_send(NUM2LONG(opes[0]), NUM2LONG(opes[1])); - case BIN(invokesuper): - return attr_comptime_sp_inc_invokesuper((CALL_INFO)(opes[0]), (ISEQ)(opes[1])); - case BIN(invokesuperforward): - return attr_comptime_sp_inc_invokesuperforward((CALL_INFO)(opes[0]), (ISEQ)(opes[1])); - case BIN(invokeblock): - return attr_comptime_sp_inc_invokeblock((CALL_INFO)(opes[0])); - case BIN(opt_case_dispatch): - return attr_sp_inc_opt_case_dispatch((CDHASH)(opes[0]), (OFFSET)(opes[1])); - case BIN(invokebuiltin): - return attr_sp_inc_invokebuiltin((RB_BUILTIN)(opes[0])); - } -} - -int -comptime_insn_stack_increase(int depth, int insn, const VALUE *opes) -{ - enum ruby_vminsn_type itype = (enum ruby_vminsn_type)insn; - return depth + (int)comptime_insn_stack_increase_dispatch(itype, opes); -} - -PUREFUNC(MAYBE_UNUSED(static bool insn_may_depend_on_sp_or_pc(int insn, const VALUE *opes))); - -static bool -insn_may_depend_on_sp_or_pc(int insn, const VALUE *opes) -{ - switch (insn) { - case BIN(getspecial): - case BIN(getinstancevariable): - case BIN(setinstancevariable): - case BIN(getclassvariable): - case BIN(setclassvariable): - case BIN(opt_getconstant_path): - case BIN(getconstant): - case BIN(setconstant): - case BIN(getglobal): - case BIN(setglobal): - case BIN(putspecialobject): - case BIN(concatstrings): - case BIN(toregexp): - case BIN(expandarray): - case BIN(concatarray): - case BIN(concattoarray): - case BIN(splatarray): - case BIN(splatkw): - case BIN(newhash): - case BIN(newrange): - case BIN(defined): - case BIN(definedivar): - case BIN(checkmatch): - case BIN(defineclass): - case BIN(definemethod): - case BIN(definesmethod): - case BIN(send): - case BIN(sendforward): - case BIN(opt_send_without_block): - case BIN(objtostring): - case BIN(opt_newarray_send): - case BIN(invokesuper): - case BIN(invokesuperforward): - case BIN(invokeblock): - case BIN(leave): - case BIN(throw): - case BIN(jump): - case BIN(branchif): - case BIN(branchunless): - case BIN(branchnil): - case BIN(once): - case BIN(opt_div): - case BIN(opt_mod): - case BIN(opt_ltlt): - case BIN(opt_aref): - case BIN(opt_aset): - case BIN(opt_aset_with): - case BIN(opt_aref_with): - case BIN(opt_regexpmatch2): - case BIN(invokebuiltin): - case BIN(opt_invokebuiltin_delegate): - case BIN(opt_invokebuiltin_delegate_leave): - case BIN(trace_nop): - case BIN(trace_getlocal): - case BIN(trace_setlocal): - case BIN(trace_getblockparam): - case BIN(trace_setblockparam): - case BIN(trace_getblockparamproxy): - case BIN(trace_getspecial): - case BIN(trace_setspecial): - case BIN(trace_getinstancevariable): - case BIN(trace_setinstancevariable): - case BIN(trace_getclassvariable): - case BIN(trace_setclassvariable): - case BIN(trace_opt_getconstant_path): - case BIN(trace_getconstant): - case BIN(trace_setconstant): - case BIN(trace_getglobal): - case BIN(trace_setglobal): - case BIN(trace_putnil): - case BIN(trace_putself): - case BIN(trace_putobject): - case BIN(trace_putspecialobject): - case BIN(trace_putstring): - case BIN(trace_putchilledstring): - case BIN(trace_concatstrings): - case BIN(trace_anytostring): - case BIN(trace_toregexp): - case BIN(trace_intern): - case BIN(trace_newarray): - case BIN(trace_pushtoarraykwsplat): - case BIN(trace_duparray): - case BIN(trace_duphash): - case BIN(trace_expandarray): - case BIN(trace_concatarray): - case BIN(trace_concattoarray): - case BIN(trace_pushtoarray): - case BIN(trace_splatarray): - case BIN(trace_splatkw): - case BIN(trace_newhash): - case BIN(trace_newrange): - case BIN(trace_pop): - case BIN(trace_dup): - case BIN(trace_dupn): - case BIN(trace_swap): - case BIN(trace_opt_reverse): - case BIN(trace_topn): - case BIN(trace_setn): - case BIN(trace_adjuststack): - case BIN(trace_defined): - case BIN(trace_definedivar): - case BIN(trace_checkmatch): - case BIN(trace_checkkeyword): - case BIN(trace_checktype): - case BIN(trace_defineclass): - case BIN(trace_definemethod): - case BIN(trace_definesmethod): - case BIN(trace_send): - case BIN(trace_sendforward): - case BIN(trace_opt_send_without_block): - case BIN(trace_objtostring): - case BIN(trace_opt_ary_freeze): - case BIN(trace_opt_hash_freeze): - case BIN(trace_opt_str_freeze): - case BIN(trace_opt_nil_p): - case BIN(trace_opt_str_uminus): - case BIN(trace_opt_newarray_send): - case BIN(trace_invokesuper): - case BIN(trace_invokesuperforward): - case BIN(trace_invokeblock): - case BIN(trace_leave): - case BIN(trace_throw): - case BIN(trace_jump): - case BIN(trace_branchif): - case BIN(trace_branchunless): - case BIN(trace_branchnil): - case BIN(trace_once): - case BIN(trace_opt_case_dispatch): - case BIN(trace_opt_plus): - case BIN(trace_opt_minus): - case BIN(trace_opt_mult): - case BIN(trace_opt_div): - case BIN(trace_opt_mod): - case BIN(trace_opt_eq): - case BIN(trace_opt_neq): - case BIN(trace_opt_lt): - case BIN(trace_opt_le): - case BIN(trace_opt_gt): - case BIN(trace_opt_ge): - case BIN(trace_opt_ltlt): - case BIN(trace_opt_and): - case BIN(trace_opt_or): - case BIN(trace_opt_aref): - case BIN(trace_opt_aset): - case BIN(trace_opt_aset_with): - case BIN(trace_opt_aref_with): - case BIN(trace_opt_length): - case BIN(trace_opt_size): - case BIN(trace_opt_empty_p): - case BIN(trace_opt_succ): - case BIN(trace_opt_not): - case BIN(trace_opt_regexpmatch2): - case BIN(trace_invokebuiltin): - case BIN(trace_opt_invokebuiltin_delegate): - case BIN(trace_opt_invokebuiltin_delegate_leave): - case BIN(trace_getlocal_WC_0): - case BIN(trace_getlocal_WC_1): - case BIN(trace_setlocal_WC_0): - case BIN(trace_setlocal_WC_1): - case BIN(trace_putobject_INT2FIX_0_): - case BIN(trace_putobject_INT2FIX_1_): - return true; - default: - return false; - } -} - diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal.h deleted file mode 100644 index 4fb99d1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef RUBY_INTERNAL_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_INTERNAL_H 1 -/** - * @author $Author$ - * @date Tue May 17 11:42:20 JST 2011 - * @copyright Copyright (C) 2011 Yukihiro Matsumoto - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ -#include "ruby/internal/config.h" - -#ifdef __cplusplus -# error not for C++ -#endif - -#define LIKELY(x) RB_LIKELY(x) -#define UNLIKELY(x) RB_UNLIKELY(x) - -#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#define roomof(x, y) (((x) + (y) - 1) / (y)) -#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) - -/* Prevent compiler from reordering access */ -#define ACCESS_ONCE(type,x) (*((volatile type *)&(x))) - -#define UNDEF_P RB_UNDEF_P -#define NIL_OR_UNDEF_P RB_NIL_OR_UNDEF_P - -#include "ruby/ruby.h" - -/* Following macros were formerly defined in this header but moved to somewhere - * else. In order to detect them we undef here. */ - -/* internal/array.h */ -#undef RARRAY_AREF - -/* internal/class.h */ -#undef RClass -#undef RCLASS_SUPER - -/* internal/hash.h */ -#undef RHASH_IFNONE -#undef RHASH_SIZE -#undef RHASH_TBL -#undef RHASH_EMPTY_P - -/* internal/struct.h */ -#undef RSTRUCT_LEN -#undef RSTRUCT_PTR -#undef RSTRUCT_SET -#undef RSTRUCT_GET - -/* Also, we keep the following macros here. They are expected to be - * overridden in each headers. */ - -/* internal/array.h */ -#define rb_ary_new_from_args(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/io.h */ -#define rb_io_fptr_finalize(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/string.h */ -#define rb_fstring_cstr(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/symbol.h */ -#define rb_sym_intern_ascii_cstr(...) rb_nonexistent_symbol(__VA_ARGS__) - -/* internal/vm.h */ -#define rb_funcallv(...) rb_nonexistent_symbol(__VA_ARGS__) -#define rb_method_basic_definition_p(...) rb_nonexistent_symbol(__VA_ARGS__) - - -/* MRI debug support */ - -/* gc.c */ -void rb_obj_info_dump(VALUE obj); -void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func); - -/* debug.c */ - -RUBY_SYMBOL_EXPORT_BEGIN -void ruby_debug_breakpoint(void); -PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2); -RUBY_SYMBOL_EXPORT_END - -// show obj data structure without any side-effect -#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING) - -// same as rp, but add message header -#define rp_m(msg, obj) do { \ - fputs((msg), stderr); \ - rb_obj_info_dump((VALUE)(obj)); \ -} while (0) - -// `ruby_debug_breakpoint()` does nothing, -// but breakpoint is set in run.gdb, so `make gdb` can stop here. -#define bp() ruby_debug_breakpoint() - -#define RBOOL(v) ((v) ? Qtrue : Qfalse) -#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM) - -#ifndef __MINGW32__ -#undef memcpy -#define memcpy ruby_nonempty_memcpy -#endif -#endif /* RUBY_INTERNAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/array.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/array.h deleted file mode 100644 index 398676d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/array.h +++ /dev/null @@ -1,152 +0,0 @@ -#ifndef INTERNAL_ARRAY_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ARRAY_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Array. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for RARRAY_LEN */ - -#ifndef ARRAY_DEBUG -# define ARRAY_DEBUG (0+RUBY_DEBUG) -#endif - -#define RARRAY_SHARED_FLAG ELTS_SHARED -#define RARRAY_SHARED_ROOT_FLAG FL_USER12 -#define RARRAY_PTR_IN_USE_FLAG FL_USER14 - -/* array.c */ -VALUE rb_ary_hash_values(long len, const VALUE *elements); -VALUE rb_ary_last(int, const VALUE *, VALUE); -void rb_ary_set_len(VALUE, long); -void rb_ary_delete_same(VALUE, VALUE); -VALUE rb_ary_hidden_new_fill(long capa); -VALUE rb_ary_at(VALUE, VALUE); -size_t rb_ary_memsize(VALUE); -VALUE rb_to_array_type(VALUE obj); -VALUE rb_to_array(VALUE obj); -void rb_ary_cancel_sharing(VALUE ary); -size_t rb_ary_size_as_embedded(VALUE ary); -void rb_ary_make_embedded(VALUE ary); -bool rb_ary_embeddable_p(VALUE ary); -VALUE rb_ary_diff(VALUE ary1, VALUE ary2); -RUBY_EXTERN VALUE rb_cArray_empty_frozen; - -static inline VALUE rb_ary_entry_internal(VALUE ary, long offset); -static inline bool ARY_PTR_USING_P(VALUE ary); - -VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *); -VALUE rb_check_to_array(VALUE ary); -VALUE rb_ary_behead(VALUE, long); -VALUE rb_ary_aref1(VALUE ary, VALUE i); - -struct rb_execution_context_struct; -VALUE rb_ec_ary_new_from_values(struct rb_execution_context_struct *ec, long n, const VALUE *elts); - -// YJIT needs this function to never allocate and never raise -static inline VALUE -rb_ary_entry_internal(VALUE ary, long offset) -{ - long len = RARRAY_LEN(ary); - const VALUE *ptr = RARRAY_CONST_PTR(ary); - if (len == 0) return Qnil; - if (offset < 0) { - offset += len; - if (offset < 0) return Qnil; - } - else if (len <= offset) { - return Qnil; - } - return ptr[offset]; -} - -static inline bool -ARY_PTR_USING_P(VALUE ary) -{ - return FL_TEST_RAW(ary, RARRAY_PTR_IN_USE_FLAG); -} - -RBIMPL_ATTR_MAYBE_UNUSED() -static inline int -ary_should_not_be_shared_and_embedded(VALUE ary) -{ - return !FL_ALL_RAW(ary, RARRAY_SHARED_FLAG|RARRAY_EMBED_FLAG); -} - -static inline bool -ARY_SHARED_P(VALUE ary) -{ - assert(RB_TYPE_P(ary, T_ARRAY)); - assert(ary_should_not_be_shared_and_embedded(ary)); - return FL_TEST_RAW(ary, RARRAY_SHARED_FLAG); -} - -static inline bool -ARY_EMBED_P(VALUE ary) -{ - assert(RB_TYPE_P(ary, T_ARRAY)); - assert(ary_should_not_be_shared_and_embedded(ary)); - return FL_TEST_RAW(ary, RARRAY_EMBED_FLAG); -} - -static inline VALUE -ARY_SHARED_ROOT(VALUE ary) -{ - assert(ARY_SHARED_P(ary)); - return RARRAY(ary)->as.heap.aux.shared_root; -} - -static inline bool -ARY_SHARED_ROOT_P(VALUE ary) -{ - assert(RB_TYPE_P(ary, T_ARRAY)); - return FL_TEST_RAW(ary, RARRAY_SHARED_ROOT_FLAG); -} - -static inline long -ARY_SHARED_ROOT_REFCNT(VALUE ary) -{ - assert(ARY_SHARED_ROOT_P(ary)); - return RARRAY(ary)->as.heap.aux.capa; -} - -#undef rb_ary_new_from_args -#if RBIMPL_HAS_WARNING("-Wgnu-zero-variadic-macro-arguments") -# /* Skip it; clang -pedantic doesn't like the following */ -#elif defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO) -#define rb_ary_new_from_args(n, ...) \ - __extension__ ({ \ - const VALUE args_to_new_ary[] = {__VA_ARGS__}; \ - if (__builtin_constant_p(n)) { \ - STATIC_ASSERT(rb_ary_new_from_args, numberof(args_to_new_ary) == (n)); \ - } \ - rb_ary_new_from_values(numberof(args_to_new_ary), args_to_new_ary); \ - }) -#endif - -#undef RARRAY_AREF -RBIMPL_ATTR_PURE_UNLESS_DEBUG() -RBIMPL_ATTR_ARTIFICIAL() -static inline VALUE -RARRAY_AREF(VALUE ary, long i) -{ - VALUE val; - RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY); - - RBIMPL_WARNING_PUSH(); -#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ == 13 - RBIMPL_WARNING_IGNORED(-Warray-bounds); -#endif - val = RARRAY_CONST_PTR(ary)[i]; - RBIMPL_WARNING_POP(); - return val; -} - -#endif /* INTERNAL_ARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h deleted file mode 100644 index 4732a65..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef INTERNAL_BOP_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BOP_H - -#include "internal.h" -#include "ruby/internal/dllexport.h" - -enum ruby_basic_operators { - BOP_PLUS, - BOP_MINUS, - BOP_MULT, - BOP_DIV, - BOP_MOD, - BOP_EQ, - BOP_EQQ, - BOP_LT, - BOP_LE, - BOP_LTLT, - BOP_AREF, - BOP_ASET, - BOP_LENGTH, - BOP_SIZE, - BOP_EMPTY_P, - BOP_NIL_P, - BOP_SUCC, - BOP_GT, - BOP_GE, - BOP_NOT, - BOP_NEQ, - BOP_MATCH, - BOP_FREEZE, - BOP_UMINUS, - BOP_MAX, - BOP_MIN, - BOP_HASH, - BOP_CALL, - BOP_AND, - BOP_OR, - BOP_CMP, - BOP_DEFAULT, - BOP_PACK, - - BOP_LAST_ -}; - -RUBY_EXTERN short ruby_vm_redefined_flag[BOP_LAST_]; - -/* optimize insn */ -#define INTEGER_REDEFINED_OP_FLAG (1 << 0) -#define FLOAT_REDEFINED_OP_FLAG (1 << 1) -#define STRING_REDEFINED_OP_FLAG (1 << 2) -#define ARRAY_REDEFINED_OP_FLAG (1 << 3) -#define HASH_REDEFINED_OP_FLAG (1 << 4) -/* #define BIGNUM_REDEFINED_OP_FLAG (1 << 5) */ -#define SYMBOL_REDEFINED_OP_FLAG (1 << 6) -#define TIME_REDEFINED_OP_FLAG (1 << 7) -#define REGEXP_REDEFINED_OP_FLAG (1 << 8) -#define NIL_REDEFINED_OP_FLAG (1 << 9) -#define TRUE_REDEFINED_OP_FLAG (1 << 10) -#define FALSE_REDEFINED_OP_FLAG (1 << 11) -#define PROC_REDEFINED_OP_FLAG (1 << 12) - -#define BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0)) - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h deleted file mode 100644 index db8d3ae..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef INTERNAL_BIGNUM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BIGNUM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Bignums. - */ -#include "ruby/internal/config.h" /* for HAVE_LIBGMP */ -#include /* for size_t */ - -#ifdef HAVE_SYS_TYPES_H -# include /* for ssize_t (note: on Windows ssize_t is */ -#endif /* `#define`d in ruby/config.h) */ - -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for struct RBasic */ - -#ifndef BDIGIT -# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGIT SIZEOF_INT -# define BDIGIT_DBL unsigned LONG_LONG -# define BDIGIT_DBL_SIGNED LONG_LONG -# define PRI_BDIGIT_PREFIX "" -# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX -# elif SIZEOF_INT*2 <= SIZEOF_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGIT SIZEOF_INT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "" -# define PRI_BDIGIT_DBL_PREFIX "l" -# elif SIZEOF_SHORT*2 <= SIZEOF_LONG -# define BDIGIT unsigned short -# define SIZEOF_BDIGIT SIZEOF_SHORT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "h" -# define PRI_BDIGIT_DBL_PREFIX "l" -# else -# define BDIGIT unsigned short -# define SIZEOF_BDIGIT (SIZEOF_LONG/2) -# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "h" -# define PRI_BDIGIT_DBL_PREFIX "l" -# endif -#endif - -#ifndef SIZEOF_ACTUAL_BDIGIT -# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT -#endif - -#ifdef PRI_BDIGIT_PREFIX -# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d" -# define PRIiBDIGIT PRI_BDIGIT_PREFIX"i" -# define PRIoBDIGIT PRI_BDIGIT_PREFIX"o" -# define PRIuBDIGIT PRI_BDIGIT_PREFIX"u" -# define PRIxBDIGIT PRI_BDIGIT_PREFIX"x" -# define PRIXBDIGIT PRI_BDIGIT_PREFIX"X" -#endif - -#ifdef PRI_BDIGIT_DBL_PREFIX -# define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" -# define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" -# define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" -# define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" -# define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" -# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" -#endif - -#define RBIGNUM(obj) ((struct RBignum *)(obj)) -#define BIGNUM_SIGN_BIT FL_USER1 -#define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2) -#define BIGNUM_EMBED_LEN_NUMBITS 3 -#define BIGNUM_EMBED_LEN_MASK \ - (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT) -#define BIGNUM_EMBED_LEN_SHIFT \ - (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */ -#ifndef BIGNUM_EMBED_LEN_MAX -# if (SIZEOF_VALUE*RBIMPL_RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1 -# define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*RBIMPL_RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) -# else -# define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1) -# endif -#endif - -enum rb_int_parse_flags { - RB_INT_PARSE_SIGN = 0x01, - RB_INT_PARSE_UNDERSCORE = 0x02, - RB_INT_PARSE_PREFIX = 0x04, - RB_INT_PARSE_ALL = 0x07, - RB_INT_PARSE_DEFAULT = 0x07, -}; - -struct RBignum { - struct RBasic basic; - union { - struct { - size_t len; - BDIGIT *digits; - } heap; - BDIGIT ary[BIGNUM_EMBED_LEN_MAX]; - } as; -}; - -/* bignum.c */ -extern const char ruby_digitmap[]; -double rb_big_fdiv_double(VALUE x, VALUE y); -VALUE rb_big_uminus(VALUE x); -VALUE rb_big_hash(VALUE); -VALUE rb_big_odd_p(VALUE); -VALUE rb_big_even_p(VALUE); -size_t rb_big_size(VALUE); -VALUE rb_integer_float_cmp(VALUE x, VALUE y); -VALUE rb_integer_float_eq(VALUE x, VALUE y); -VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception); -VALUE rb_big_comp(VALUE x); -VALUE rb_big_aref(VALUE x, VALUE y); -VALUE rb_big_abs(VALUE x); -VALUE rb_big_size_m(VALUE big); -VALUE rb_big_bit_length(VALUE big); -VALUE rb_big_remainder(VALUE x, VALUE y); -VALUE rb_big_gt(VALUE x, VALUE y); -VALUE rb_big_ge(VALUE x, VALUE y); -VALUE rb_big_lt(VALUE x, VALUE y); -VALUE rb_big_le(VALUE x, VALUE y); -VALUE rb_int_powm(int const argc, VALUE * const argv, VALUE const num); -VALUE rb_big_isqrt(VALUE n); -static inline bool BIGNUM_SIGN(VALUE b); -static inline bool BIGNUM_POSITIVE_P(VALUE b); -static inline bool BIGNUM_NEGATIVE_P(VALUE b); -static inline void BIGNUM_SET_SIGN(VALUE b, bool sign); -static inline void BIGNUM_NEGATE(VALUE b); -static inline size_t BIGNUM_LEN(VALUE b); -static inline BDIGIT *BIGNUM_DIGITS(VALUE b); -static inline int BIGNUM_LENINT(VALUE b); -static inline bool BIGNUM_EMBED_P(VALUE b); - -RUBY_SYMBOL_EXPORT_BEGIN -/* bignum.c (export) */ -VALUE rb_big_mul_normal(VALUE x, VALUE y); -VALUE rb_big_mul_balance(VALUE x, VALUE y); -VALUE rb_big_mul_karatsuba(VALUE x, VALUE y); -VALUE rb_big_mul_toom3(VALUE x, VALUE y); -VALUE rb_big_sq_fast(VALUE x); -VALUE rb_big_divrem_normal(VALUE x, VALUE y); -VALUE rb_big2str_poweroftwo(VALUE x, int base); -VALUE rb_big2str_generic(VALUE x, int base); -VALUE rb_str2big_poweroftwo(VALUE arg, int base, int badcheck); -VALUE rb_str2big_normal(VALUE arg, int base, int badcheck); -VALUE rb_str2big_karatsuba(VALUE arg, int base, int badcheck); -#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) -VALUE rb_big_mul_gmp(VALUE x, VALUE y); -VALUE rb_big_divrem_gmp(VALUE x, VALUE y); -VALUE rb_big2str_gmp(VALUE x, int base); -VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck); -#endif -VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags); -RUBY_SYMBOL_EXPORT_END - -#if defined(HAVE_INT128_T) -VALUE rb_int128t2big(int128_t n); -#endif - -/* sign: positive:1, negative:0 */ -static inline bool -BIGNUM_SIGN(VALUE b) -{ - return FL_TEST_RAW(b, BIGNUM_SIGN_BIT); -} - -static inline bool -BIGNUM_POSITIVE_P(VALUE b) -{ - return BIGNUM_SIGN(b); -} - -static inline bool -BIGNUM_NEGATIVE_P(VALUE b) -{ - return ! BIGNUM_POSITIVE_P(b); -} - -static inline void -BIGNUM_SET_SIGN(VALUE b, bool sign) -{ - if (sign) { - FL_SET_RAW(b, BIGNUM_SIGN_BIT); - } - else { - FL_UNSET_RAW(b, BIGNUM_SIGN_BIT); - } -} - -static inline void -BIGNUM_NEGATE(VALUE b) -{ - FL_REVERSE_RAW(b, BIGNUM_SIGN_BIT); -} - -static inline size_t -BIGNUM_LEN(VALUE b) -{ - if (! BIGNUM_EMBED_P(b)) { - return RBIGNUM(b)->as.heap.len; - } - else { - size_t ret = RBASIC(b)->flags; - ret &= BIGNUM_EMBED_LEN_MASK; - ret >>= BIGNUM_EMBED_LEN_SHIFT; - return ret; - } -} - -static inline int -BIGNUM_LENINT(VALUE b) -{ - return rb_long2int(BIGNUM_LEN(b)); -} - -/* LSB:BIGNUM_DIGITS(b)[0], MSB:BIGNUM_DIGITS(b)[BIGNUM_LEN(b)-1] */ -static inline BDIGIT * -BIGNUM_DIGITS(VALUE b) -{ - if (BIGNUM_EMBED_P(b)) { - return RBIGNUM(b)->as.ary; - } - else { - return RBIGNUM(b)->as.heap.digits; - } -} - -static inline bool -BIGNUM_EMBED_P(VALUE b) -{ - return FL_TEST_RAW(b, BIGNUM_EMBED_FLAG); -} - -#endif /* INTERNAL_BIGNUM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h deleted file mode 100644 index 1fe98fa..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h +++ /dev/null @@ -1,568 +0,0 @@ -#ifndef INTERNAL_BITS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BITS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for bitwise integer algorithms. - * @see Henry S. Warren Jr., "Hacker's Delight" (2nd ed.), 2013. - * @see SEI CERT C Coding Standard INT32-C. "Ensure that operations on - * signed integers do not result in overflow" - * @see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateleft - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateright - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/byteswap-uint64-byteswap-ulong-byteswap-ushort - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/rotl-rotl64-rotr-rotr64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/lzcnt16-lzcnt-lzcnt64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_tzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotl64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotr64 - * @see https://stackoverflow.com/a/776523 - */ -#include "ruby/internal/config.h" -#include /* for CHAR_BITS */ -#include /* for uintptr_t */ -#include "internal/compilers.h" /* for MSC_VERSION_SINCE */ - -#if MSC_VERSION_SINCE(1310) -# include /* for _byteswap_uint64 */ -#endif - -#if defined(HAVE_X86INTRIN_H) -# include /* for _lzcnt_u64 */ -#elif MSC_VERSION_SINCE(1310) -# include /* for the following intrinsics */ -#endif - -#if defined(_MSC_VER) && defined(__AVX__) -# pragma intrinsic(__popcnt) -# pragma intrinsic(__popcnt64) -#endif - -#if defined(_MSC_VER) && defined(__AVX2__) -# pragma intrinsic(__lzcnt) -# pragma intrinsic(__lzcnt64) -#endif - -#if MSC_VERSION_SINCE(1310) -# pragma intrinsic(_rotl) -# pragma intrinsic(_rotr) -# ifdef _WIN64 -# pragma intrinsic(_rotl64) -# pragma intrinsic(_rotr64) -# endif -#endif - -#if MSC_VERSION_SINCE(1400) -# pragma intrinsic(_BitScanForward) -# pragma intrinsic(_BitScanReverse) -# ifdef _WIN64 -# pragma intrinsic(_BitScanForward64) -# pragma intrinsic(_BitScanReverse64) -# endif -#endif - -#include "ruby/ruby.h" /* for VALUE */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ - -/* The most significant bit of the lower part of half-long integer. - * If sizeof(long) == 4, this is 0x8000. - * If sizeof(long) == 8, this is 0x80000000. - */ -#define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2)) - -#define SIGNED_INTEGER_TYPE_P(T) (0 > ((T)0)-1) - -#define SIGNED_INTEGER_MIN(T) \ - ((sizeof(T) == sizeof(int8_t)) ? ((T)INT8_MIN) : \ - ((sizeof(T) == sizeof(int16_t)) ? ((T)INT16_MIN) : \ - ((sizeof(T) == sizeof(int32_t)) ? ((T)INT32_MIN) : \ - ((sizeof(T) == sizeof(int64_t)) ? ((T)INT64_MIN) : \ - 0)))) - -#define SIGNED_INTEGER_MAX(T) ((T)(SIGNED_INTEGER_MIN(T) ^ ((T)~(T)0))) - -#define UNSIGNED_INTEGER_MAX(T) ((T)~(T)0) - -#if __has_builtin(__builtin_mul_overflow_p) -# define MUL_OVERFLOW_P(a, b) \ - __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0) -#elif __has_builtin(__builtin_mul_overflow) -# define MUL_OVERFLOW_P(a, b) \ - __extension__ ({ __typeof__(a) c; __builtin_mul_overflow((a), (b), &c); }) -#endif - -#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \ - (a) == 0 ? 0 : \ - (a) == -1 ? (b) < -(max) : \ - (a) > 0 ? \ - ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \ - ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b))) - -#if __has_builtin(__builtin_mul_overflow_p) -/* __builtin_mul_overflow_p can take bitfield */ -/* and GCC permits bitfields for integers other than int */ -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - __extension__ ({ \ - struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \ - __builtin_mul_overflow_p((a), (b), c.fixnum); \ - }) -#else -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX) -#endif - -#if defined(MUL_OVERFLOW_P) && defined(USE___BUILTIN_MUL_OVERFLOW_LONG_LONG) -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -#else -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) -#endif - -#ifdef MUL_OVERFLOW_P -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b) -#else -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX) -#endif - -#ifdef HAVE_UINT128_T -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - sizeof(x) <= sizeof(int64_t) ? 64 - nlz_int64((uint64_t)(x)) : \ - 128 - nlz_int128((uint128_t)(x))) -#else -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - 64 - nlz_int64((uint64_t)(x))) -#endif - -#ifndef swap16 -# define swap16 ruby_swap16 -#endif - -#ifndef swap32 -# define swap32 ruby_swap32 -#endif - -#ifndef swap64 -# define swap64 ruby_swap64 -#endif - -static inline uint16_t ruby_swap16(uint16_t); -static inline uint32_t ruby_swap32(uint32_t); -static inline uint64_t ruby_swap64(uint64_t); -static inline unsigned nlz_int(unsigned x); -static inline unsigned nlz_long(unsigned long x); -static inline unsigned nlz_long_long(unsigned long long x); -static inline unsigned nlz_intptr(uintptr_t x); -static inline unsigned nlz_int32(uint32_t x); -static inline unsigned nlz_int64(uint64_t x); -#ifdef HAVE_UINT128_T -static inline unsigned nlz_int128(uint128_t x); -#endif -static inline unsigned rb_popcount32(uint32_t x); -static inline unsigned rb_popcount64(uint64_t x); -static inline unsigned rb_popcount_intptr(uintptr_t x); -static inline int ntz_int32(uint32_t x); -static inline int ntz_int64(uint64_t x); -static inline int ntz_intptr(uintptr_t x); -static inline VALUE RUBY_BIT_ROTL(VALUE, int); -static inline VALUE RUBY_BIT_ROTR(VALUE, int); - -static inline uint16_t -ruby_swap16(uint16_t x) -{ -#if __has_builtin(__builtin_bswap16) - return __builtin_bswap16(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ushort(x); - -#else - return (x << 8) | (x >> 8); - -#endif -} - -static inline uint32_t -ruby_swap32(uint32_t x) -{ -#if __has_builtin(__builtin_bswap32) - return __builtin_bswap32(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ulong(x); - -#else - x = ((x & 0x0000FFFF) << 16) | ((x & 0xFFFF0000) >> 16); - x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >> 8); - return x; - -#endif -} - -static inline uint64_t -ruby_swap64(uint64_t x) -{ -#if __has_builtin(__builtin_bswap64) - return __builtin_bswap64(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_uint64(x); - -#else - x = ((x & 0x00000000FFFFFFFFULL) << 32) | ((x & 0xFFFFFFFF00000000ULL) >> 32); - x = ((x & 0x0000FFFF0000FFFFULL) << 16) | ((x & 0xFFFF0000FFFF0000ULL) >> 16); - x = ((x & 0x00FF00FF00FF00FFULL) << 8) | ((x & 0xFF00FF00FF00FF00ULL) >> 8); - return x; - -#endif -} - -static inline unsigned int -nlz_int32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - /* Note: It seems there is no such thing like __LZCNT__ predefined in MSVC. - * AMD CPUs have had this instruction for decades (since K10) but for - * Intel, Haswell is the oldest one. We need to use __AVX2__ for maximum - * safety. */ - return (unsigned int)__lzcnt(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse(&r, x) ? (31 - (int)r) : 32; - -#elif __has_builtin(__builtin_clz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned int)__builtin_clz(x) : 32; - -#else - uint32_t y; - unsigned n = 32; - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); -#endif -} - -static inline unsigned int -nlz_int64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - return (unsigned int)__lzcnt64(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64; - -#elif __has_builtin(__builtin_clzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - uint64_t y; - unsigned int n = 64; - y = x >> 32; if (y) {n -= 32; x = y;} - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); - -#endif -} - -#ifdef HAVE_UINT128_T -static inline unsigned int -nlz_int128(uint128_t x) -{ - uint64_t y = (uint64_t)(x >> 64); - - if (x == 0) { - return 128; - } - else if (y == 0) { - return (unsigned int)nlz_int64(x) + 64; - } - else { - return (unsigned int)nlz_int64(y); - } -} -#endif - -static inline unsigned int -nlz_int(unsigned int x) -{ - if (sizeof(unsigned int) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned int) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long(unsigned long x) -{ - if (sizeof(unsigned long) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long_long(unsigned long long x) -{ - if (sizeof(unsigned long long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } -#ifdef HAVE_UINT128_T - else if (sizeof(unsigned long long) * CHAR_BIT == 128) { - return nlz_int128((uint128_t)x); - } -#endif - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) == sizeof(unsigned int)) { - return nlz_int((unsigned int)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long)) { - return nlz_long((unsigned long)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long long)) { - return nlz_long_long((unsigned long long)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -rb_popcount32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - /* Note: CPUs since Nehalem and Barcelona have had this instruction so SSE - * 4.2 should suffice, but it seems there is no such thing like __SSE_4_2__ - * predefined macro in MSVC. They do have __AVX__ so use it instead. */ - return (unsigned int)__popcnt(x); - -#elif __has_builtin(__builtin_popcount) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT >= 32); - return (unsigned int)__builtin_popcount(x); - -#else - x = (x & 0x55555555) + (x >> 1 & 0x55555555); - x = (x & 0x33333333) + (x >> 2 & 0x33333333); - x = (x & 0x07070707) + (x >> 4 & 0x07070707); - x = (x & 0x000f000f) + (x >> 8 & 0x000f000f); - x = (x & 0x0000001f) + (x >>16 & 0x0000001f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - return (unsigned int)__popcnt64(x); - -#elif __has_builtin(__builtin_popcount) - if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555); - x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333); - x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707); - x = (x & 0x000f000f000f000f) + (x >> 8 & 0x000f000f000f000f); - x = (x & 0x0000001f0000001f) + (x >>16 & 0x0000001f0000001f); - x = (x & 0x000000000000003f) + (x >>32 & 0x000000000000003f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return rb_popcount64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return rb_popcount32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline int -ntz_int32(uint32_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) - /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using - * assembly? Because issuing LZCNT seems possible (see nlz.h). */ - unsigned long r; - return _BitScanForward(&r, x) ? (int)r : 32; - -#elif __has_builtin(__builtin_ctz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned)__builtin_ctz(x) : 32; - -#else - return rb_popcount32((~x) & (x-1)); - -#endif -} - -static inline int -ntz_int64(uint64_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) - unsigned long r; - return _BitScanForward64(&r, x) ? (int)r : 64; - -#elif __has_builtin(__builtin_ctzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - return rb_popcount64((~x) & (x-1)); - -#endif -} - -static inline int -ntz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return ntz_int64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return ntz_int32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline VALUE -RUBY_BIT_ROTL(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateleft32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateleft32(v, n); - -#elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateleft64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotl(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotl64(v, n); - -#elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotl(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (n & m)) | (v >> (-n & m)); -#endif -} - -static inline VALUE -RUBY_BIT_ROTR(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateright32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateright32(v, n); - -#elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateright64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotr(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotr64(v, n); - -#elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotr(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (-n & m)) | (v >> (n & m)); -#endif -} - -#endif /* INTERNAL_BITS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/class.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/class.h deleted file mode 100644 index f94434b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/class.h +++ /dev/null @@ -1,283 +0,0 @@ -#ifndef INTERNAL_CLASS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_CLASS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Class. - */ -#include "id.h" -#include "id_table.h" /* for struct rb_id_table */ -#include "internal/serial.h" /* for rb_serial_t */ -#include "internal/static_assert.h" -#include "internal/variable.h" /* for rb_class_ivar_set */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/intern.h" /* for rb_alloc_func_t */ -#include "ruby/ruby.h" /* for struct RBasic */ -#include "shape.h" -#include "ruby_assert.h" -#include "vm_core.h" -#include "vm_sync.h" -#include "method.h" /* for rb_cref_t */ - -#ifdef RCLASS_SUPER -# undef RCLASS_SUPER -#endif - -struct rb_subclass_entry { - VALUE klass; - struct rb_subclass_entry *next; - struct rb_subclass_entry *prev; -}; -typedef struct rb_subclass_entry rb_subclass_entry_t; - -struct rb_cvar_class_tbl_entry { - uint32_t index; - rb_serial_t global_cvar_state; - const rb_cref_t * cref; - VALUE class_value; -}; - -struct rb_classext_struct { - VALUE *iv_ptr; - struct rb_id_table *const_tbl; - struct rb_id_table *callable_m_tbl; - struct rb_id_table *cc_tbl; /* ID -> [[ci1, cc1], [ci2, cc2] ...] */ - struct rb_id_table *cvc_tbl; - size_t superclass_depth; - VALUE *superclasses; - struct rb_subclass_entry *subclasses; - struct rb_subclass_entry *subclass_entry; - /** - * In the case that this is an `ICLASS`, `module_subclasses` points to the link - * in the module's `subclasses` list that indicates that the klass has been - * included. Hopefully that makes sense. - */ - struct rb_subclass_entry *module_subclass_entry; - const VALUE origin_; - const VALUE refined_class; - union { - struct { - rb_alloc_func_t allocator; - } class; - struct { - VALUE attached_object; - } singleton_class; - } as; - const VALUE includer; - attr_index_t max_iv_count; - unsigned char variation_count; - bool permanent_classpath : 1; - bool cloned : 1; - VALUE classpath; -}; -typedef struct rb_classext_struct rb_classext_t; - -STATIC_ASSERT(shape_max_variations, SHAPE_MAX_VARIATIONS < (1 << (sizeof(((rb_classext_t *)0)->variation_count) * CHAR_BIT))); - -struct RClass { - struct RBasic basic; - VALUE super; - struct rb_id_table *m_tbl; -}; - -// Assert that classes can be embedded in heaps[2] (which has 160B slot size) -STATIC_ASSERT(sizeof_rb_classext_t, sizeof(struct RClass) + sizeof(rb_classext_t) <= 4 * RVALUE_SIZE); - -struct RClass_and_rb_classext_t { - struct RClass rclass; - rb_classext_t classext; -}; - -#define RCLASS_EXT(c) (&((struct RClass_and_rb_classext_t*)(c))->classext) -#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl) -#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl) -#define RCLASS_IVPTR(c) (RCLASS_EXT(c)->iv_ptr) -#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl) -#define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl) -#define RCLASS_CVC_TBL(c) (RCLASS_EXT(c)->cvc_tbl) -#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_) -#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class) -#define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer) -#define RCLASS_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->subclass_entry) -#define RCLASS_MODULE_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->module_subclass_entry) -#define RCLASS_SUBCLASSES(c) (RCLASS_EXT(c)->subclasses) -#define RCLASS_SUPERCLASS_DEPTH(c) (RCLASS_EXT(c)->superclass_depth) -#define RCLASS_SUPERCLASSES(c) (RCLASS_EXT(c)->superclasses) -#define RCLASS_ATTACHED_OBJECT(c) (RCLASS_EXT(c)->as.singleton_class.attached_object) - -#define RCLASS_IS_ROOT FL_USER0 -#define RICLASS_IS_ORIGIN FL_USER0 -#define RCLASS_SUPERCLASSES_INCLUDE_SELF FL_USER2 -#define RICLASS_ORIGIN_SHARED_MTBL FL_USER3 - -static inline st_table * -RCLASS_IV_HASH(VALUE obj) -{ - RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE)); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - return (st_table *)RCLASS_IVPTR(obj); -} - -static inline void -RCLASS_SET_IV_HASH(VALUE obj, const st_table *tbl) -{ - RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE)); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - RCLASS_IVPTR(obj) = (VALUE *)tbl; -} - -static inline uint32_t -RCLASS_IV_COUNT(VALUE obj) -{ - RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE)); - if (rb_shape_obj_too_complex(obj)) { - uint32_t count; - - // "Too complex" classes could have their IV hash mutated in - // parallel, so lets lock around getting the hash size. - RB_VM_LOCK_ENTER(); - { - count = (uint32_t)rb_st_table_size(RCLASS_IV_HASH(obj)); - } - RB_VM_LOCK_LEAVE(); - - return count; - } - else { - return rb_shape_get_shape_by_id(RCLASS_SHAPE_ID(obj))->next_iv_index; - } -} - -static inline void -RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table) -{ - RUBY_ASSERT(!RB_OBJ_PROMOTED(klass)); - RCLASS_M_TBL(klass) = table; -} - -/* class.c */ -void rb_class_subclass_add(VALUE super, VALUE klass); -void rb_class_remove_from_super_subclasses(VALUE); -void rb_class_update_superclasses(VALUE); -size_t rb_class_superclasses_memsize(VALUE); -void rb_class_remove_subclass_head(VALUE); -int rb_singleton_class_internal_p(VALUE sklass); -VALUE rb_class_boot(VALUE); -VALUE rb_class_s_alloc(VALUE klass); -VALUE rb_module_s_alloc(VALUE klass); -void rb_module_set_initialized(VALUE module); -void rb_module_check_initializable(VALUE module); -VALUE rb_make_metaclass(VALUE, VALUE); -VALUE rb_include_class_new(VALUE, VALUE); -void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE); -void rb_class_detach_subclasses(VALUE); -void rb_class_detach_module_subclasses(VALUE); -void rb_class_remove_from_module_subclasses(VALUE); -VALUE rb_define_class_id_under_no_pin(VALUE outer, ID id, VALUE super); -VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj); -VALUE rb_class_undefined_instance_methods(VALUE mod); -VALUE rb_special_singleton_class(VALUE); -VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach); -VALUE rb_singleton_class_get(VALUE obj); -void rb_undef_methods_from(VALUE klass, VALUE super); - -static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin); -static inline void RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass); -static inline VALUE RCLASS_SUPER(VALUE klass); -static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super); -static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass); - -VALUE rb_class_inherited(VALUE, VALUE); -VALUE rb_keyword_error_new(const char *, VALUE); - -static inline bool -RCLASS_SINGLETON_P(VALUE klass) -{ - return RB_TYPE_P(klass, T_CLASS) && FL_TEST_RAW(klass, FL_SINGLETON); -} - -static inline rb_alloc_func_t -RCLASS_ALLOCATOR(VALUE klass) -{ - if (RCLASS_SINGLETON_P(klass)) { - return 0; - } - return RCLASS_EXT(klass)->as.class.allocator; -} - -static inline void -RCLASS_SET_ALLOCATOR(VALUE klass, rb_alloc_func_t allocator) -{ - assert(!RCLASS_SINGLETON_P(klass)); - RCLASS_EXT(klass)->as.class.allocator = allocator; -} - -static inline void -RCLASS_SET_ORIGIN(VALUE klass, VALUE origin) -{ - RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin); - if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN); -} - -static inline void -RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass) -{ - FL_SET(iclass, RICLASS_ORIGIN_SHARED_MTBL); -} - -static inline bool -RICLASS_OWNS_M_TBL_P(VALUE iclass) -{ - return FL_TEST_RAW(iclass, RICLASS_IS_ORIGIN | RICLASS_ORIGIN_SHARED_MTBL) == RICLASS_IS_ORIGIN; -} - -static inline void -RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass) -{ - RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass); -} - -static inline VALUE -RCLASS_SUPER(VALUE klass) -{ - return RCLASS(klass)->super; -} - -static inline VALUE -RCLASS_SET_SUPER(VALUE klass, VALUE super) -{ - if (super) { - rb_class_remove_from_super_subclasses(klass); - rb_class_subclass_add(super, klass); - } - RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super); - rb_class_update_superclasses(klass); - return super; -} - -static inline void -RCLASS_SET_CLASSPATH(VALUE klass, VALUE classpath, bool permanent) -{ - assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE); - assert(classpath == 0 || BUILTIN_TYPE(classpath) == T_STRING); - - RB_OBJ_WRITE(klass, &(RCLASS_EXT(klass)->classpath), classpath); - RCLASS_EXT(klass)->permanent_classpath = permanent; -} - -static inline VALUE -RCLASS_SET_ATTACHED_OBJECT(VALUE klass, VALUE attached_object) -{ - assert(RCLASS_SINGLETON_P(klass)); - - RB_OBJ_WRITE(klass, &RCLASS_EXT(klass)->as.singleton_class.attached_object, attached_object); - return attached_object; -} - -#endif /* INTERNAL_CLASS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h deleted file mode 100644 index e79b993..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_CMDLINEOPT_H - -#include "rjit.h" -#include "yjit.h" - -typedef struct { - unsigned int mask; - unsigned int set; -} ruby_features_t; - -typedef struct ruby_cmdline_options { - const char *script; - VALUE script_name; - VALUE e_script; - struct { - struct { - VALUE name; - int index; - } enc; - } src, ext, intern; - VALUE req_list; - ruby_features_t features; - ruby_features_t warn; - unsigned int dump; - long backtrace_length_limit; -#if USE_RJIT - struct rb_rjit_options rjit; -#endif - - const char *crash_report; - - signed int sflag: 2; - unsigned int xflag: 1; - unsigned int warning: 1; - unsigned int verbose: 1; - unsigned int do_loop: 1; - unsigned int do_print: 1; - unsigned int do_line: 1; - unsigned int do_split: 1; - unsigned int do_search: 1; - unsigned int setids: 2; -#if USE_YJIT - unsigned int yjit: 1; -#endif -} ruby_cmdline_options_t; - -struct ruby_opt_message { - const char *str; - unsigned short namelen, secondlen; -}; - -#define RUBY_OPT_MESSAGE(shortopt, longopt, desc) { \ - shortopt " " longopt " " desc, \ - (unsigned short)sizeof(shortopt), \ - (unsigned short)sizeof(longopt), \ -} - -#define opt_match(s, l, name) \ - ((((l) > rb_strlen_lit(name)) ? (s)[rb_strlen_lit(name)] == '=' : \ - (l) == rb_strlen_lit(name)) && \ - memcmp((s), name, rb_strlen_lit(name)) == 0 && \ - (((s) += rb_strlen_lit(name)), 1)) - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h deleted file mode 100644 index 9115e4b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef INTERNAL_COMPAR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPAR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Comparable. - */ -#include "internal/basic_operators.h" - -#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString) - -#define CMP_OPTIMIZABLE(type) BASIC_OP_UNREDEFINED_P(BOP_CMP, type##_REDEFINED_OP_FLAG) - -#define OPTIMIZED_CMP(a, b) \ - ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(INTEGER)) ? \ - (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \ - (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(STRING)) ? \ - rb_str_cmp(a, b) : \ - (RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(FLOAT)) ? \ - rb_float_cmp(a, b) : \ - rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b)) - -/* compar.c */ -VALUE rb_invcmp(VALUE, VALUE); - -#endif /* INTERNAL_COMPAR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h deleted file mode 100644 index 2ece539..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef INTERNAL_COMPILE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPILE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the compiler. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/ruby.h" /* for rb_event_flag_t */ - -struct rb_iseq_struct; /* in vm_core.h */ - -/* compile.c */ -int rb_dvar_defined(ID, const struct rb_iseq_struct *); -int rb_local_defined(ID, const struct rb_iseq_struct *); -int rb_insn_len(VALUE insn); -const char *rb_insns_name(int i); -VALUE rb_insns_name_array(void); -int rb_iseq_cdhash_cmp(VALUE val, VALUE lit); -st_index_t rb_iseq_cdhash_hash(VALUE a); - -/* iseq.c */ -int rb_vm_insn_addr2insn(const void *); -int rb_vm_insn_decode(const VALUE encoded); -extern bool ruby_vm_keep_script_lines; - -/* iseq.c (export) */ -rb_event_flag_t rb_iseq_event_flags(const struct rb_iseq_struct *iseq, size_t pos); - -#endif /* INTERNAL_COMPILE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h deleted file mode 100644 index 26c2f05..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef INTERNAL_COMPILERS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPILERS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header absorbing C compiler differences. - */ -#include "ruby/internal/compiler_since.h" -#include "ruby/internal/has/attribute.h" -#include "ruby/internal/has/builtin.h" -#include "ruby/internal/has/c_attribute.h" -#include "ruby/internal/has/declspec_attribute.h" -#include "ruby/internal/has/extension.h" -#include "ruby/internal/has/feature.h" -#include "ruby/internal/has/warning.h" -#include "ruby/backward/2/gcc_version_since.h" - -#define MSC_VERSION_SINCE(_) RBIMPL_COMPILER_SINCE(MSVC, (_) / 100, (_) % 100, 0) -#define MSC_VERSION_BEFORE(_) RBIMPL_COMPILER_BEFORE(MSVC, (_) / 100, (_) % 100, 0) - -#ifndef __has_attribute -# define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__) -#endif - -#ifndef __has_c_attribute -# /* As of writing everything that lacks __has_c_attribute also completely -# * lacks C2x attributes as well. Might change in future? */ -# define __has_c_attribute(...) 0 -#endif - -#ifndef __has_declspec_attribute -# define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__) -#endif - -#ifndef __has_builtin -# define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__) -#endif - -#ifndef __has_feature -# define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__) -#endif - -#ifndef __has_extension -# define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__) -#endif - -#ifndef __has_warning -# define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__) -#endif - -#ifndef __GNUC__ -# define __extension__ /* void */ -#endif - -#ifndef MAYBE_UNUSED -# define MAYBE_UNUSED(x) x -#endif - -#ifndef WARN_UNUSED_RESULT -# define WARN_UNUSED_RESULT(x) x -#endif - -#define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj) -#define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj) -#ifdef __GNUC__ -#define rb_obj_builtin_type(obj) \ -__extension__({ \ - VALUE arg_obj = (obj); \ - RB_SPECIAL_CONST_P(arg_obj) ? -1 : \ - (int)RB_BUILTIN_TYPE(arg_obj); \ - }) -#else -# include "ruby/ruby.h" -static inline int -rb_obj_builtin_type(VALUE obj) -{ - return RB_SPECIAL_CONST_P(obj) ? -1 : - (int)RB_BUILTIN_TYPE(obj); -} -#endif - -/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define FLEX_ARY_LEN /* VALUE ary[]; */ -#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) -# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */ -#else -# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */ -#endif - -/* - * For declaring bitfields out of non-unsigned int types: - * struct date { - * BITFIELD(enum months, month, 4); - * ... - * }; - */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define BITFIELD(type, name, size) type name : size -#else -# define BITFIELD(type, name, size) unsigned int name : size -#endif - -#endif /* INTERNAL_COMPILERS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h deleted file mode 100644 index 4215165..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_COMPLEX_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Complex. - */ -#include "ruby/internal/value.h" /* for struct RBasic */ - -struct RComplex { - struct RBasic basic; - VALUE real; - VALUE imag; -}; - -#define RCOMPLEX(obj) ((struct RComplex *)(obj)) - -/* shortcut macro for internal only */ -#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r)) -#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i)) - -/* complex.c */ -VALUE rb_dbl_complex_new_polar_pi(double abs, double ang); -st_index_t rb_complex_hash(VALUE comp); - -#endif /* INTERNAL_COMPLEX_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h deleted file mode 100644 index 3c2528a..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef INTERNAL_CONT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_CONT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Fiber. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "iseq.h" - -struct rb_thread_struct; /* in vm_core.h */ -struct rb_fiber_struct; /* in cont.c */ -struct rb_execution_context_struct; /* in vm_core.c */ - -/* cont.c */ -void rb_fiber_reset_root_local_storage(struct rb_thread_struct *); -void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE)); -void rb_jit_cont_init(void); -void rb_jit_cont_each_iseq(rb_iseq_callback callback, void *data); -void rb_jit_cont_finish(void); - -/* vm.c */ -void rb_free_shared_fiber_pool(void); - -// Copy locals from the current execution to the specified fiber. -VALUE rb_fiber_inherit_storage(struct rb_execution_context_struct *ec, struct rb_fiber_struct *fiber); - -VALUE rb_fiberptr_self(struct rb_fiber_struct *fiber); -unsigned int rb_fiberptr_blocking(struct rb_fiber_struct *fiber); -struct rb_execution_context_struct * rb_fiberptr_get_ec(struct rb_fiber_struct *fiber); - -#endif /* INTERNAL_CONT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h deleted file mode 100644 index 0a4dc90..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_DIR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_DIR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Dir. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* dir.c */ -VALUE rb_dir_getwd_ospath(void); - -#endif /* INTERNAL_DIR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h deleted file mode 100644 index a005dc8..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef INTERNAL_ENC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Encoding. - */ -#include "ruby/encoding.h" /* for rb_encoding */ - -/* us_ascii.c */ -extern rb_encoding OnigEncodingUS_ASCII; - -/* utf_8.c */ -extern rb_encoding OnigEncodingUTF_8; - -#endif /* INTERNAL_ENC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h deleted file mode 100644 index fe9ea10..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef INTERNAL_ENCODING_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENCODING_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Encoding. - */ -#include "ruby/ruby.h" /* for ID */ -#include "ruby/encoding.h" /* for rb_encoding */ - -#define rb_enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc)) -#define rb_is_usascii_enc(enc) ((enc) == rb_usascii_encoding()) -#define rb_is_ascii8bit_enc(enc) ((enc) == rb_ascii8bit_encoding()) -#define rb_is_locale_enc(enc) ((enc) == rb_locale_encoding()) - -/* encoding.c */ -ID rb_id_encoding(void); -const char * rb_enc_inspect_name(rb_encoding *enc); -rb_encoding *rb_enc_get_from_index(int index); -rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2); -int rb_encdb_replicate(const char *alias, const char *orig); -int rb_encdb_alias(const char *alias, const char *orig); -int rb_enc_autoload(rb_encoding *enc); -int rb_encdb_dummy(const char *name); -void rb_encdb_declare(const char *name); -void rb_enc_set_base(const char *name, const char *orig); -int rb_enc_set_dummy(int index); -PUREFUNC(int rb_data_is_encoding(VALUE obj)); - -/* vm.c */ -void rb_free_global_enc_table(void); - -#endif /* INTERNAL_ENCODING_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h deleted file mode 100644 index 2824644..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef INTERNAL_ENUM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENUM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Enumerable. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* enum.c */ -extern VALUE rb_cArithSeq; -VALUE rb_f_send(int argc, VALUE *argv, VALUE recv); -VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary); - -#endif /* INTERNAL_ENUM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h deleted file mode 100644 index e11a684..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef INTERNAL_ENUMERATOR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ENUMERATOR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Enumerator. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/intern.h" /* for rb_enumerator_size_func */ - -RUBY_SYMBOL_EXPORT_BEGIN -/* enumerator.c (export) */ -VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv, - rb_enumerator_size_func *size_fn, - VALUE beg, VALUE end, VALUE step, int excl); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_ENUMERATOR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/error.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/error.h deleted file mode 100644 index 7a4daca..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/error.h +++ /dev/null @@ -1,218 +0,0 @@ -#ifndef INTERNAL_ERROR_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_ERROR_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Exception. - */ -#include "ruby/internal/config.h" -#include /* for va_list */ -#include "internal/string.h" /* for rb_fstring_cstr */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/encoding.h" /* for rb_encoding */ -#include "ruby/intern.h" /* for rb_exc_raise */ -#include "ruby/ruby.h" /* for enum ruby_value_type */ - -#ifdef Check_Type -# undef Check_Type /* in ruby/ruby.h */ -#endif - -#ifdef rb_raise_static -# undef rb_raise_static -# undef rb_sys_fail_path -# undef rb_syserr_fail_path -#endif - -#define rb_raise_static(e, m) \ - rb_raise_cstr_i((e), rb_str_new_static((m), rb_strlen_lit(m))) -#ifdef RUBY_FUNCTION_NAME_STRING -# define rb_syserr_fail_path(err, path) rb_syserr_fail_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path)) -# define rb_syserr_new_path(err, path) rb_syserr_new_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path)) -#else -# define rb_syserr_fail_path(err, path) rb_syserr_fail_str((err), (path)) -# define rb_syserr_new_path(err, path) rb_syserr_new_str((err), (path)) -#endif - -#define rb_sys_fail(mesg) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail(errno_to_fail, (mesg)); \ -} while (0) - -#define rb_sys_fail_str(mesg) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail_str(errno_to_fail, (mesg)); \ -} while (0) - -#define rb_sys_fail_path(path) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail_path(errno_to_fail, (path)); \ -} while (0) - -#define rb_sys_fail_sprintf(...) \ -do { \ - int errno_to_fail = errno; \ - rb_syserr_fail_str(errno_to_fail, rb_sprintf("" __VA_ARGS__)); \ -} while (0) - -/* error.c */ -extern long rb_backtrace_length_limit; -extern VALUE rb_eEAGAIN; -extern VALUE rb_eEWOULDBLOCK; -extern VALUE rb_eEINPROGRESS; -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 0) -void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args); -NORETURN(void rb_async_bug_errno(const char *,int)); -const char *rb_builtin_type_name(int t); -const char *rb_builtin_class_name(VALUE x); -PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3); -PRINTF_ARGS(void rb_warn_deprecated_to_remove(const char *removal, const char *fmt, const char *suggest, ...), 2, 4); -#if RUBY_DEBUG -# include "ruby/version.h" -# define RUBY_VERSION_SINCE(major, minor) (RUBY_API_VERSION_CODE >= (major * 10000) + (minor) * 100) -# define RUBY_VERSION_BEFORE(major, minor) (RUBY_API_VERSION_CODE < (major * 10000) + (minor) * 100) -# if defined(RBIMPL_WARNING_PRAGMA0) -# define RBIMPL_TODO0(x) RBIMPL_WARNING_PRAGMA0(message(x)) -# elif RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0) -# define RBIMPL_TODO0(x) __pragma(message(x)) -# endif - -# if RBIMPL_HAS_ATTRIBUTE(diagnose_if) || defined(__OPTIMIZE__) - -#define RUBY_VERSION_isdigit(c) ('0'<=(c)&&(c)<='9') -// upto 99 -#define RUBY_VERSION__number_len(v, ofs) \ - (!RUBY_VERSION_isdigit((v)[ofs]) ? \ - 0 : !RUBY_VERSION_isdigit((v)[(ofs) + 1]) ? 1 : 2) -#define RUBY_VERSION__to_number(v, ofs) \ - (!RUBY_VERSION_isdigit((v)[ofs]) ? \ - 0 : !RUBY_VERSION_isdigit((v)[(ofs) + 1]) ? \ - ((v)[ofs]-'0') : \ - (((v)[ofs]-'0')*10+(v)[(ofs)+1]-'0')) - -#define RUBY_VERSION_CODE_FROM_MAJOR_MINOR_STRING(v) \ - (RUBY_VERSION__to_number(v, 0) * 10000 + \ - ((v)[RUBY_VERSION__number_len(v, 0)] == '.' ? \ - RUBY_VERSION__to_number(v, RUBY_VERSION__number_len(v, 0)+1) * 100 : 0)) -#define RUBY_VERSION_STRING_SINCE(v) (RUBY_API_VERSION_CODE >= RUBY_VERSION_CODE_FROM_MAJOR_MINOR_STRING(v)) -#define RUBY_VERSION_STRING_BEFORE(v) (RUBY_API_VERSION_CODE < RUBY_VERSION_CODE_FROM_MAJOR_MINOR_STRING(v)) - -# if RBIMPL_HAS_ATTRIBUTE(diagnose_if) -RBIMPL_ATTR_FORCEINLINE() -static void -rb_deprecated_method_to_be_removed(const char *removal) - RBIMPL_ATTR_DIAGNOSE_IF(!RUBY_VERSION_isdigit(removal[0]), "malformed version number", "error") - RBIMPL_ATTR_DIAGNOSE_IF(RUBY_VERSION_STRING_SINCE(removal), "deprecated method to be removed", "error") -{ -} -# else -RBIMPL_ATTR_ERROR(("deprecated")) -void rb_deprecated_method_to_be_removed(const char *); -# define rb_deprecated_method_to_be_removed(removal) \ - (sizeof(char[1-2*(!RUBY_VERSION_isdigit(removal[0]) || RUBY_VERSION_STRING_SINCE(removal))])!=1 ? \ - rb_deprecated_method_to_be_removed(removal) : \ - RBIMPL_ASSERT_NOTHING) -# endif -# define rb_warn_deprecated_to_remove_at(removal, ...) \ - (rb_deprecated_method_to_be_removed(#removal), \ - rb_warn_deprecated_to_remove(#removal, __VA_ARGS__)) -# endif -#endif -#ifndef rb_warn_deprecated_to_remove_at -# define rb_warn_deprecated_to_remove_at(removal, ...) \ - rb_warn_deprecated_to_remove(#removal, __VA_ARGS__) -#endif -#ifndef RUBY_VERSION_SINCE -# define RUBY_VERSION_SINCE(major, minor) 0 -#endif -#ifndef RUBY_VERSION_BEFORE -# define RUBY_VERSION_BEFORE(major, minor) 0 -#endif -#ifndef RBIMPL_TODO0 -# define RBIMPL_TODO0(x) -#endif -#define RBIMPL_TODO(message) RBIMPL_TODO0("TODO: " message) -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 6, 0) -VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list); -PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3); -PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3); -PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4); -PRINTF_ARGS(void rb_enc_compile_warning(rb_encoding *enc, const char *file, int line, const char *fmt, ...), 4, 5); -PRINTF_ARGS(void rb_enc_compile_warn(rb_encoding *enc, const char *file, int line, const char *fmt, ...), 4, 5); -rb_warning_category_t rb_warning_category_from_name(VALUE category); -bool rb_warning_category_enabled_p(rb_warning_category_t category); -VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method); -VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv); -VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name); -PRINTF_ARGS(VALUE rb_warning_string(const char *fmt, ...), 1, 2); -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 2, 0) -NORETURN(void rb_vraise(VALUE, const char *, va_list)); -NORETURN(static inline void rb_raise_cstr(VALUE etype, const char *mesg)); -NORETURN(static inline void rb_raise_cstr_i(VALUE etype, VALUE mesg)); -NORETURN(static inline void rb_name_err_raise_str(VALUE mesg, VALUE recv, VALUE name)); -NORETURN(static inline void rb_name_err_raise(const char *mesg, VALUE recv, VALUE name)); -NORETURN(static inline void rb_key_err_raise(VALUE mesg, VALUE recv, VALUE name)); -static inline void Check_Type(VALUE v, enum ruby_value_type t); -static inline bool rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type); -#define rb_typeddata_is_instance_of rb_typeddata_is_instance_of_inline - -RUBY_SYMBOL_EXPORT_BEGIN -/* error.c (export) */ -int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data); -#ifdef RUBY_FUNCTION_NAME_STRING -NORETURN(void rb_sys_fail_path_in(const char *func_name, VALUE path)); -NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path)); -VALUE rb_syserr_new_path_in(const char *func_name, int n, VALUE path); -#endif -RUBY_SYMBOL_EXPORT_END - -/* vm.c */ -void rb_free_warning(void); - -static inline void -rb_raise_cstr_i(VALUE etype, VALUE mesg) -{ - VALUE exc = rb_exc_new_str(etype, mesg); - rb_exc_raise(exc); -} - -static inline void -rb_raise_cstr(VALUE etype, const char *mesg) -{ - VALUE str = rb_str_new_cstr(mesg); - rb_raise_cstr_i(etype, str); -} - -static inline void -rb_name_err_raise_str(VALUE mesg, VALUE recv, VALUE name) -{ - VALUE exc = rb_name_err_new(mesg, recv, name); - rb_exc_raise(exc); -} - -static inline void -rb_name_err_raise(const char *mesg, VALUE recv, VALUE name) -{ - VALUE str = rb_fstring_cstr(mesg); - rb_name_err_raise_str(str, recv, name); -} - -static inline void -rb_key_err_raise(VALUE mesg, VALUE recv, VALUE name) -{ - VALUE exc = rb_key_err_new(mesg, recv, name); - rb_exc_raise(exc); -} - -static inline bool -rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type) -{ - return RB_TYPE_P(obj, T_DATA) && RTYPEDDATA_P(obj) && (RTYPEDDATA_TYPE(obj) == data_type); -} - -#endif /* INTERNAL_ERROR_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h deleted file mode 100644 index e594d85..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef INTERNAL_EVAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_EVAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the evaluator. - * @note There also is eval_intern.h, which is evaluator's internal - * header (related to this file, but not the same role). - */ -#include "ruby/ruby.h" /* for ID */ - -#define id_signo ruby_static_id_signo -#define id_status ruby_static_id_status - -/* eval.c */ -extern ID ruby_static_id_signo; -extern ID ruby_static_id_status; -VALUE rb_refinement_module_get_refined_class(VALUE module); -void rb_class_modify_check(VALUE); -NORETURN(VALUE rb_f_raise(int argc, VALUE *argv)); -VALUE rb_top_main_class(const char *method); - -/* eval_error.c */ -VALUE rb_get_backtrace(VALUE info); - -/* eval_jump.c */ -void rb_call_end_proc(VALUE data); -void rb_mark_end_proc(void); - -#endif /* INTERNAL_EVAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/file.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/file.h deleted file mode 100644 index 9c192ff..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/file.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef INTERNAL_FILE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_FILE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for File. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/encoding.h" /* for rb_encodinng */ - -/* file.c */ -extern const char ruby_null_device[]; -VALUE rb_home_dir_of(VALUE user, VALUE result); -VALUE rb_default_home_dir(VALUE result); -VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict); -VALUE rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *origenc); -void rb_file_const(const char*, VALUE); -int rb_file_load_ok(const char *); -VALUE rb_file_expand_path_fast(VALUE, VALUE); -VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE); -VALUE rb_get_path_check_to_string(VALUE); -VALUE rb_get_path_check_convert(VALUE); -int ruby_is_fd_loadable(int fd); - -RUBY_SYMBOL_EXPORT_BEGIN -/* file.c (export) */ -#ifdef HAVE_READLINK -VALUE rb_readlink(VALUE path, rb_encoding *enc); -#endif -#ifdef __APPLE__ -VALUE rb_str_normalize_ospath(const char *ptr, long len); -#endif -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_FILE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h deleted file mode 100644 index 8c251ad..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h +++ /dev/null @@ -1,184 +0,0 @@ -#ifndef INTERNAL_FIXNUM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_FIXNUM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Fixnums. - */ -#include "ruby/internal/config.h" /* for HAVE_LONG_LONG */ -#include /* for CHAR_BIT */ -#include "internal/compilers.h" /* for __has_builtin */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/intern.h" /* for rb_big_mul */ -#include "ruby/ruby.h" /* for RB_FIXABLE */ - -#if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG -# define DLONG LONG_LONG -# define DL2NUM(x) LL2NUM(x) -#elif defined(HAVE_INT128_T) && !(defined(__OpenBSD__) && defined(__mips64__)) -# define DLONG int128_t -# define DL2NUM(x) (RB_FIXABLE(x) ? LONG2FIX(x) : rb_int128t2big(x)) -VALUE rb_int128t2big(int128_t n); /* in bignum.c */ -#endif - -static inline long rb_overflowed_fix_to_int(long x); -static inline VALUE rb_fix_plus_fix(VALUE x, VALUE y); -static inline VALUE rb_fix_minus_fix(VALUE x, VALUE y); -static inline VALUE rb_fix_mul_fix(VALUE x, VALUE y); -static inline void rb_fix_divmod_fix(VALUE x, VALUE y, VALUE *divp, VALUE *modp); -static inline VALUE rb_fix_div_fix(VALUE x, VALUE y); -static inline VALUE rb_fix_mod_fix(VALUE x, VALUE y); -static inline bool FIXNUM_POSITIVE_P(VALUE num); -static inline bool FIXNUM_NEGATIVE_P(VALUE num); -static inline bool FIXNUM_ZERO_P(VALUE num); - -static inline long -rb_overflowed_fix_to_int(long x) -{ - return (long)((unsigned long)(x >> 1) ^ (1LU << (SIZEOF_LONG * CHAR_BIT - 1))); -} - -static inline VALUE -rb_fix_plus_fix(VALUE x, VALUE y) -{ -#if !__has_builtin(__builtin_add_overflow) - long lz = FIX2LONG(x) + FIX2LONG(y); - return LONG2NUM(lz); -#else - long lz; - /* NOTE - * (1) `LONG2FIX(FIX2LONG(x)+FIX2LONG(y))` - + = `((lx*2+1)/2 + (ly*2+1)/2)*2+1` - + = `lx*2 + ly*2 + 1` - + = `(lx*2+1) + (ly*2+1) - 1` - + = `x + y - 1` - * (2) Fixnum's LSB is always 1. - * It means you can always run `x - 1` without overflow. - * (3) Of course `z = x + (y-1)` may overflow. - * At that time true value is - * * positive: 0b0 1xxx...1, and z = 0b1xxx...1 - * * negative: 0b1 0xxx...1, and z = 0b0xxx...1 - * To convert this true value to long, - * (a) Use arithmetic shift - * * positive: 0b11xxx... - * * negative: 0b00xxx... - * (b) invert MSB - * * positive: 0b01xxx... - * * negative: 0b10xxx... - */ - if (__builtin_add_overflow((long)x, (long)y-1, &lz)) { - return rb_int2big(rb_overflowed_fix_to_int(lz)); - } - else { - return (VALUE)lz; - } -#endif -} - -static inline VALUE -rb_fix_minus_fix(VALUE x, VALUE y) -{ -#if !__has_builtin(__builtin_sub_overflow) - long lz = FIX2LONG(x) - FIX2LONG(y); - return LONG2NUM(lz); -#else - long lz; - if (__builtin_sub_overflow((long)x, (long)y-1, &lz)) { - return rb_int2big(rb_overflowed_fix_to_int(lz)); - } - else { - return (VALUE)lz; - } -#endif -} - -/* arguments must be Fixnum */ -static inline VALUE -rb_fix_mul_fix(VALUE x, VALUE y) -{ - long lx = FIX2LONG(x); - long ly = FIX2LONG(y); -#ifdef DLONG - return DL2NUM((DLONG)lx * (DLONG)ly); -#else - if (MUL_OVERFLOW_FIXNUM_P(lx, ly)) { - return rb_big_mul(rb_int2big(lx), rb_int2big(ly)); - } - else { - return LONG2FIX(lx * ly); - } -#endif -} - -/* - * This behaves different from C99 for negative arguments. - * Note that div may overflow fixnum. - */ -static inline void -rb_fix_divmod_fix(VALUE a, VALUE b, VALUE *divp, VALUE *modp) -{ - /* assume / and % comply C99. - * ldiv(3) won't be inlined by GCC and clang. - * I expect / and % are compiled as single idiv. - */ - long x = FIX2LONG(a); - long y = FIX2LONG(b); - long div, mod; - if (x == FIXNUM_MIN && y == -1) { - if (divp) *divp = LONG2NUM(-FIXNUM_MIN); - if (modp) *modp = LONG2FIX(0); - return; - } - div = x / y; - mod = x % y; - if (y > 0 ? mod < 0 : mod > 0) { - mod += y; - div -= 1; - } - if (divp) *divp = LONG2FIX(div); - if (modp) *modp = LONG2FIX(mod); -} - -/* div() for Ruby - * This behaves different from C99 for negative arguments. - */ -static inline VALUE -rb_fix_div_fix(VALUE x, VALUE y) -{ - VALUE div; - rb_fix_divmod_fix(x, y, &div, NULL); - return div; -} - -/* mod() for Ruby - * This behaves different from C99 for negative arguments. - */ -static inline VALUE -rb_fix_mod_fix(VALUE x, VALUE y) -{ - VALUE mod; - rb_fix_divmod_fix(x, y, NULL, &mod); - return mod; -} - -static inline bool -FIXNUM_POSITIVE_P(VALUE num) -{ - return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0); -} - -static inline bool -FIXNUM_NEGATIVE_P(VALUE num) -{ - return (SIGNED_VALUE)num < 0; -} - -static inline bool -FIXNUM_ZERO_P(VALUE num) -{ - return num == INT2FIX(0); -} -#endif /* INTERNAL_FIXNUM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h deleted file mode 100644 index 0f48916..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h +++ /dev/null @@ -1,322 +0,0 @@ -#ifndef INTERNAL_GC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_GC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for GC. - */ -#include "ruby/internal/config.h" - -#include /* for size_t */ - -#include "internal/compilers.h" /* for __has_attribute */ -#include "ruby/ruby.h" /* for rb_event_flag_t */ -#include "vm_core.h" /* for GET_EC() */ - -#ifndef USE_SHARED_GC -# define USE_SHARED_GC 0 -#endif - -#if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p))) -#elif defined(__i386) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p))) -#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && !defined(_AIX) && !defined(__APPLE__) // Not Apple is NEEDED to unbreak ppc64 build on Darwin. Don't ask. -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p))) -#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && defined(_AIX) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr %0,1" : "=r" (*(p))) -#elif defined(__POWERPC__) && defined(__APPLE__) // Darwin ppc and ppc64 -#define SET_MACHINE_STACK_END(p) __asm__ volatile("mr %0, r1" : "=r" (*(p))) -#elif defined(__aarch64__) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mov\t%0, sp" : "=r" (*(p))) -#else -NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p)); -#define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p) -#define USE_CONSERVATIVE_STACK_END -#endif - -/* for GC debug */ - -#ifndef RUBY_MARK_FREE_DEBUG -#define RUBY_MARK_FREE_DEBUG 0 -#endif - -#if RUBY_MARK_FREE_DEBUG -extern int ruby_gc_debug_indent; - -static inline void -rb_gc_debug_indent(void) -{ - ruby_debug_printf("%*s", ruby_gc_debug_indent, ""); -} - -static inline void -rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr) -{ - if (st == 0) { - ruby_gc_debug_indent--; - } - rb_gc_debug_indent(); - ruby_debug_printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr); - - if (st) { - ruby_gc_debug_indent++; - } - - fflush(stdout); -} - -#define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", (msg), 1, ptr) -#define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", (msg), 0, ptr) -#define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", (msg), 1, ptr) -#define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", (msg), 0, ptr) -#define RUBY_GC_INFO rb_gc_debug_indent(), ruby_debug_printf - -#else -#define RUBY_MARK_ENTER(msg) -#define RUBY_MARK_LEAVE(msg) -#define RUBY_FREE_ENTER(msg) -#define RUBY_FREE_LEAVE(msg) -#define RUBY_GC_INFO if(0)printf -#endif - -#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;} - -#if STACK_GROW_DIRECTION > 0 -# define STACK_UPPER(x, a, b) (a) -#elif STACK_GROW_DIRECTION < 0 -# define STACK_UPPER(x, a, b) (b) -#else -RUBY_EXTERN int ruby_stack_grow_direction; -int ruby_get_stack_grow_direction(volatile VALUE *addr); -# define stack_growup_p(x) ( \ - (ruby_stack_grow_direction ? \ - ruby_stack_grow_direction : \ - ruby_get_stack_grow_direction(x)) > 0) -# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b)) -#endif - -/* - STACK_GROW_DIR_DETECTION is used with STACK_DIR_UPPER. - - On most normal systems, stacks grow from high address to lower address. In - this case, STACK_DIR_UPPER(a, b) will return (b), but on exotic systems where - the stack grows UP (from low address to high address), it will return (a). -*/ - -#if STACK_GROW_DIRECTION -#define STACK_GROW_DIR_DETECTION -#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, (a), (b)) -#else -#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection -#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b)) -#endif -#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0) - -const char *rb_obj_info(VALUE obj); -const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj); - -struct rb_execution_context_struct; /* in vm_core.h */ -struct rb_objspace; /* in vm_core.h */ - -#define NEWOBJ_OF(var, T, c, f, s, ec) \ - T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \ - rb_wb_protected_newobj_of((ec ? ec : GET_EC()), (c), (f) & ~FL_WB_PROTECTED, s) : \ - rb_wb_unprotected_newobj_of((c), (f), s)) - -#define RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */ - -#ifndef USE_UNALIGNED_MEMBER_ACCESS -# define UNALIGNED_MEMBER_ACCESS(expr) (expr) -#elif ! USE_UNALIGNED_MEMBER_ACCESS -# define UNALIGNED_MEMBER_ACCESS(expr) (expr) -#elif ! (__has_warning("-Waddress-of-packed-member") || GCC_VERSION_SINCE(9, 0, 0)) -# define UNALIGNED_MEMBER_ACCESS(expr) (expr) -#else -# include "internal/warnings.h" -# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \ - __typeof__(expr) unaligned_member_access_result = (expr); \ - COMPILER_WARNING_POP; \ - unaligned_member_access_result; \ -}) - -# define UNALIGNED_MEMBER_PTR(ptr, mem) __extension__({ \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \ - const volatile void *unaligned_member_ptr_result = &(ptr)->mem; \ - COMPILER_WARNING_POP; \ - (__typeof__((ptr)->mem) *)unaligned_member_ptr_result; \ -}) -#endif - -#ifndef UNALIGNED_MEMBER_PTR -# define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) -#endif - -#define RB_OBJ_WRITE_UNALIGNED(old, slot, young) do { \ - VALUE *_slot = UNALIGNED_MEMBER_ACCESS(slot); \ - RB_OBJ_WRITE(old, _slot, young); \ -} while (0) - -/* Used in places that could malloc during, which can cause the GC to run. We - * need to temporarily disable the GC to allow the malloc to happen. - * Allocating memory during GC is a bad idea, so use this only when absolutely - * necessary. */ -#define DURING_GC_COULD_MALLOC_REGION_START() \ - assert(rb_during_gc()); \ - VALUE _already_disabled = rb_gc_disable_no_rest() - -#define DURING_GC_COULD_MALLOC_REGION_END() \ - if (_already_disabled == Qfalse) rb_gc_enable() - -/* gc.c */ -extern int ruby_disable_gc; -RUBY_ATTR_MALLOC void *ruby_mimmalloc(size_t size); -RUBY_ATTR_MALLOC void *ruby_mimcalloc(size_t num, size_t size); -void ruby_mimfree(void *ptr); -void rb_gc_prepare_heap(void); -void rb_objspace_set_event_hook(const rb_event_flag_t event); -VALUE rb_objspace_gc_enable(void *objspace); -VALUE rb_objspace_gc_disable(void *objspace); -void ruby_gc_set_params(void); -void rb_gc_copy_attributes(VALUE dest, VALUE obj); -size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */ -size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */ -size_t rb_malloc_grow_capa(size_t current_capacity, size_t type_size); -RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add(size_t, size_t, size_t); -RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add(size_t, size_t, size_t); -void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t); -RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t); -RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t); -static inline void *ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2)); -static inline void *ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3)); -static inline void ruby_sized_xfree_inlined(void *ptr, size_t size); - -void *rb_gc_ractor_cache_alloc(void); -void rb_gc_ractor_cache_free(void *cache); - -bool rb_gc_size_allocatable_p(size_t size); -size_t *rb_gc_heap_sizes(void); -size_t rb_gc_heap_id_for_size(size_t size); - -void rb_gc_mark_and_move(VALUE *ptr); - -void rb_gc_mark_weak(VALUE *ptr); -void rb_gc_remove_weak(VALUE parent_obj, VALUE *ptr); - -void rb_gc_ref_update_table_values_only(st_table *tbl); - -void rb_gc_initial_stress_set(VALUE flag); - -#define rb_gc_mark_and_move_ptr(ptr) do { \ - VALUE _obj = (VALUE)*(ptr); \ - rb_gc_mark_and_move(&_obj); \ - if (_obj != (VALUE)*(ptr)) *(ptr) = (void *)_obj; \ -} while (0) - -RUBY_SYMBOL_EXPORT_BEGIN -/* exports for objspace module */ -void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data); -void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data); -int rb_objspace_internal_object_p(VALUE obj); -int rb_objspace_garbage_object_p(VALUE obj); - -void rb_objspace_each_objects( - int (*callback)(void *start, void *end, size_t stride, void *data), - void *data); - -size_t rb_gc_obj_slot_size(VALUE obj); - -VALUE rb_gc_disable_no_rest(void); - - -/* gc.c (export) */ -const char *rb_objspace_data_type_name(VALUE obj); -VALUE rb_wb_protected_newobj_of(struct rb_execution_context_struct *, VALUE, VALUE, size_t); -VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE, size_t); -size_t rb_obj_memsize_of(VALUE); -size_t rb_obj_gc_flags(VALUE, ID[], size_t); -void rb_gc_mark_values(long n, const VALUE *values); -void rb_gc_mark_vm_stack_values(long n, const VALUE *values); -void rb_gc_update_values(long n, VALUE *values); -void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2)); -void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3)); -void ruby_sized_xfree(void *x, size_t size); - -#if USE_SHARED_GC -void ruby_load_external_gc_from_argv(int argc, char **argv); -#endif -RUBY_SYMBOL_EXPORT_END - -int rb_ec_stack_check(struct rb_execution_context_struct *ec); -void rb_gc_writebarrier_remember(VALUE obj); -const char *rb_obj_info(VALUE obj); - -#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32) - -static inline void * -ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) -{ - return ruby_xrealloc(ptr, new_size); -} - -static inline void * -ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) -{ - return ruby_xrealloc2(ptr, new_count, elemsiz); -} - -static inline void -ruby_sized_xfree_inlined(void *ptr, size_t size) -{ - ruby_xfree(ptr); -} - -# define SIZED_REALLOC_N(x, y, z, w) REALLOC_N(x, y, z) - -static inline void * -ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count) -{ - return ruby_xrealloc2(ptr, new_count, element_size); -} - -#else - -static inline void * -ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) -{ - return ruby_sized_xrealloc(ptr, new_size, old_size); -} - -static inline void * -ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) -{ - return ruby_sized_xrealloc2(ptr, new_count, elemsiz, old_count); -} - -static inline void -ruby_sized_xfree_inlined(void *ptr, size_t size) -{ - ruby_sized_xfree(ptr, size); -} - -# define SIZED_REALLOC_N(v, T, m, n) \ - ((v) = (T *)ruby_sized_xrealloc2((void *)(v), (m), sizeof(T), (n))) - -static inline void * -ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count) -{ - return ruby_sized_xrealloc2(ptr, new_count, element_size, old_count); -} - -#endif /* HAVE_MALLOC_USABLE_SIZE */ - -#define ruby_sized_xrealloc ruby_sized_xrealloc_inlined -#define ruby_sized_xrealloc2 ruby_sized_xrealloc2_inlined -#define ruby_sized_xfree ruby_sized_xfree_inlined -#endif /* INTERNAL_GC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/hash.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/hash.h deleted file mode 100644 index d66b5b2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/hash.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef INTERNAL_HASH_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_HASH_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Hash. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for struct RBasic */ -#include "ruby/st.h" /* for struct st_table */ - -#define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE - -struct ar_table_struct; -typedef unsigned char ar_hint_t; - -enum ruby_rhash_flags { - RHASH_PASS_AS_KEYWORDS = FL_USER1, /* FL 1 */ - RHASH_PROC_DEFAULT = FL_USER2, /* FL 2 */ - RHASH_ST_TABLE_FLAG = FL_USER3, /* FL 3 */ - RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7), /* FL 4..7 */ - RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4), - RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */ - RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8), - - // we can not put it in "enum" because it can exceed "int" range. -#define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \ - FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19) - - RHASH_LEV_SHIFT = (FL_USHIFT + 13), - RHASH_LEV_MAX = 127, /* 7 bits */ -}; - -typedef struct ar_table_pair_struct { - VALUE key; - VALUE val; -} ar_table_pair; - -typedef struct ar_table_struct { - union { - ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE]; - VALUE word; - } ar_hint; - /* 64bit CPU: 8B * 2 * 8 = 128B */ - ar_table_pair pairs[RHASH_AR_TABLE_MAX_SIZE]; -} ar_table; - -struct RHash { - struct RBasic basic; - const VALUE ifnone; -}; - -#define RHASH(obj) ((struct RHash *)(obj)) - -#ifdef RHASH_IFNONE -# undef RHASH_IFNONE -#endif - -#ifdef RHASH_SIZE -# undef RHASH_SIZE -#endif - -#ifdef RHASH_EMPTY_P -# undef RHASH_EMPTY_P -#endif - -/* hash.c */ -void rb_hash_st_table_set(VALUE hash, st_table *st); -VALUE rb_hash_default_value(VALUE hash, VALUE key); -VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc); -long rb_dbl_long_hash(double d); -st_table *rb_init_identtable(void); -st_index_t rb_any_hash(VALUE a); -int rb_any_cmp(VALUE a, VALUE b); -VALUE rb_to_hash_type(VALUE obj); -VALUE rb_hash_key_str(VALUE); -VALUE rb_hash_values(VALUE hash); -VALUE rb_hash_rehash(VALUE hash); -int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val); -VALUE rb_hash_set_pair(VALUE hash, VALUE pair); -int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval); -int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg); -int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg); -VALUE rb_ident_hash_new_with_size(st_index_t size); -void rb_hash_free(VALUE hash); -RUBY_EXTERN VALUE rb_cHash_empty_frozen; - -static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h); -static inline VALUE RHASH_IFNONE(VALUE h); -static inline size_t RHASH_SIZE(VALUE h); -static inline bool RHASH_EMPTY_P(VALUE h); -static inline bool RHASH_AR_TABLE_P(VALUE h); -static inline bool RHASH_ST_TABLE_P(VALUE h); -static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h); -static inline st_table *RHASH_ST_TABLE(VALUE h); -static inline size_t RHASH_ST_SIZE(VALUE h); -static inline void RHASH_ST_CLEAR(VALUE h); - -RUBY_SYMBOL_EXPORT_BEGIN -/* hash.c (export) */ -VALUE rb_hash_delete_entry(VALUE hash, VALUE key); -VALUE rb_ident_hash_new(void); -int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_hash_new_with_size(st_index_t size); -VALUE rb_hash_resurrect(VALUE hash); -int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval); -VALUE rb_hash_keys(VALUE hash); -VALUE rb_hash_has_key(VALUE hash, VALUE key); -VALUE rb_hash_compare_by_id_p(VALUE hash); - -st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line); -#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__) - -VALUE rb_hash_compare_by_id(VALUE hash); - -static inline bool -RHASH_AR_TABLE_P(VALUE h) -{ - return ! FL_TEST_RAW(h, RHASH_ST_TABLE_FLAG); -} - -RBIMPL_ATTR_RETURNS_NONNULL() -static inline struct ar_table_struct * -RHASH_AR_TABLE(VALUE h) -{ - return (struct ar_table_struct *)((uintptr_t)h + sizeof(struct RHash)); -} - -RBIMPL_ATTR_RETURNS_NONNULL() -static inline st_table * -RHASH_ST_TABLE(VALUE h) -{ - return (st_table *)((uintptr_t)h + sizeof(struct RHash)); -} - -static inline VALUE -RHASH_IFNONE(VALUE h) -{ - return RHASH(h)->ifnone; -} - -static inline size_t -RHASH_SIZE(VALUE h) -{ - if (RHASH_AR_TABLE_P(h)) { - return RHASH_AR_TABLE_SIZE_RAW(h); - } - else { - return RHASH_ST_SIZE(h); - } -} - -static inline bool -RHASH_EMPTY_P(VALUE h) -{ - return RHASH_SIZE(h) == 0; -} - -static inline bool -RHASH_ST_TABLE_P(VALUE h) -{ - return ! RHASH_AR_TABLE_P(h); -} - -static inline size_t -RHASH_ST_SIZE(VALUE h) -{ - return RHASH_ST_TABLE(h)->num_entries; -} - -static inline void -RHASH_ST_CLEAR(VALUE h) -{ - memset(RHASH_ST_TABLE(h), 0, sizeof(st_table)); -} - -static inline unsigned -RHASH_AR_TABLE_SIZE_RAW(VALUE h) -{ - VALUE ret = FL_TEST_RAW(h, RHASH_AR_TABLE_SIZE_MASK); - ret >>= RHASH_AR_TABLE_SIZE_SHIFT; - return (unsigned)ret; -} - -#endif /* INTERNAL_HASH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h deleted file mode 100644 index 7420909..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h +++ /dev/null @@ -1,261 +0,0 @@ -#ifndef INTERNAL_IMEMO_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_IMEMO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief IMEMO: Internal memo object. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "internal/array.h" /* for rb_ary_hidden_new_fill */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for rb_block_call_func_t */ - -#ifndef IMEMO_DEBUG -# define IMEMO_DEBUG 0 -#endif - -#define IMEMO_MASK 0x0f - -/* FL_USER0 to FL_USER3 is for type */ -#define IMEMO_FL_USHIFT (FL_USHIFT + 4) -#define IMEMO_FL_USER0 FL_USER4 -#define IMEMO_FL_USER1 FL_USER5 -#define IMEMO_FL_USER2 FL_USER6 -#define IMEMO_FL_USER3 FL_USER7 -#define IMEMO_FL_USER4 FL_USER8 -#define IMEMO_FL_USER5 FL_USER9 - -enum imemo_type { - imemo_env = 0, - imemo_cref = 1, /*!< class reference */ - imemo_svar = 2, /*!< special variable */ - imemo_throw_data = 3, - imemo_ifunc = 4, /*!< iterator function */ - imemo_memo = 5, - imemo_ment = 6, - imemo_iseq = 7, - imemo_tmpbuf = 8, - imemo_ast = 9, // Obsolete due to the universal parser - imemo_parser_strterm = 10, - imemo_callinfo = 11, - imemo_callcache = 12, - imemo_constcache = 13, -}; - -/* CREF (Class REFerence) is defined in method.h */ - -/*! SVAR (Special VARiable) */ -struct vm_svar { - VALUE flags; - const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */ - const VALUE lastline; - const VALUE backref; - const VALUE others; -}; - -/*! THROW_DATA */ -struct vm_throw_data { - VALUE flags; - VALUE reserved; - const VALUE throw_obj; - const struct rb_control_frame_struct *catch_frame; - int throw_state; -}; - -#define THROW_DATA_CONSUMED IMEMO_FL_USER0 - -/* IFUNC (Internal FUNCtion) */ - -struct vm_ifunc_argc { -#if SIZEOF_INT * 2 > SIZEOF_VALUE - signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2; - signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2; -#else - int min, max; -#endif -}; - -/*! IFUNC (Internal FUNCtion) */ -struct vm_ifunc { - VALUE flags; - VALUE *svar_lep; - rb_block_call_func_t func; - const void *data; - struct vm_ifunc_argc argc; -}; -#define IFUNC_YIELD_OPTIMIZABLE IMEMO_FL_USER0 - -struct rb_imemo_tmpbuf_struct { - VALUE flags; - VALUE reserved; - VALUE *ptr; /* malloc'ed buffer */ - struct rb_imemo_tmpbuf_struct *next; /* next imemo */ - size_t cnt; /* buffer size in VALUE */ -}; - -/*! MEMO - * - * @see imemo_type - * */ -struct MEMO { - VALUE flags; - VALUE reserved; - const VALUE v1; - const VALUE v2; - union { - long cnt; - long state; - const VALUE value; - void (*func)(void); - } u3; -}; - -#define IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0))) - -/* ment is in method.h */ - -#define THROW_DATA_P(err) imemo_throw_data_p((VALUE)err) -#define MEMO_CAST(m) ((struct MEMO *)(m)) -#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value)) -#define NEW_MEMO_FOR(type, value) \ - ((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value)) -#define NEW_PARTIAL_MEMO_FOR(type, value, member) \ - ((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), \ - rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \ - MEMO_FOR(type, value)) - -#ifndef RUBY_RUBYPARSER_H -typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t; -#endif -rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt); -struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc); -static inline enum imemo_type imemo_type(VALUE imemo); -static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type); -static inline bool imemo_throw_data_p(VALUE imemo); -static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data); -static inline VALUE rb_imemo_tmpbuf_auto_free_pointer(void); -static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v); -static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr); -static inline VALUE rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str); -static inline void MEMO_V1_SET(struct MEMO *m, VALUE v); -static inline void MEMO_V2_SET(struct MEMO *m, VALUE v); - -size_t rb_imemo_memsize(VALUE obj); -void rb_cc_table_mark(VALUE klass); -void rb_imemo_mark_and_move(VALUE obj, bool reference_updating); -void rb_cc_table_free(VALUE klass); -void rb_imemo_free(VALUE obj); - -RUBY_SYMBOL_EXPORT_BEGIN -#if IMEMO_DEBUG -VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v0, const char *file, int line); -#define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__) -#else -VALUE rb_imemo_new(enum imemo_type type, VALUE v0); -#endif -const char *rb_imemo_name(enum imemo_type type); -RUBY_SYMBOL_EXPORT_END - -static inline struct MEMO * -MEMO_NEW(VALUE a, VALUE b, VALUE c) -{ - struct MEMO *memo = IMEMO_NEW(struct MEMO, imemo_memo, 0); - *((VALUE *)&memo->v1) = a; - *((VALUE *)&memo->v2) = b; - *((VALUE *)&memo->u3.value) = c; - - return memo; -} - -static inline enum imemo_type -imemo_type(VALUE imemo) -{ - return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK; -} - -static inline int -imemo_type_p(VALUE imemo, enum imemo_type imemo_type) -{ - if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) { - /* fixed at compile time if imemo_type is given. */ - const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK; - const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO; - /* fixed at runtime. */ - return expected_type == (RBASIC(imemo)->flags & mask); - } - else { - return 0; - } -} - -#define IMEMO_TYPE_P(v, t) imemo_type_p((VALUE)(v), t) - -static inline bool -imemo_throw_data_p(VALUE imemo) -{ - return RB_TYPE_P(imemo, T_IMEMO); -} - -static inline struct vm_ifunc * -rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data) -{ - return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS); -} - -static inline VALUE -rb_imemo_tmpbuf_auto_free_pointer(void) -{ - return rb_imemo_new(imemo_tmpbuf, 0); -} - -static inline void * -RB_IMEMO_TMPBUF_PTR(VALUE v) -{ - const struct rb_imemo_tmpbuf_struct *p = (const void *)v; - return p->ptr; -} - -static inline void * -rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr) -{ - return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr; -} - -static inline VALUE -rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str) -{ - const void *src; - VALUE imemo; - rb_imemo_tmpbuf_t *tmpbuf; - void *dst; - size_t len; - - StringValue(str); - /* create tmpbuf to keep the pointer before xmalloc */ - imemo = rb_imemo_tmpbuf_auto_free_pointer(); - tmpbuf = (rb_imemo_tmpbuf_t *)imemo; - len = RSTRING_LEN(str); - src = RSTRING_PTR(str); - dst = ruby_xmalloc(len); - memcpy(dst, src, len); - tmpbuf->ptr = dst; - return imemo; -} - -static inline void -MEMO_V1_SET(struct MEMO *m, VALUE v) -{ - RB_OBJ_WRITE(m, &m->v1, v); -} - -static inline void -MEMO_V2_SET(struct MEMO *m, VALUE v) -{ - RB_OBJ_WRITE(m, &m->v2, v); -} - -#endif /* INTERNAL_IMEMO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h deleted file mode 100644 index 03de289..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef INTERNAL_INITS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_INITS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header aggregating init functions. - */ - -/* class.c */ -void Init_class_hierarchy(void); - -/* dmyext.c */ -void Init_enc(void); -void Init_ext(void); - -/* file.c */ -void Init_File(void); - -/* localeinit.c */ -int Init_enc_set_filesystem_encoding(void); - -/* newline.c */ -void Init_newline(void); - -/* vm.c */ -void Init_BareVM(void); -void Init_vm_objects(void); - -/* vm_backtrace.c */ -void Init_vm_backtrace(void); - -/* vm_eval.c */ -void Init_vm_eval(void); - -/* vm_insnhelper.c */ -void Init_vm_stack_canary(void); - -/* vm_method.c */ -void Init_eval_method(void); - -/* inits.c */ -void rb_call_inits(void); - -#endif /* INTERNAL_INITS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/io.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/io.h deleted file mode 100644 index c207ca3..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/io.h +++ /dev/null @@ -1,143 +0,0 @@ -#ifndef INTERNAL_IO_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_IO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for IO. - */ -#include "ruby/ruby.h" /* for VALUE */ - -#define HAVE_RB_IO_T -struct rb_io; - -#include "ruby/io.h" /* for rb_io_t */ - -#define IO_WITHOUT_GVL(func, arg) rb_thread_call_without_gvl(func, arg, RUBY_UBF_IO, 0) -#define IO_WITHOUT_GVL_INT(func, arg) (int)(VALUE)IO_WITHOUT_GVL(func, arg) - -/** Ruby's IO, metadata and buffers. */ -struct rb_io { - - /** The IO's Ruby level counterpart. */ - VALUE self; - - /** stdio ptr for read/write, if available. */ - FILE *stdio_file; - - /** file descriptor. */ - int fd; - - /** mode flags: FMODE_XXXs */ - int mode; - - /** child's pid (for pipes) */ - rb_pid_t pid; - - /** number of lines read */ - int lineno; - - /** pathname for file */ - VALUE pathv; - - /** finalize proc */ - void (*finalize)(struct rb_io*,int); - - /** Write buffer. */ - rb_io_buffer_t wbuf; - - /** - * (Byte) read buffer. Note also that there is a field called - * ::rb_io_t::cbuf, which also concerns read IO. - */ - rb_io_buffer_t rbuf; - - /** - * Duplex IO object, if set. - * - * @see rb_io_set_write_io() - */ - VALUE tied_io_for_writing; - - struct rb_io_encoding encs; /**< Decomposed encoding flags. */ - - /** Encoding converter used when reading from this IO. */ - rb_econv_t *readconv; - - /** - * rb_io_ungetc() destination. This buffer is read before checking - * ::rb_io_t::rbuf - */ - rb_io_buffer_t cbuf; - - /** Encoding converter used when writing to this IO. */ - rb_econv_t *writeconv; - - /** - * This is, when set, an instance of ::rb_cString which holds the "common" - * encoding. Write conversion can convert strings twice... In case - * conversion from encoding X to encoding Y does not exist, Ruby finds an - * encoding Z that bridges the two, so that X to Z to Y conversion happens. - */ - VALUE writeconv_asciicompat; - - /** Whether ::rb_io_t::writeconv is already set up. */ - int writeconv_initialized; - - /** - * Value of ::rb_io_t::rb_io_enc_t::ecflags stored right before - * initialising ::rb_io_t::writeconv. - */ - int writeconv_pre_ecflags; - - /** - * Value of ::rb_io_t::rb_io_enc_t::ecopts stored right before initialising - * ::rb_io_t::writeconv. - */ - VALUE writeconv_pre_ecopts; - - /** - * This is a Ruby level mutex. It avoids multiple threads to write to an - * IO at once; helps for instance rb_io_puts() to ensure newlines right - * next to its arguments. - * - * This of course doesn't help inter-process IO interleaves, though. - */ - VALUE write_lock; - - /** - * The timeout associated with this IO when performing blocking operations. - */ - VALUE timeout; -}; - -/* io.c */ -void ruby_set_inplace_mode(const char *); -void rb_stdio_set_default_encoding(void); -VALUE rb_io_flush_raw(VALUE, int); -size_t rb_io_memsize(const rb_io_t *); -int rb_stderr_tty_p(void); -void rb_io_fptr_finalize_internal(void *ptr); -#ifdef rb_io_fptr_finalize -# undef rb_io_fptr_finalize -#endif -#define rb_io_fptr_finalize rb_io_fptr_finalize_internal -VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt); - -VALUE rb_io_prep_stdin(void); -VALUE rb_io_prep_stdout(void); -VALUE rb_io_prep_stderr(void); - -RUBY_SYMBOL_EXPORT_BEGIN -/* io.c (export) */ -void rb_maygvl_fd_fix_cloexec(int fd); -int rb_gc_for_fd(int err); -void rb_write_error_str(VALUE mesg); - -VALUE rb_io_blocking_region_wait(struct rb_io *io, rb_blocking_function_t *function, void *argument, enum rb_io_event events); -VALUE rb_io_blocking_region(struct rb_io *io, rb_blocking_function_t *function, void *argument); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_IO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/load.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/load.h deleted file mode 100644 index d4c0bb9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/load.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef INTERNAL_LOAD_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_LOAD_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for require. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* load.c */ -VALUE rb_get_expanded_load_path(void); -int rb_require_internal(VALUE fname); -NORETURN(void rb_load_fail(VALUE, const char*)); - -#endif /* INTERNAL_LOAD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h deleted file mode 100644 index b3a85e7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_LOADPATH_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_LOADPATH_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for $LOAD_PATH. - */ - -/* loadpath.c */ -extern const char ruby_exec_prefix[]; -extern const char ruby_initial_load_paths[]; - -#endif /* INTERNAL_LOADPATH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/math.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/math.h deleted file mode 100644 index 08f852f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/math.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERNAL_MATH_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_MATH_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Math. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* math.c */ -VALUE rb_math_atan2(VALUE, VALUE); -VALUE rb_math_cos(VALUE); -VALUE rb_math_cosh(VALUE); -VALUE rb_math_exp(VALUE); -VALUE rb_math_hypot(VALUE, VALUE); -VALUE rb_math_log(int argc, const VALUE *argv); -VALUE rb_math_sin(VALUE); -VALUE rb_math_sinh(VALUE); - -#endif /* INTERNAL_MATH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h deleted file mode 100644 index 6ca508c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef INTERNAL_MISSING_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_MISSING_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header corresponding missing. - */ -#include "ruby/internal/config.h" /* for HAVE_SETPROCTITLE */ - -/* missing/setproctitle.c */ -#ifndef HAVE_SETPROCTITLE -extern void ruby_init_setproctitle(int argc, char *argv[]); -extern void ruby_free_proctitle(void); -#endif - -#endif /* INTERNAL_MISSING_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h deleted file mode 100644 index 6406cfc..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h +++ /dev/null @@ -1,274 +0,0 @@ -#ifndef INTERNAL_NUMERIC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_NUMERIC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Numeric. - */ -#include "internal/bignum.h" /* for BIGNUM_POSITIVE_P */ -#include "internal/bits.h" /* for RUBY_BIT_ROTL */ -#include "internal/fixnum.h" /* for FIXNUM_POSITIVE_P */ -#include "internal/vm.h" /* for rb_method_basic_definition_p */ -#include "ruby/intern.h" /* for rb_cmperr */ -#include "ruby/ruby.h" /* for USE_FLONUM */ - -#define ROUND_TO(mode, even, up, down) \ - ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \ - (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down) -#define ROUND_FUNC(mode, name) \ - ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down) -#define ROUND_CALL(mode, name, args) \ - ROUND_TO(mode, name##_half_even args, \ - name##_half_up args, name##_half_down args) - -#ifndef ROUND_DEFAULT -# define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP -#endif - -enum ruby_num_rounding_mode { - RUBY_NUM_ROUND_HALF_UP, - RUBY_NUM_ROUND_HALF_EVEN, - RUBY_NUM_ROUND_HALF_DOWN, - RUBY_NUM_ROUND_DEFAULT = ROUND_DEFAULT, -}; - -/* same as internal.h */ -#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#define roomof(x, y) (((x) + (y) - 1) / (y)) -#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) - -#if SIZEOF_DOUBLE <= SIZEOF_VALUE -typedef double rb_float_value_type; -#else -typedef struct { - VALUE values[roomof(SIZEOF_DOUBLE, SIZEOF_VALUE)]; -} rb_float_value_type; -#endif - -struct RFloat { - struct RBasic basic; - rb_float_value_type float_value; -}; - -#define RFLOAT(obj) ((struct RFloat *)(obj)) - -/* numeric.c */ -int rb_num_to_uint(VALUE val, unsigned int *ret); -VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl); -double ruby_float_step_size(double beg, double end, double unit, int excl); -int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless); -int rb_num_negative_p(VALUE); -VALUE rb_int_succ(VALUE num); -VALUE rb_float_uminus(VALUE num); -VALUE rb_int_plus(VALUE x, VALUE y); -VALUE rb_float_plus(VALUE x, VALUE y); -VALUE rb_int_minus(VALUE x, VALUE y); -VALUE rb_float_minus(VALUE x, VALUE y); -VALUE rb_int_mul(VALUE x, VALUE y); -VALUE rb_float_mul(VALUE x, VALUE y); -VALUE rb_float_div(VALUE x, VALUE y); -VALUE rb_int_idiv(VALUE x, VALUE y); -VALUE rb_int_modulo(VALUE x, VALUE y); -VALUE rb_int2str(VALUE num, int base); -VALUE rb_fix_plus(VALUE x, VALUE y); -VALUE rb_int_gt(VALUE x, VALUE y); -VALUE rb_float_gt(VALUE x, VALUE y); -VALUE rb_int_ge(VALUE x, VALUE y); -enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts); -double rb_int_fdiv_double(VALUE x, VALUE y); -VALUE rb_int_pow(VALUE x, VALUE y); -VALUE rb_float_pow(VALUE x, VALUE y); -VALUE rb_int_cmp(VALUE x, VALUE y); -VALUE rb_int_equal(VALUE x, VALUE y); -VALUE rb_int_divmod(VALUE x, VALUE y); -VALUE rb_int_and(VALUE x, VALUE y); -VALUE rb_int_lshift(VALUE x, VALUE y); -VALUE rb_int_rshift(VALUE x, VALUE y); -VALUE rb_int_div(VALUE x, VALUE y); -int rb_int_positive_p(VALUE num); -int rb_int_negative_p(VALUE num); -VALUE rb_check_integer_type(VALUE); -VALUE rb_num_pow(VALUE x, VALUE y); -VALUE rb_float_ceil(VALUE num, int ndigits); -VALUE rb_float_floor(VALUE x, int ndigits); -VALUE rb_float_abs(VALUE flt); -static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid); -static inline int rb_num_positive_int_p(VALUE num); -static inline int rb_num_negative_int_p(VALUE num); -static inline double rb_float_flonum_value(VALUE v); -static inline double rb_float_noflonum_value(VALUE v); -static inline double rb_float_value_inline(VALUE v); -static inline VALUE rb_float_new_inline(double d); -static inline bool INT_POSITIVE_P(VALUE num); -static inline bool INT_NEGATIVE_P(VALUE num); -static inline bool FLOAT_ZERO_P(VALUE num); -#define rb_float_value rb_float_value_inline -#define rb_float_new rb_float_new_inline - -RUBY_SYMBOL_EXPORT_BEGIN -/* numeric.c (export) */ -RUBY_SYMBOL_EXPORT_END - -VALUE rb_flo_div_flo(VALUE x, VALUE y); -double ruby_float_mod(double x, double y); -VALUE rb_float_equal(VALUE x, VALUE y); -int rb_float_cmp(VALUE x, VALUE y); -VALUE rb_float_eql(VALUE x, VALUE y); -VALUE rb_fix_aref(VALUE fix, VALUE idx); -VALUE rb_int_zero_p(VALUE num); -VALUE rb_int_even_p(VALUE num); -VALUE rb_int_odd_p(VALUE num); -VALUE rb_int_abs(VALUE num); -VALUE rb_int_bit_length(VALUE num); -VALUE rb_int_uminus(VALUE num); -VALUE rb_int_comp(VALUE num); - -static inline bool -INT_POSITIVE_P(VALUE num) -{ - if (FIXNUM_P(num)) { - return FIXNUM_POSITIVE_P(num); - } - else { - return BIGNUM_POSITIVE_P(num); - } -} - -static inline bool -INT_NEGATIVE_P(VALUE num) -{ - if (FIXNUM_P(num)) { - return FIXNUM_NEGATIVE_P(num); - } - else { - return BIGNUM_NEGATIVE_P(num); - } -} - -static inline bool -FLOAT_ZERO_P(VALUE num) -{ - return RFLOAT_VALUE(num) == 0.0; -} - -static inline VALUE -rb_num_compare_with_zero(VALUE num, ID mid) -{ - VALUE zero = INT2FIX(0); - VALUE r = rb_check_funcall(num, mid, 1, &zero); - if (RB_UNDEF_P(r)) { - rb_cmperr(num, zero); - } - return r; -} - -static inline int -rb_num_positive_int_p(VALUE num) -{ - const ID mid = '>'; - - if (FIXNUM_P(num)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return FIXNUM_POSITIVE_P(num); - } - else if (RB_TYPE_P(num, T_BIGNUM)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return BIGNUM_POSITIVE_P(num); - } - return RTEST(rb_num_compare_with_zero(num, mid)); -} - -static inline int -rb_num_negative_int_p(VALUE num) -{ - const ID mid = '<'; - - if (FIXNUM_P(num)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return FIXNUM_NEGATIVE_P(num); - } - else if (RB_TYPE_P(num, T_BIGNUM)) { - if (rb_method_basic_definition_p(rb_cInteger, mid)) - return BIGNUM_NEGATIVE_P(num); - } - return RTEST(rb_num_compare_with_zero(num, mid)); -} - -static inline double -rb_float_flonum_value(VALUE v) -{ -#if USE_FLONUM - if (v != (VALUE)0x8000000000000002) { /* LIKELY */ - union { - double d; - VALUE v; - } t; - - VALUE b63 = (v >> 63); - /* e: xx1... -> 011... */ - /* xx0... -> 100... */ - /* ^b63 */ - t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~(VALUE)0x03), 3); - return t.d; - } -#endif - return 0.0; -} - -static inline double -rb_float_noflonum_value(VALUE v) -{ -#if SIZEOF_DOUBLE <= SIZEOF_VALUE - return RFLOAT(v)->float_value; -#else - union { - rb_float_value_type v; - double d; - } u = {RFLOAT(v)->float_value}; - return u.d; -#endif -} - -static inline double -rb_float_value_inline(VALUE v) -{ - if (FLONUM_P(v)) { - return rb_float_flonum_value(v); - } - return rb_float_noflonum_value(v); -} - -static inline VALUE -rb_float_new_inline(double d) -{ -#if USE_FLONUM - union { - double d; - VALUE v; - } t; - int bits; - - t.d = d; - bits = (int)((VALUE)(t.v >> 60) & 0x7); - /* bits contains 3 bits of b62..b60. */ - /* bits - 3 = */ - /* b011 -> b000 */ - /* b100 -> b001 */ - - if (t.v != 0x3000000000000000 /* 1.72723e-77 */ && - !((bits-3) & ~0x01)) { - return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02; - } - else if (t.v == (VALUE)0) { - /* +0.0 */ - return 0x8000000000000002; - } - /* out of range */ -#endif - return rb_float_new_in_heap(d); -} - -#endif /* INTERNAL_NUMERIC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/object.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/object.h deleted file mode 100644 index 92ad37f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/object.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef INTERNAL_OBJECT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_OBJECT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Object. - */ -#include "ruby/ruby.h" /* for VALUE */ - -/* object.c */ -size_t rb_obj_embedded_size(uint32_t numiv); -VALUE rb_class_allocate_instance(VALUE klass); -VALUE rb_class_search_ancestor(VALUE klass, VALUE super); -NORETURN(void rb_undefined_alloc(VALUE klass)); -double rb_num_to_dbl(VALUE val); -VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound); -VALUE rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze); -VALUE rb_obj_dup_setup(VALUE obj, VALUE dup); -VALUE rb_immutable_obj_clone(int, VALUE *, VALUE); -VALUE rb_check_convert_type_with_id(VALUE,int,const char*,ID); -int rb_bool_expected(VALUE, const char *, int raise); -static inline void RBASIC_CLEAR_CLASS(VALUE obj); -static inline void RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass); -static inline void RBASIC_SET_CLASS(VALUE obj, VALUE klass); - -RUBY_SYMBOL_EXPORT_BEGIN -/* object.c (export) */ -int rb_opts_exception_p(VALUE opts, int default_value); -RUBY_SYMBOL_EXPORT_END - -CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2)); -CONSTFUNC(VALUE rb_obj_not(VALUE obj)); -VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2); -void rb_obj_copy_ivar(VALUE dest, VALUE obj); -VALUE rb_false(VALUE obj); -VALUE rb_convert_type_with_id(VALUE v, int t, const char* nam, ID mid); -VALUE rb_obj_size(VALUE self, VALUE args, VALUE obj); -VALUE rb_get_freeze_opt(int argc, VALUE *argv); - -static inline void -RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass) -{ - const VALUE *ptr = &RBASIC(obj)->klass; - *(VALUE *)ptr = klass; -} - -static inline void -RBASIC_CLEAR_CLASS(VALUE obj) -{ - RBASIC_SET_CLASS_RAW(obj, 0); -} - -static inline void -RBASIC_SET_CLASS(VALUE obj, VALUE klass) -{ - VALUE oldv = RBASIC_CLASS(obj); - RBASIC_SET_CLASS_RAW(obj, klass); - RB_OBJ_WRITTEN(obj, oldv, klass); -} -#endif /* INTERNAL_OBJECT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/parse.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/parse.h deleted file mode 100644 index de42acb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/parse.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef INTERNAL_PARSE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PARSE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the parser. - */ -#include -#include "rubyparser.h" -#include "internal/static_assert.h" - -// The default parser to use for Ruby code. -typedef enum { - RB_DEFAULT_PARSER_PARSE_Y, - RB_DEFAULT_PARSER_PRISM, -} ruby_default_parser_enum; - -ruby_default_parser_enum rb_ruby_default_parser(void); -void rb_ruby_default_parser_set(ruby_default_parser_enum parser); - -#define rb_ruby_prism_p() (rb_ruby_default_parser() == RB_DEFAULT_PARSER_PRISM) - -#ifdef UNIVERSAL_PARSER -#define rb_encoding const void -#endif - -struct rb_iseq_struct; /* in vm_core.h */ - -/* structs for managing terminator of string literal and heredocment */ -typedef struct rb_strterm_literal_struct { - long nest; - int func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */ - int paren; /* '(' of `%q(...)` */ - int term; /* ')' of `%q(...)` */ -} rb_strterm_literal_t; - -typedef struct rb_strterm_heredoc_struct { - rb_parser_string_t *lastline; /* the string of line that contains `<<"END"` */ - long offset; /* the column of END in `<<"END"` */ - int sourceline; /* lineno of the line that contains `<<"END"` */ - unsigned length; /* the length of END in `<<"END"` */ - uint8_t quote; - uint8_t func; -} rb_strterm_heredoc_t; - -#define HERETERM_LENGTH_MAX UINT_MAX - -typedef struct rb_strterm_struct { - bool heredoc; - union { - rb_strterm_literal_t literal; - rb_strterm_heredoc_t heredoc; - } u; -} rb_strterm_t; - -/* parse.y */ -void rb_ruby_parser_mark(void *ptr); -size_t rb_ruby_parser_memsize(const void *ptr); - -void rb_ruby_parser_set_options(rb_parser_t *p, int print, int loop, int chomp, int split); -rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main); -void rb_ruby_parser_set_script_lines(rb_parser_t *p); -void rb_ruby_parser_error_tolerant(rb_parser_t *p); -void rb_ruby_parser_keep_tokens(rb_parser_t *p); -typedef rb_parser_string_t*(rb_parser_lex_gets_func)(struct parser_params*, rb_parser_input_data, int); -rb_ast_t *rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, VALUE fname, rb_parser_input_data input, int line); - -RUBY_SYMBOL_EXPORT_BEGIN - -rb_encoding *rb_ruby_parser_encoding(rb_parser_t *p); -int rb_ruby_parser_end_seen_p(rb_parser_t *p); -int rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag); -rb_parser_string_t *rb_str_to_parser_string(rb_parser_t *p, VALUE str); -void rb_parser_string_free(rb_parser_t *p, rb_parser_string_t *str); - -int rb_parser_dvar_defined_ref(struct parser_params*, ID, ID**); -ID rb_parser_internal_id(struct parser_params*); -int rb_parser_reg_fragment_check(struct parser_params*, rb_parser_string_t*, int); -int rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len, rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc); -int rb_parser_local_defined(struct parser_params *p, ID id, const struct rb_iseq_struct *iseq); - -RUBY_SYMBOL_EXPORT_END - -#ifndef UNIVERSAL_PARSER -rb_parser_t *rb_ruby_parser_allocate(void); -rb_parser_t *rb_ruby_parser_new(void); -#endif - -#ifdef RIPPER -void ripper_parser_mark(void *ptr); -void ripper_parser_free(void *ptr); -size_t ripper_parser_memsize(const void *ptr); -void ripper_error(struct parser_params *p); -VALUE ripper_value(struct parser_params *p); -int rb_ruby_parser_get_yydebug(rb_parser_t *p); -void rb_ruby_parser_set_value(rb_parser_t *p, VALUE value); -int rb_ruby_parser_error_p(rb_parser_t *p); -VALUE rb_ruby_parser_debug_output(rb_parser_t *p); -void rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output); -VALUE rb_ruby_parser_parsing_thread(rb_parser_t *p); -void rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread); -void rb_ruby_parser_ripper_initialize(rb_parser_t *p, rb_parser_lex_gets_func *gets, rb_parser_input_data input, VALUE sourcefile_string, const char *sourcefile, int sourceline); -VALUE rb_ruby_parser_result(rb_parser_t *p); -rb_encoding *rb_ruby_parser_enc(rb_parser_t *p); -VALUE rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p); -int rb_ruby_parser_ruby_sourceline(rb_parser_t *p); -int rb_ruby_parser_lex_state(rb_parser_t *p); -void rb_ruby_ripper_parse0(rb_parser_t *p); -int rb_ruby_ripper_dedent_string(rb_parser_t *p, rb_parser_string_t *string, int width); -int rb_ruby_ripper_initialized_p(rb_parser_t *p); -void rb_ruby_ripper_parser_initialize(rb_parser_t *p); -long rb_ruby_ripper_column(rb_parser_t *p); -long rb_ruby_ripper_token_len(rb_parser_t *p); -rb_parser_string_t *rb_ruby_ripper_lex_lastline(rb_parser_t *p); -VALUE rb_ruby_ripper_lex_state_name(struct parser_params *p, int state); -#ifdef UNIVERSAL_PARSER -rb_parser_t *rb_ripper_parser_params_allocate(const rb_parser_config_t *config); -#endif -struct parser_params *rb_ruby_ripper_parser_allocate(void); -#endif - -#ifdef UNIVERSAL_PARSER -#undef rb_encoding -#endif - -#endif /* INTERNAL_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h deleted file mode 100644 index c75f15b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef INTERNAL_PROC_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PROC_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Proc. - */ -#include "ruby/ruby.h" /* for rb_block_call_func_t */ -#include "ruby/st.h" /* for st_index_t */ -struct rb_block; /* in vm_core.h */ -struct rb_iseq_struct; /* in vm_core.h */ - -/* proc.c */ -VALUE rb_proc_location(VALUE self); -st_index_t rb_hash_proc(st_index_t hash, VALUE proc); -int rb_block_pair_yield_optimizable(void); -int rb_block_arity(void); -int rb_block_min_max_arity(int *max); -VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info); -VALUE rb_callable_receiver(VALUE); - -VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val); -VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc); -VALUE rb_iseq_location(const struct rb_iseq_struct *iseq); -VALUE rb_sym_to_proc(VALUE sym); - -#endif /* INTERNAL_PROC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/process.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/process.h deleted file mode 100644 index fd4994c..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/process.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef INTERNAL_PROCESS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PROCESS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Process. - */ -#include "ruby/internal/config.h" /* for rb_pid_t */ -#include /* for size_t */ - -#ifdef HAVE_SYS_TYPES_H -# include /* for mode_t */ -#endif - -#ifdef _WIN32 -# include "ruby/win32.h" /* for mode_t */ -#endif - -#include "ruby/ruby.h" /* for VALUE */ -#include "internal/compilers.h" /* for __has_warning */ -#include "internal/imemo.h" /* for RB_IMEMO_TMPBUF_PTR */ - -#define RB_MAX_GROUPS (65536) - -struct waitpid_state; -struct rb_process_status; -struct rb_execarg { - union { - struct { - VALUE shell_script; - } sh; - struct { - VALUE command_name; - VALUE command_abspath; /* full path string or nil */ - VALUE argv_str; - VALUE argv_buf; - } cmd; - } invoke; - VALUE redirect_fds; - VALUE envp_str; - VALUE envp_buf; - VALUE dup2_tmpbuf; - unsigned use_shell : 1; - unsigned pgroup_given : 1; - unsigned umask_given : 1; - unsigned unsetenv_others_given : 1; - unsigned unsetenv_others_do : 1; - unsigned close_others_given : 1; - unsigned close_others_do : 1; - unsigned chdir_given : 1; - unsigned new_pgroup_given : 1; - unsigned new_pgroup_flag : 1; - unsigned uid_given : 1; - unsigned gid_given : 1; - unsigned exception : 1; - unsigned exception_given : 1; - struct rb_process_status *status; - struct waitpid_state *waitpid_state; /* for async process management */ - rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0 - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Random. - */ -#include /* for size_t */ - -/* random.c */ -int ruby_fill_random_bytes(void *, size_t, int); -void rb_free_default_rand_key(void); - -#endif /* INTERNAL_RANDOM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/range.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/range.h deleted file mode 100644 index 2394937..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/range.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_RANGE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Range. - */ -#include "internal/struct.h" /* for RSTRUCT */ - -/* range.c */ -static inline VALUE RANGE_BEG(VALUE r); -static inline VALUE RANGE_END(VALUE r); -static inline VALUE RANGE_EXCL(VALUE r); - -static inline VALUE -RANGE_BEG(VALUE r) -{ - return RSTRUCT(r)->as.ary[0]; -} - -static inline VALUE -RANGE_END(VALUE r) -{ - return RSTRUCT_GET(r, 1); -} - -static inline VALUE -RANGE_EXCL(VALUE r) -{ - return RSTRUCT_GET(r, 2); -} - -VALUE -rb_range_component_beg_len(VALUE b, VALUE e, int excl, - long *begp, long *lenp, long len, int err); - -#endif /* INTERNAL_RANGE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h deleted file mode 100644 index f11fab4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef INTERNAL_RATIONAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_RATIONAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Rational. - */ -#include "ruby/internal/config.h" /* for HAVE_LIBGMP */ -#include "ruby/ruby.h" /* for struct RBasic */ -#include "internal/numeric.h" /* for INT_POSITIVE_P */ -#include "ruby_assert.h" /* for assert */ - -struct RRational { - struct RBasic basic; - VALUE num; - VALUE den; -}; - -#define RRATIONAL(obj) ((struct RRational *)(obj)) - -/* rational.c */ -VALUE rb_rational_canonicalize(VALUE x); -VALUE rb_rational_uminus(VALUE self); -VALUE rb_rational_plus(VALUE self, VALUE other); -VALUE rb_rational_minus(VALUE self, VALUE other); -VALUE rb_rational_mul(VALUE self, VALUE other); -VALUE rb_rational_div(VALUE self, VALUE other); -VALUE rb_lcm(VALUE x, VALUE y); -VALUE rb_rational_reciprocal(VALUE x); -VALUE rb_cstr_to_rat(const char *, int); -VALUE rb_rational_hash(VALUE self); -VALUE rb_rational_abs(VALUE self); -VALUE rb_rational_cmp(VALUE self, VALUE other); -VALUE rb_rational_pow(VALUE self, VALUE other); -VALUE rb_rational_floor(VALUE self, int ndigits); -VALUE rb_numeric_quo(VALUE x, VALUE y); -VALUE rb_flo_round_by_rational(int argc, VALUE *argv, VALUE num); -VALUE rb_float_numerator(VALUE x); -VALUE rb_float_denominator(VALUE x); - -static inline void RATIONAL_SET_NUM(VALUE r, VALUE n); -static inline void RATIONAL_SET_DEN(VALUE r, VALUE d); - -RUBY_SYMBOL_EXPORT_BEGIN -/* rational.c (export) */ -VALUE rb_gcd(VALUE x, VALUE y); -VALUE rb_gcd_normal(VALUE self, VALUE other); -#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) -VALUE rb_gcd_gmp(VALUE x, VALUE y); -#endif -RUBY_SYMBOL_EXPORT_END - -static inline void -RATIONAL_SET_NUM(VALUE r, VALUE n) -{ - assert(RB_INTEGER_TYPE_P(n)); - RB_OBJ_WRITE(r, &RRATIONAL(r)->num, n); -} - -static inline void -RATIONAL_SET_DEN(VALUE r, VALUE d) -{ - assert(RB_INTEGER_TYPE_P(d)); - assert(INT_POSITIVE_P(d)); - RB_OBJ_WRITE(r, &RRATIONAL(r)->den, d); -} - -#endif /* INTERNAL_RATIONAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/re.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/re.h deleted file mode 100644 index 3e20114..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/re.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef INTERNAL_RE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_RE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Regexp. - */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for VALUE */ - -/* re.c */ -VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline); -VALUE rb_reg_check_preprocess(VALUE); -long rb_reg_search0(VALUE, VALUE, long, int, int); -VALUE rb_reg_match_p(VALUE re, VALUE str, long pos); -bool rb_reg_start_with_p(VALUE re, VALUE str); -VALUE rb_reg_hash(VALUE re); -VALUE rb_reg_equal(VALUE re1, VALUE re2); -void rb_backref_set_string(VALUE string, long pos, long len); -void rb_match_unbusy(VALUE); -int rb_match_count(VALUE match); -VALUE rb_reg_new_ary(VALUE ary, int options); -VALUE rb_reg_last_defined(VALUE match); - -#endif /* INTERNAL_RE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h deleted file mode 100644 index 8e306d1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef INTERNAL_RUBY_PARSE_H -#define INTERNAL_RUBY_PARSE_H - -#include "internal.h" -#include "internal/bignum.h" -#include "internal/compilers.h" -#include "internal/complex.h" -#include "internal/parse.h" -#include "internal/rational.h" -#include "rubyparser.h" -#include "vm.h" - -struct lex_pointer_string { - VALUE str; - long ptr; -}; - -RUBY_SYMBOL_EXPORT_BEGIN -#ifdef UNIVERSAL_PARSER -const rb_parser_config_t *rb_ruby_parser_config(void); -rb_parser_t *rb_parser_params_new(void); -#endif -VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int); -VALUE rb_parser_new(void); -VALUE rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line); -VALUE rb_str_new_parser_string(rb_parser_string_t *str); -VALUE rb_str_new_mutable_parser_string(rb_parser_string_t *str); -rb_parser_string_t *rb_parser_lex_get_str(struct parser_params *p, struct lex_pointer_string *ptr_str); - -VALUE rb_node_str_string_val(const NODE *); -VALUE rb_node_sym_string_val(const NODE *); -VALUE rb_node_dstr_string_val(const NODE *); -VALUE rb_node_regx_string_val(const NODE *); -VALUE rb_node_dregx_string_val(const NODE *); -VALUE rb_node_line_lineno_val(const NODE *); -VALUE rb_node_file_path_val(const NODE *); -VALUE rb_node_encoding_val(const NODE *); - -VALUE rb_node_integer_literal_val(const NODE *); -VALUE rb_node_float_literal_val(const NODE *); -VALUE rb_node_rational_literal_val(const NODE *); -VALUE rb_node_imaginary_literal_val(const NODE *); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_parser_end_seen_p(VALUE); -VALUE rb_parser_encoding(VALUE); -VALUE rb_parser_set_yydebug(VALUE, VALUE); -VALUE rb_parser_build_script_lines_from(rb_parser_ary_t *script_lines); -void rb_parser_set_options(VALUE, int, int, int, int); -VALUE rb_parser_load_file(VALUE parser, VALUE name); -void rb_parser_set_script_lines(VALUE vparser); -void rb_parser_error_tolerant(VALUE vparser); -void rb_parser_keep_tokens(VALUE vparser); - -VALUE rb_parser_compile_string(VALUE, const char*, VALUE, int); -VALUE rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line); -VALUE rb_parser_compile_generic(VALUE vparser, rb_parser_lex_gets_func *lex_gets, VALUE fname, VALUE input, int line); -VALUE rb_parser_compile_array(VALUE vparser, VALUE fname, VALUE array, int start); - -enum lex_state_bits { - EXPR_BEG_bit, /* ignore newline, +/- is a sign. */ - EXPR_END_bit, /* newline significant, +/- is an operator. */ - EXPR_ENDARG_bit, /* ditto, and unbound braces. */ - EXPR_ENDFN_bit, /* ditto, and unbound braces. */ - EXPR_ARG_bit, /* newline significant, +/- is an operator. */ - EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */ - EXPR_MID_bit, /* newline significant, +/- is an operator. */ - EXPR_FNAME_bit, /* ignore newline, no reserved words. */ - EXPR_DOT_bit, /* right after `.', `&.' or `::', no reserved words. */ - EXPR_CLASS_bit, /* immediate after `class', no here document. */ - EXPR_LABEL_bit, /* flag bit, label is allowed. */ - EXPR_LABELED_bit, /* flag bit, just after a label. */ - EXPR_FITEM_bit, /* symbol literal as FNAME. */ - EXPR_MAX_STATE -}; -/* examine combinations */ -enum lex_state_e { -#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit) - DEF_EXPR(BEG), - DEF_EXPR(END), - DEF_EXPR(ENDARG), - DEF_EXPR(ENDFN), - DEF_EXPR(ARG), - DEF_EXPR(CMDARG), - DEF_EXPR(MID), - DEF_EXPR(FNAME), - DEF_EXPR(DOT), - DEF_EXPR(CLASS), - DEF_EXPR(LABEL), - DEF_EXPR(LABELED), - DEF_EXPR(FITEM), - EXPR_VALUE = EXPR_BEG, - EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS), - EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG), - EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN), - EXPR_NONE = 0 -}; - -VALUE rb_ruby_ast_new(const NODE *const root); -rb_ast_t *rb_ruby_ast_data_get(VALUE ast_value); - -#endif /* INTERNAL_RUBY_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h deleted file mode 100644 index 94f4e41..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h +++ /dev/null @@ -1,326 +0,0 @@ -#ifndef INTERNAL_SANITIZERS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SANITIZERS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for ASAN / MSAN / etc. - */ -#include "ruby/internal/config.h" -#include "internal/compilers.h" /* for __has_feature */ - -#ifdef HAVE_VALGRIND_MEMCHECK_H -# include -#endif - -#ifdef HAVE_SANITIZER_ASAN_INTERFACE_H -# if __has_feature(address_sanitizer) -# define RUBY_ASAN_ENABLED -# include -# endif -#endif - -#ifdef HAVE_SANITIZER_MSAN_INTERFACE_H -# if __has_feature(memory_sanitizer) -# define RUBY_MSAN_ENABLED -# include -# endif -#endif - -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for VALUE */ - -#if 0 -#elif defined(RUBY_ASAN_ENABLED) && defined(RUBY_MSAN_ENABLED) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - __attribute__((__no_sanitize__("memory, address"), __noinline__)) x -#elif defined(RUBY_ASAN_ENABLED) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - __attribute__((__no_sanitize__("address"), __noinline__)) x -#elif defined(NO_SANITIZE_ADDRESS) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - NO_SANITIZE_ADDRESS(NOINLINE(x)) -#elif defined(NO_ADDRESS_SAFETY_ANALYSIS) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \ - NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x)) -#else -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x -#endif - -#if defined(NO_SANITIZE) && RBIMPL_COMPILER_IS(GCC) -/* GCC warns about unknown sanitizer, which is annoying. */ -# include "internal/warnings.h" -# undef NO_SANITIZE -# define NO_SANITIZE(x, y) \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Wattributes); \ - __attribute__((__no_sanitize__(x))) y; \ - COMPILER_WARNING_POP -#endif - -#ifndef NO_SANITIZE -# define NO_SANITIZE(x, y) y -#endif - -#ifndef RUBY_ASAN_ENABLED -# define __asan_poison_memory_region(x, y) -# define __asan_unpoison_memory_region(x, y) -# define __asan_region_is_poisoned(x, y) 0 -# define __asan_get_current_fake_stack() NULL -# define __asan_addr_is_in_fake_stack(fake_stack, slot, start, end) NULL -#endif - -#ifndef RUBY_MSAN_ENABLED -# define __msan_allocated_memory(x, y) ((void)(x), (void)(y)) -# define __msan_poison(x, y) ((void)(x), (void)(y)) -# define __msan_unpoison(x, y) ((void)(x), (void)(y)) -# define __msan_unpoison_string(x) ((void)(x)) -#endif - -#ifdef VALGRIND_MAKE_READABLE -# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n)) -#endif - -#ifdef VALGRIND_MAKE_WRITABLE -# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n)) -#endif - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0 -#endif - -#ifndef VALGRIND_MAKE_MEM_UNDEFINED -# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0 -#endif - -/** - * This function asserts that a (continuous) memory region from ptr to size - * being "poisoned". Both read / write access to such memory region are - * prohibited until properly unpoisoned. The region must be previously - * allocated (do not pass a freed pointer here), but not necessarily be an - * entire object that the malloc returns. You can punch hole a part of a - * gigantic heap arena. This is handy when you do not free an allocated memory - * region to reuse later: poison when you keep it unused, and unpoison when you - * reuse. - * - * @param[in] ptr pointer to the beginning of the memory region to poison. - * @param[in] size the length of the memory region to poison. - */ -static inline void -asan_poison_memory_region(const volatile void *ptr, size_t size) -{ - __msan_poison(ptr, size); - __asan_poison_memory_region(ptr, size); -} - -/** - * This is a variant of asan_poison_memory_region that takes a VALUE. - * - * @param[in] obj target object. - */ -static inline void -asan_poison_object(VALUE obj) -{ - MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj; - asan_poison_memory_region(ptr, SIZEOF_VALUE); -} - -#ifdef RUBY_ASAN_ENABLED -#define asan_poison_object_if(ptr, obj) do { \ - if (ptr) asan_poison_object(obj); \ - } while (0) -#else -#define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj)) -#endif - -/** - * This function predicates if the given object is fully addressable or not. - * - * @param[in] obj target object. - * @retval 0 the given object is fully addressable. - * @retval otherwise pointer to first such byte who is poisoned. - */ -static inline void * -asan_poisoned_object_p(VALUE obj) -{ - MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj; - return __asan_region_is_poisoned(ptr, SIZEOF_VALUE); -} - -/** - * This function asserts that a (formally poisoned) memory region from ptr to - * size is now addressable. Write access to such memory region gets allowed. - * However read access might or might not be possible depending on situations, - * because the region can have contents of previous usages. That information - * should be passed by the malloc_p flag. If that is true, the contents of the - * region is _not_ fully defined (like the return value of malloc behaves). - * Reading from there is NG; write something first. If malloc_p is false on - * the other hand, that memory region is fully defined and can be read - * immediately. - * - * @param[in] ptr pointer to the beginning of the memory region to unpoison. - * @param[in] size the length of the memory region. - * @param[in] malloc_p if the memory region is like a malloc's return value or not. - */ -static inline void -asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p) -{ - __asan_unpoison_memory_region(ptr, size); - if (malloc_p) { - __msan_allocated_memory(ptr, size); - } - else { - __msan_unpoison(ptr, size); - } -} - -/** - * This is a variant of asan_unpoison_memory_region that takes a VALUE. - * - * @param[in] obj target object. - * @param[in] malloc_p if the memory region is like a malloc's return value or not. - */ -static inline void -asan_unpoison_object(VALUE obj, bool newobj_p) -{ - MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj; - asan_unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p); -} - -static inline void * -asan_unpoison_object_temporary(VALUE obj) -{ - void *ptr = asan_poisoned_object_p(obj); - asan_unpoison_object(obj, false); - return ptr; -} - -static inline void * -asan_poison_object_restore(VALUE obj, void *ptr) -{ - if (ptr) { - asan_poison_object(obj); - } - return NULL; -} - -#define asan_unpoisoning_object(obj) \ - for (void *poisoned = asan_unpoison_object_temporary(obj), \ - *unpoisoning = &poisoned; /* flag to loop just once */ \ - unpoisoning; \ - unpoisoning = asan_poison_object_restore(obj, poisoned)) - - -static inline void * -asan_unpoison_memory_region_temporary(void *ptr, size_t len) -{ - void *poisoned_ptr = __asan_region_is_poisoned(ptr, len); - asan_unpoison_memory_region(ptr, len, false); - return poisoned_ptr; -} - -static inline void * -asan_poison_memory_region_restore(void *ptr, size_t len, void *poisoned_ptr) -{ - if (poisoned_ptr) { - asan_poison_memory_region(ptr, len); - } - return NULL; -} - -#define asan_unpoisoning_memory_region(ptr, len) \ - for (void *poisoned = asan_unpoison_memory_region_temporary(ptr, len), \ - *unpoisoning = &poisoned; /* flag to loop just once */ \ - unpoisoning; \ - unpoisoning = asan_poison_memory_region_restore(ptr, len, poisoned)) - -/** - * Checks if the given pointer is on an ASAN fake stack. If so, it returns the - * address this variable has on the real frame; if not, it returns the origin - * address unmodified. - * - * n.b. - _dereferencing_ the returned address is meaningless and should not - * be done; even though ASAN reserves space for the variable in both the real and - * fake stacks, the _value_ of that variable is only in the fake stack. - * - * n.b. - this only works for addresses passed in from local variables on the same - * thread, because the ASAN fake stacks are threadlocal. - * - * @param[in] slot the address of some local variable - * @retval a pointer to something from that frame on the _real_ machine stack - */ -static inline void * -asan_get_real_stack_addr(void* slot) -{ - VALUE *addr; - addr = __asan_addr_is_in_fake_stack(__asan_get_current_fake_stack(), slot, NULL, NULL); - return addr ? addr : slot; -} - -/** - * Gets the current thread's fake stack handle, which can be passed into get_fake_stack_extents - * - * @retval An opaque value which can be passed to asan_get_fake_stack_extents - */ -static inline void * -asan_get_thread_fake_stack_handle(void) -{ - return __asan_get_current_fake_stack(); -} - -/** - * Checks if the given VALUE _actually_ represents a pointer to an ASAN fake stack. - * - * If the given slot _is_ actually a reference to an ASAN fake stack, and that fake stack - * contains the real values for the passed-in range of machine stack addresses, returns true - * and the range of the fake stack through the outparams. - * - * Otherwise, returns false, and sets the outparams to NULL. - * - * Note that this function expects "start" to be > "end" on downward-growing stack architectures; - * - * @param[in] thread_fake_stack_handle The asan fake stack reference for the thread we're scanning - * @param[in] slot The value on the machine stack we want to inspect - * @param[in] machine_stack_start The extents of the real machine stack on which slot lives - * @param[in] machine_stack_end The extents of the real machine stack on which slot lives - * @param[out] fake_stack_start_out The extents of the fake stack which contains real VALUEs - * @param[out] fake_stack_end_out The extents of the fake stack which contains real VALUEs - * @return Whether slot is a pointer to a fake stack for the given machine stack range -*/ - -static inline bool -asan_get_fake_stack_extents(void *thread_fake_stack_handle, VALUE slot, - void *machine_stack_start, void *machine_stack_end, - void **fake_stack_start_out, void **fake_stack_end_out) -{ - /* the ifdef is needed here to suppress a warning about fake_frame_{start/end} being - uninitialized if __asan_addr_is_in_fake_stack is an empty macro */ -#ifdef RUBY_ASAN_ENABLED - void *fake_frame_start; - void *fake_frame_end; - void *real_stack_frame = __asan_addr_is_in_fake_stack( - thread_fake_stack_handle, (void *)slot, &fake_frame_start, &fake_frame_end - ); - if (real_stack_frame) { - bool in_range; -#if STACK_GROW_DIRECTION < 0 - in_range = machine_stack_start >= real_stack_frame && real_stack_frame >= machine_stack_end; -#else - in_range = machine_stack_start <= real_stack_frame && real_stack_frame <= machine_stack_end; -#endif - if (in_range) { - *fake_stack_start_out = fake_frame_start; - *fake_stack_end_out = fake_frame_end; - return true; - } - } -#endif - *fake_stack_start_out = 0; - *fake_stack_end_out = 0; - return false; -} - - -#endif /* INTERNAL_SANITIZERS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h deleted file mode 100644 index df9e9a4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERNAL_SERIAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SERIAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for rb_serial_t. - */ -#include "ruby/internal/config.h" /* for HAVE_LONG_LONG */ -#include "ruby/defines.h" /* for LONG_LONG */ - -#ifndef HAVE_LONG_LONG -# error need C99+ -#endif - -typedef unsigned LONG_LONG rb_serial_t; -#define SERIALT2NUM ULL2NUM -#define PRI_SERIALT_PREFIX PRI_LL_PREFIX -#define SIZEOF_SERIAL_T SIZEOF_LONG_LONG - -#endif /* INTERNAL_SERIAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h deleted file mode 100644 index 2363bf4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef INTERNAL_SIGNAL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SIGNAL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for SignalException. - */ - -/* signal.c */ -extern int ruby_enable_coredump; -int rb_get_next_signal(void); - -#ifdef POSIX_SIGNAL -void (*ruby_posix_signal(int, void (*)(int)))(int); -#endif - -RUBY_SYMBOL_EXPORT_BEGIN -/* signal.c (export) */ -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_SIGNAL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/st.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/st.h deleted file mode 100644 index a26b224..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/st.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef INTERNAL_ST_H -#define INTERNAL_ST_H - -#include "include/ruby/st.h" - -st_table *rb_st_replace(st_table *new_tab, st_table *old_tab); -#define st_replace rb_st_replace -st_table *rb_st_init_existing_table_with_size(st_table *tab, const struct st_hash_type *type, st_index_t size); -#define st_init_existing_table_with_size rb_st_init_existing_table_with_size - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h deleted file mode 100644 index 70dd0b7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_STATIC_ASSERT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_STATIC_ASSERT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief C11 shim for _Static_assert. - */ -#include "ruby/internal/static_assert.h" -#ifndef STATIC_ASSERT -# define STATIC_ASSERT RBIMPL_STATIC_ASSERT -#endif - -#endif /* INTERNAL_STATIC_ASSERT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/string.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/string.h deleted file mode 100644 index 10879bd..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/string.h +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef INTERNAL_STRING_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_STRING_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for String. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "internal/compilers.h" /* for __has_builtin */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/encoding.h" /* for rb_encoding */ -#include "ruby/ruby.h" /* for VALUE */ - -#define STR_NOEMBED FL_USER1 -#define STR_SHARED FL_USER2 /* = ELTS_SHARED */ -#define STR_CHILLED FL_USER3 - -enum ruby_rstring_private_flags { - RSTRING_CHILLED = STR_CHILLED, -}; - -#ifdef rb_fstring_cstr -# undef rb_fstring_cstr -#endif - -/* string.c */ -VALUE rb_fstring(VALUE); -VALUE rb_fstring_cstr(const char *str); -VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc); -int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p); -int rb_str_symname_p(VALUE); -VALUE rb_str_quote_unprintable(VALUE); -char *rb_str_fill_terminator(VALUE str, const int termlen); -void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen); -VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg); -VALUE rb_str_chomp_string(VALUE str, VALUE chomp); -VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc); -VALUE rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len, - rb_encoding *from, int ecflags, VALUE ecopts); -VALUE rb_enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl); -VALUE rb_str_escape(VALUE str); -size_t rb_str_memsize(VALUE); -char *rb_str_to_cstr(VALUE str); -const char *ruby_escaped_char(int c); -void rb_str_make_independent(VALUE str); -int rb_enc_str_coderange_scan(VALUE str, rb_encoding *enc); -int rb_ascii8bit_appendable_encoding_index(rb_encoding *enc, unsigned int code); -VALUE rb_str_include(VALUE str, VALUE arg); -VALUE rb_str_byte_substr(VALUE str, VALUE beg, VALUE len); -VALUE rb_str_tmp_frozen_no_embed_acquire(VALUE str); -void rb_str_make_embedded(VALUE); -VALUE rb_str_upto_each(VALUE, VALUE, int, int (*each)(VALUE, VALUE), VALUE); -size_t rb_str_size_as_embedded(VALUE); -bool rb_str_reembeddable_p(VALUE); -VALUE rb_str_upto_endless_each(VALUE, int (*each)(VALUE, VALUE), VALUE); - -static inline bool STR_EMBED_P(VALUE str); -static inline bool STR_SHARED_P(VALUE str); -static inline VALUE QUOTE(VALUE v); -static inline VALUE QUOTE_ID(ID v); -static inline bool is_ascii_string(VALUE str); -static inline bool is_broken_string(VALUE str); -static inline VALUE rb_str_eql_internal(const VALUE str1, const VALUE str2); - -RUBY_SYMBOL_EXPORT_BEGIN -/* string.c (export) */ -VALUE rb_str_tmp_frozen_acquire(VALUE str); -void rb_str_tmp_frozen_release(VALUE str, VALUE tmp); -VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_fstring_new(const char *ptr, long len); -VALUE rb_obj_as_string_result(VALUE str, VALUE obj); -VALUE rb_str_opt_plus(VALUE x, VALUE y); -VALUE rb_str_concat_literals(size_t num, const VALUE *strary); -VALUE rb_str_eql(VALUE str1, VALUE str2); -VALUE rb_id_quote_unprintable(ID); -VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc); -VALUE rb_enc_literal_str(const char *ptr, long len, rb_encoding *enc); - -struct rb_execution_context_struct; -VALUE rb_ec_str_resurrect(struct rb_execution_context_struct *ec, VALUE str, bool chilled); - -#define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str)) -#define rb_fstring_literal(str) rb_fstring_lit(str) -#define rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc)) -#define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc) - -static inline VALUE -QUOTE(VALUE v) -{ - return rb_str_quote_unprintable(v); -} - -static inline VALUE -QUOTE_ID(ID i) -{ - return rb_id_quote_unprintable(i); -} - -static inline bool -STR_EMBED_P(VALUE str) -{ - return ! FL_TEST_RAW(str, STR_NOEMBED); -} - -static inline bool -STR_SHARED_P(VALUE str) -{ - return FL_ALL_RAW(str, STR_NOEMBED | STR_SHARED); -} - -static inline bool -CHILLED_STRING_P(VALUE obj) -{ - return RB_TYPE_P(obj, T_STRING) && FL_TEST_RAW(obj, STR_CHILLED); -} - -static inline void -CHILLED_STRING_MUTATED(VALUE str) -{ - FL_UNSET_RAW(str, STR_CHILLED); - rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "literal string will be frozen in the future"); -} - -static inline void -STR_CHILL_RAW(VALUE str) -{ - FL_SET_RAW(str, STR_CHILLED); -} - -static inline bool -is_ascii_string(VALUE str) -{ - return rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT; -} - -static inline bool -is_broken_string(VALUE str) -{ - return rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN; -} - -static inline bool -at_char_boundary(const char *s, const char *p, const char *e, rb_encoding *enc) -{ - return rb_enc_left_char_head(s, p, e, enc) == p; -} - -static inline bool -at_char_right_boundary(const char *s, const char *p, const char *e, rb_encoding *enc) -{ - RUBY_ASSERT(s <= p); - RUBY_ASSERT(p <= e); - - return rb_enc_right_char_head(s, p, e, enc) == p; -} - -/* expect tail call optimization */ -// YJIT needs this function to never allocate and never raise -static inline VALUE -rb_str_eql_internal(const VALUE str1, const VALUE str2) -{ - const long len = RSTRING_LEN(str1); - const char *ptr1, *ptr2; - - if (len != RSTRING_LEN(str2)) return Qfalse; - if (!rb_str_comparable(str1, str2)) return Qfalse; - if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2))) - return Qtrue; - if (memcmp(ptr1, ptr2, len) == 0) - return Qtrue; - return Qfalse; -} - -#if __has_builtin(__builtin_constant_p) -# define rb_fstring_cstr(str) \ - (__builtin_constant_p(str) ? \ - rb_fstring_new((str), (long)strlen(str)) : \ - (rb_fstring_cstr)(str)) -#endif -#endif /* INTERNAL_STRING_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h deleted file mode 100644 index 6da5bad..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef INTERNAL_STRUCT_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_STRUCT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Struct. - */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for struct RBasic */ - -enum { - RSTRUCT_EMBED_LEN_MASK = RUBY_FL_USER7 | RUBY_FL_USER6 | RUBY_FL_USER5 | RUBY_FL_USER4 | - RUBY_FL_USER3 | RUBY_FL_USER2 | RUBY_FL_USER1, - RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1), -}; - -struct RStruct { - struct RBasic basic; - union { - struct { - long len; - const VALUE *ptr; - } heap; - /* This is a length 1 array because: - * 1. GCC has a bug that does not optimize C flexible array members - * (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102452) - * 2. Zero length arrays are not supported by all compilers - */ - const VALUE ary[1]; - } as; -}; - -#define RSTRUCT(obj) ((struct RStruct *)(obj)) - -#ifdef RSTRUCT_LEN -# undef RSTRUCT_LEN -#endif - -#ifdef RSTRUCT_PTR -# undef RSTRUCT_PTR -#endif - -#ifdef RSTRUCT_SET -# undef RSTRUCT_SET -#endif - -#ifdef RSTRUCT_GET -# undef RSTRUCT_GET -#endif - -#define RSTRUCT_LEN internal_RSTRUCT_LEN -#define RSTRUCT_SET internal_RSTRUCT_SET -#define RSTRUCT_GET internal_RSTRUCT_GET - -/* struct.c */ -VALUE rb_struct_init_copy(VALUE copy, VALUE s); -VALUE rb_struct_lookup(VALUE s, VALUE idx); -VALUE rb_struct_s_keyword_init(VALUE klass); -static inline const VALUE *rb_struct_const_heap_ptr(VALUE st); -static inline long RSTRUCT_EMBED_LEN(VALUE st); -static inline long RSTRUCT_LEN(VALUE st); -static inline int RSTRUCT_LENINT(VALUE st); -static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st); -static inline void RSTRUCT_SET(VALUE st, long k, VALUE v); -static inline VALUE RSTRUCT_GET(VALUE st, long k); - -static inline long -RSTRUCT_EMBED_LEN(VALUE st) -{ - long ret = FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK); - ret >>= RSTRUCT_EMBED_LEN_SHIFT; - return ret; -} - -static inline long -RSTRUCT_LEN(VALUE st) -{ - if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) { - return RSTRUCT_EMBED_LEN(st); - } - else { - return RSTRUCT(st)->as.heap.len; - } -} - -static inline int -RSTRUCT_LENINT(VALUE st) -{ - return rb_long2int(RSTRUCT_LEN(st)); -} - -static inline const VALUE * -RSTRUCT_CONST_PTR(VALUE st) -{ - const struct RStruct *p = RSTRUCT(st); - - if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) { - return p->as.ary; - } - else { - return p->as.heap.ptr; - } -} - -static inline void -RSTRUCT_SET(VALUE st, long k, VALUE v) -{ - RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[k], v); -} - -static inline VALUE -RSTRUCT_GET(VALUE st, long k) -{ - return RSTRUCT_CONST_PTR(st)[k]; -} - -static inline const VALUE * -rb_struct_const_heap_ptr(VALUE st) -{ - assert(!FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)); - return RSTRUCT(st)->as.heap.ptr; -} - -#endif /* INTERNAL_STRUCT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h deleted file mode 100644 index e7730cb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef INTERNAL_SYMBOL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_SYMBOL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Symbol. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/encoding.h" /* for rb_encoding */ -#include "internal/compilers.h" /* for __has_builtin */ - -#ifdef rb_sym_intern_ascii_cstr -# undef rb_sym_intern_ascii_cstr -#endif - -/* symbol.c */ -VALUE rb_to_symbol_type(VALUE obj); -VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc); -VALUE rb_sym_intern_ascii(const char *ptr, long len); -VALUE rb_sym_intern_ascii_cstr(const char *ptr); -int rb_is_const_name(VALUE name); -int rb_is_class_name(VALUE name); -int rb_is_instance_name(VALUE name); -int rb_is_local_name(VALUE name); -PUREFUNC(int rb_is_const_sym(VALUE sym)); -PUREFUNC(int rb_is_attrset_sym(VALUE sym)); -ID rb_make_internal_id(void); -ID rb_make_temporary_id(size_t n); -void rb_gc_free_dsymbol(VALUE); -int rb_static_id_valid_p(ID id); - -/* vm.c */ -void rb_free_static_symid_str(void); - -#if __has_builtin(__builtin_constant_p) -#define rb_sym_intern_ascii_cstr(ptr) \ - (__builtin_constant_p(ptr) ? \ - rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \ - rb_sym_intern_ascii_cstr(ptr)) -#endif - -#endif /* INTERNAL_SYMBOL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h deleted file mode 100644 index e079ebb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_THREAD_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Thread. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/intern.h" /* for rb_blocking_function_t */ -#include "ccan/list/list.h" /* for list in rb_io_close_wait_list */ - -struct rb_thread_struct; /* in vm_core.h */ - -#define RB_VM_SAVE_MACHINE_CONTEXT(th) \ - do { \ - FLUSH_REGISTER_WINDOWS; \ - setjmp((th)->ec->machine.regs); \ - SET_MACHINE_STACK_END(&(th)->ec->machine.stack_end); \ - } while (0) - -/* thread.c */ -#define COVERAGE_INDEX_LINES 0 -#define COVERAGE_INDEX_BRANCHES 1 -#define COVERAGE_TARGET_LINES 1 -#define COVERAGE_TARGET_BRANCHES 2 -#define COVERAGE_TARGET_METHODS 4 -#define COVERAGE_TARGET_ONESHOT_LINES 8 -#define COVERAGE_TARGET_EVAL 16 - -#define RUBY_FATAL_THREAD_KILLED INT2FIX(0) -#define RUBY_FATAL_THREAD_TERMINATED INT2FIX(1) -#define RUBY_FATAL_FIBER_KILLED RB_INT2FIX(2) - -VALUE rb_obj_is_mutex(VALUE obj); -VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg); -void rb_thread_execute_interrupts(VALUE th); -VALUE rb_get_coverages(void); -int rb_get_coverage_mode(void); -VALUE rb_default_coverage(int); -VALUE rb_thread_shield_new(void); -bool rb_thread_shield_owned(VALUE self); -VALUE rb_thread_shield_wait(VALUE self); -VALUE rb_thread_shield_release(VALUE self); -VALUE rb_thread_shield_destroy(VALUE self); -int rb_thread_to_be_killed(VALUE thread); -void rb_thread_acquire_fork_lock(void); -void rb_thread_release_fork_lock(void); -void rb_thread_reset_fork_lock(void); -void rb_mutex_allow_trap(VALUE self, int val); -VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data); -VALUE rb_mutex_owned_p(VALUE self); -VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid); -void ruby_mn_threads_params(void); - -int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout); - -struct rb_io_close_wait_list { - struct ccan_list_head pending_fd_users; - VALUE closing_thread; - VALUE closing_fiber; - VALUE wakeup_mutex; -}; -int rb_notify_fd_close(int fd, struct rb_io_close_wait_list *busy); -void rb_notify_fd_close_wait(struct rb_io_close_wait_list *busy); - -RUBY_SYMBOL_EXPORT_BEGIN - -void *rb_thread_prevent_fork(void *(*func)(void *), void *data); /* for ext/socket/raddrinfo.c */ - -/* Temporary. This API will be removed (renamed). */ -VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd); -VALUE rb_thread_io_blocking_call(rb_blocking_function_t *func, void *data1, int fd, int events); - -/* thread.c (export) */ -int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */ - -RUBY_SYMBOL_EXPORT_END - -int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing); -bool rb_thread_mn_schedulable(VALUE thread); - -#endif /* INTERNAL_THREAD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/time.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/time.h deleted file mode 100644 index a3bf058..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/time.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef INTERNAL_TIME_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_TIME_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Time. - */ -#include "ruby/internal/config.h" /* for SIGNEDNESS_OF_TIME_T */ -#include "internal/bits.h" /* for SIGNED_INTEGER_MAX */ -#include "ruby/ruby.h" /* for VALUE */ - -#if SIGNEDNESS_OF_TIME_T < 0 /* signed */ -# define TIMET_MAX SIGNED_INTEGER_MAX(time_t) -# define TIMET_MIN SIGNED_INTEGER_MIN(time_t) -#elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */ -# define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t) -# define TIMET_MIN ((time_t)0) -#endif - -struct timeval; /* <- in or */ - -/* time.c */ -struct timeval rb_time_timeval(VALUE); - -RUBY_SYMBOL_EXPORT_BEGIN -/* time.c (export) */ -void ruby_reset_leap_second_info(void); -void ruby_reset_timezone(void); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_TIME_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h deleted file mode 100644 index ce4f234..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTERNAL_TRANSCODE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_TRANSCODE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for Encoding::Converter. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/encoding.h" /* for rb_econv_t */ - -/* transcode.c */ -extern VALUE rb_cEncodingConverter; -size_t rb_econv_memsize(rb_econv_t *); - -/* vm.c */ -void rb_free_transcoder_table(void); - -#endif /* INTERNAL_TRANSCODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/util.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/util.h deleted file mode 100644 index 6eadbb9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/util.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef INTERNAL_UTIL_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_UTIL_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header corresponding util.c. - * @warning DO NOT ADD RANDOM GARBAGE HERE THIS FILE IS FOR util.c - */ -#include "ruby/internal/config.h" -#include /* for size_t */ - -#ifdef HAVE_SYS_TYPES_H -# include /* for ssize_t (note: on Windows ssize_t is */ -#endif /* `#define`d in ruby/config.h) */ - -/* util.c */ -char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve); -char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve); - -RUBY_SYMBOL_EXPORT_BEGIN -/* util.c (export) */ -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_UTIL_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h deleted file mode 100644 index b2a30c7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef INTERNAL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_VARIABLE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for variables. - */ -#include "ruby/internal/config.h" -#include /* for size_t */ -#include "constant.h" /* for rb_const_entry_t */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "ruby/ruby.h" /* for VALUE */ -#include "shape.h" /* for rb_shape_t */ - -/* variable.c */ -void rb_gc_mark_global_tbl(void); -void rb_gc_update_global_tbl(void); -size_t rb_generic_ivar_memsize(VALUE); -VALUE rb_search_class_path(VALUE); -VALUE rb_attr_delete(VALUE, ID); -void rb_autoload_str(VALUE mod, ID id, VALUE file); -VALUE rb_autoload_at_p(VALUE, ID, int); -NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE)); -rb_gvar_getter_t *rb_gvar_getter_function_of(ID); -rb_gvar_setter_t *rb_gvar_setter_function_of(ID); -void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_); -void rb_gvar_ractor_local(const char *name); - -/** - * Sets the name of a module. - * - * Non-permanently named classes can have a temporary name assigned (or - * cleared). In that case the name will be used for `#inspect` and `#to_s`, and - * nested classes/modules will be named with the temporary name as a prefix. - * - * After the module is assigned to a constant, the temporary name will be - * discarded, and the name will be computed based on the nesting. - * - * @param[in] mod An instance of ::rb_cModule. - * @param[in] name An instance of ::rb_cString. - * @retval mod - */ -VALUE rb_mod_set_temporary_name(VALUE, VALUE); - -struct gen_ivtbl; -int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl); -void rb_obj_copy_ivs_to_hash_table(VALUE obj, st_table *table); -void rb_obj_convert_to_too_complex(VALUE obj, st_table *table); -void rb_evict_ivars_to_hash(VALUE obj); - -RUBY_SYMBOL_EXPORT_BEGIN -/* variable.c (export) */ -void rb_mark_generic_ivar(VALUE obj); -void rb_ref_update_generic_ivar(VALUE); -void rb_mv_generic_ivar(VALUE src, VALUE dst); -VALUE rb_const_missing(VALUE klass, VALUE name); -int rb_class_ivar_set(VALUE klass, ID vid, VALUE value); -void rb_iv_tbl_copy(VALUE dst, VALUE src); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef); -VALUE rb_gvar_get(ID); -VALUE rb_gvar_set(ID, VALUE); -VALUE rb_gvar_defined(ID); -void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID); -void rb_ensure_iv_list_size(VALUE obj, uint32_t len, uint32_t newsize); -attr_index_t rb_obj_ivar_set(VALUE obj, ID id, VALUE val); - -#endif /* INTERNAL_VARIABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h deleted file mode 100644 index 3807421..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef INTERNAL_VM_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_VM_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for RubyVM. - */ -#include "ruby/internal/stdbool.h" /* for bool */ -#include "internal/serial.h" /* for rb_serial_t */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ -#include "ruby/ruby.h" /* for ID */ -#include "ruby/st.h" /* for st_table */ - -#ifdef rb_funcallv -# undef rb_funcallv -#endif - -#ifdef rb_method_basic_definition_p -# undef rb_method_basic_definition_p -#endif - -struct rb_callable_method_entry_struct; /* in method.h */ -struct rb_method_definition_struct; /* in method.h */ -struct rb_execution_context_struct; /* in vm_core.h */ -struct rb_control_frame_struct; /* in vm_core.h */ -struct rb_callinfo; /* in vm_core.h */ - -enum method_missing_reason { - MISSING_NOENTRY = 0x00, - MISSING_PRIVATE = 0x01, - MISSING_PROTECTED = 0x02, - MISSING_FCALL = 0x04, - MISSING_VCALL = 0x08, - MISSING_SUPER = 0x10, - MISSING_MISSING = 0x20, - MISSING_NONE = 0x40 -}; - -/* vm_insnhelper.h */ -VALUE rb_vm_push_frame_fname(struct rb_execution_context_struct *ec, VALUE fname); - -/* vm.c */ -VALUE rb_obj_is_thread(VALUE obj); -void rb_vm_mark(void *ptr); -void rb_vm_register_global_object(VALUE obj); -void rb_vm_each_stack_value(void *ptr, void (*cb)(VALUE, void*), void *ctx); -PUREFUNC(VALUE rb_vm_top_self(void)); -const void **rb_vm_get_insns_address_table(void); -VALUE rb_source_location(int *pline); -const char *rb_source_location_cstr(int *pline); -void rb_vm_pop_cfunc_frame(void); -void rb_vm_check_redefinition_by_prepend(VALUE klass); -int rb_vm_check_optimizable_mid(VALUE mid); -VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements); -VALUE ruby_vm_special_exception_copy(VALUE); -PUREFUNC(st_table *rb_vm_fstring_table(void)); - -void rb_lastline_set_up(VALUE val, unsigned int up); - -/* vm_eval.c */ -VALUE rb_current_realfilepath(void); -VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE); -typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE); -VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv, - rb_check_funcall_hook *hook, VALUE arg, int kw_splat); -const char *rb_type_str(enum ruby_value_type type); -VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE); -VALUE rb_check_funcall_basic_kw(VALUE, ID, VALUE, int, const VALUE*, int); -VALUE rb_yield_1(VALUE val); -VALUE rb_yield_force_blockarg(VALUE values); -VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv, - rb_block_call_func_t bl_proc, int min_argc, int max_argc, - VALUE data2); -void rb_check_stack_overflow(void); -#define RB_BLOCK_NO_USE_PACKED_ARGS 2 -VALUE rb_block_call2(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, VALUE data2, long flags); - -#if USE_YJIT -/* vm_exec.c */ -extern uint64_t rb_vm_insns_count; -#endif - -extern bool rb_free_at_exit; - -/* miniinit.c and builtin.c */ -void rb_free_loaded_builtin_table(void); - -/* vm_insnhelper.c */ -VALUE rb_equal_opt(VALUE obj1, VALUE obj2); -VALUE rb_eql_opt(VALUE obj1, VALUE obj2); - -struct rb_iseq_struct; -const struct rb_callcache *rb_vm_search_method_slowpath(const struct rb_callinfo *ci, VALUE klass); - -/* vm_method.c */ -struct rb_execution_context_struct; -int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE obj, ID id, int priv); - -void rb_clear_constant_cache(void); - -/* vm_dump.c */ -void rb_print_backtrace(FILE *); - -/* vm_backtrace.c */ -VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval); -VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval); -VALUE rb_vm_backtrace(int argc, const VALUE * argv, struct rb_execution_context_struct * ec); -VALUE rb_vm_backtrace_locations(int argc, const VALUE * argv, struct rb_execution_context_struct * ec); -VALUE rb_make_backtrace(void); -void rb_backtrace_print_as_bugreport(FILE*); -int rb_backtrace_p(VALUE obj); -VALUE rb_backtrace_to_str_ary(VALUE obj); -VALUE rb_backtrace_to_location_ary(VALUE obj); -VALUE rb_location_ary_to_backtrace(VALUE ary); -void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output); -int rb_frame_info_p(VALUE obj); -int rb_get_node_id_from_frame_info(VALUE obj); -const struct rb_iseq_struct *rb_get_iseq_from_frame_info(VALUE obj); - -VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec); -void rb_backtrace_use_iseq_first_lineno_for_last_location(VALUE self); - -#define RUBY_DTRACE_CREATE_HOOK(name, arg) \ - RUBY_DTRACE_HOOK(name##_CREATE, arg) -#define RUBY_DTRACE_HOOK(name, arg) \ -do { \ - if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \ - int dtrace_line; \ - const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \ - if (!dtrace_file) dtrace_file = ""; \ - RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \ - } \ -} while (0) -#endif /* INTERNAL_VM_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h deleted file mode 100644 index 020212e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INTERNAL_WARNINGS_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_WARNINGS_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header to suppress / mandate warnings. - */ -#include "ruby/internal/warning_push.h" -#define COMPILER_WARNING_PUSH RBIMPL_WARNING_PUSH() -#define COMPILER_WARNING_POP RBIMPL_WARNING_POP() -#define COMPILER_WARNING_ERROR(flag) RBIMPL_WARNING_ERROR(flag) -#define COMPILER_WARNING_IGNORED(flag) RBIMPL_WARNING_IGNORED(flag) -#endif /* INTERNAL_WARNINGS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/iseq.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/iseq.h deleted file mode 100644 index a0b59c4..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/iseq.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef RUBY_ISEQ_H -#define RUBY_ISEQ_H 1 -/********************************************************************** - - iseq.h - - - $Author$ - created at: 04/01/01 23:36:57 JST - - Copyright (C) 2004-2008 Koichi Sasada - -**********************************************************************/ -#include "internal/gc.h" -#include "shape.h" -#include "vm_core.h" -#include "prism_compile.h" - -RUBY_EXTERN const int ruby_api_version[]; -#define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0]) -#define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1]) - -#define ISEQ_MBITS_SIZE sizeof(iseq_bits_t) -#define ISEQ_MBITS_BITLENGTH (ISEQ_MBITS_SIZE * CHAR_BIT) -#define ISEQ_MBITS_SET(buf, i) (buf[(i) / ISEQ_MBITS_BITLENGTH] |= ((iseq_bits_t)1 << ((i) % ISEQ_MBITS_BITLENGTH))) -#define ISEQ_MBITS_SET_P(buf, i) ((buf[(i) / ISEQ_MBITS_BITLENGTH] >> ((i) % ISEQ_MBITS_BITLENGTH)) & 0x1) -#define ISEQ_MBITS_BUFLEN(size) roomof(size, ISEQ_MBITS_BITLENGTH) - -#ifndef USE_ISEQ_NODE_ID -#define USE_ISEQ_NODE_ID 1 -#endif - -#ifndef rb_iseq_t -typedef struct rb_iseq_struct rb_iseq_t; -#define rb_iseq_t rb_iseq_t -#endif -typedef void (*rb_iseq_callback)(const rb_iseq_t *, void *); - -extern const ID rb_iseq_shared_exc_local_tbl[]; - -#define ISEQ_COVERAGE(iseq) ISEQ_BODY(iseq)->variable.coverage -#define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.coverage, cov) -#define ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES) -#define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES) - -#define ISEQ_PC2BRANCHINDEX(iseq) ISEQ_BODY(iseq)->variable.pc2branchindex -#define ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.pc2branchindex, h) - -#define ISEQ_FLIP_CNT(iseq) ISEQ_BODY(iseq)->variable.flip_count - -#define ISEQ_FROZEN_STRING_LITERAL_ENABLED 1 -#define ISEQ_FROZEN_STRING_LITERAL_DISABLED 0 -#define ISEQ_FROZEN_STRING_LITERAL_UNSET -1 - -static inline rb_snum_t -ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq) -{ - rb_snum_t cnt = ISEQ_BODY(iseq)->variable.flip_count; - ISEQ_BODY(iseq)->variable.flip_count += 1; - return cnt; -} - -static inline VALUE * -ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq) -{ - return ISEQ_BODY(iseq)->variable.original_iseq; -} - -static inline void -ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq) -{ - void *ptr = ISEQ_BODY(iseq)->variable.original_iseq; - ISEQ_BODY(iseq)->variable.original_iseq = NULL; - ruby_xfree(ptr); -} - -static inline VALUE * -ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size) -{ - return ISEQ_BODY(iseq)->variable.original_iseq = - ALLOC_N(VALUE, size); -} - -#define ISEQ_TRACE_EVENTS (RUBY_EVENT_LINE | \ - RUBY_EVENT_CLASS | \ - RUBY_EVENT_END | \ - RUBY_EVENT_CALL | \ - RUBY_EVENT_RETURN| \ - RUBY_EVENT_C_CALL| \ - RUBY_EVENT_C_RETURN | \ - RUBY_EVENT_B_CALL | \ - RUBY_EVENT_B_RETURN | \ - RUBY_EVENT_RESCUE | \ - RUBY_EVENT_COVERAGE_LINE| \ - RUBY_EVENT_COVERAGE_BRANCH) - -#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1 -#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2 -#define ISEQ_TRANSLATED IMEMO_FL_USER3 - -#define ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW(((VALUE)iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0) - -struct iseq_compile_data { - /* GC is needed */ - const VALUE err_info; - const VALUE catch_table_ary; /* Array */ - - /* GC is not needed */ - struct iseq_label_data *start_label; - struct iseq_label_data *end_label; - struct iseq_label_data *redo_label; - const rb_iseq_t *current_block; - struct iseq_compile_data_ensure_node_stack *ensure_node_stack; - struct { - struct iseq_compile_data_storage *storage_head; - struct iseq_compile_data_storage *storage_current; - } node; - struct { - struct iseq_compile_data_storage *storage_head; - struct iseq_compile_data_storage *storage_current; - } insn; - bool in_rescue; - int loopval_popped; /* used by NODE_BREAK */ - int last_line; - int label_no; - int node_level; - int isolated_depth; - unsigned int ci_index; - unsigned int ic_index; - const rb_compile_option_t *option; - struct rb_id_table *ivar_cache_table; - const struct rb_builtin_function *builtin_function_table; - const NODE *root_node; - bool catch_except_p; // If a frame of this ISeq may catch exception, set true. -#if OPT_SUPPORT_JOKE - st_table *labels_table; -#endif -}; - -static inline struct iseq_compile_data * -ISEQ_COMPILE_DATA(const rb_iseq_t *iseq) -{ - if (iseq->flags & ISEQ_USE_COMPILE_DATA) { - return iseq->aux.compile_data; - } - else { - return NULL; - } -} - -static inline void -ISEQ_COMPILE_DATA_ALLOC(rb_iseq_t *iseq) -{ - iseq->aux.compile_data = ZALLOC(struct iseq_compile_data); - iseq->flags |= ISEQ_USE_COMPILE_DATA; -} - -static inline void -ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq) -{ - iseq->flags &= ~ISEQ_USE_COMPILE_DATA; - iseq->aux.compile_data = NULL; -} - -static inline rb_iseq_t * -iseq_imemo_alloc(void) -{ - return IMEMO_NEW(rb_iseq_t, imemo_iseq, 0); -} - -VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt); -void rb_ibf_load_iseq_complete(rb_iseq_t *iseq); -const rb_iseq_t *rb_iseq_ibf_load(VALUE str); -const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t); -VALUE rb_iseq_ibf_load_extra_data(VALUE str); -void rb_iseq_init_trace(rb_iseq_t *iseq); -int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line, bool target_bmethod); -int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval); -const rb_iseq_t *rb_iseq_load_iseq(VALUE fname); -int rb_iseq_opt_frozen_string_literal(void); - -#if VM_INSN_INFO_TABLE_IMPL == 2 -unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body); -#endif - -int rb_vm_insn_addr2opcode(const void *addr); - -RUBY_SYMBOL_EXPORT_BEGIN - -/* compile.c */ -VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node); -VALUE rb_iseq_compile_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc); -VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq); -void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, - VALUE locals, VALUE args, - VALUE exception, VALUE body); -void rb_iseq_mark_and_pin_insn_storage(struct iseq_compile_data_storage *arena); - -VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt); -VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc); -unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos); -#ifdef USE_ISEQ_NODE_ID -int rb_iseq_node_id(const rb_iseq_t *iseq, size_t pos); -#endif -void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events); -void rb_iseq_trace_set_all(rb_event_flag_t turnon_events); -void rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq); - -struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(void); -VALUE rb_iseqw_new(const rb_iseq_t *iseq); -const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw); - -VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */ -int rb_iseq_from_eval_p(const rb_iseq_t *iseq); -VALUE rb_iseq_type(const rb_iseq_t *iseq); -VALUE rb_iseq_label(const rb_iseq_t *iseq); -VALUE rb_iseq_base_label(const rb_iseq_t *iseq); -VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq); -VALUE rb_iseq_method_name(const rb_iseq_t *iseq); -void rb_iseq_code_location(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column); - -void rb_iseq_remove_coverage_all(void); - -/* proc.c */ -const rb_iseq_t *rb_method_iseq(VALUE body); -const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc); - -struct rb_compile_option_struct { - unsigned int inline_const_cache: 1; - unsigned int peephole_optimization: 1; - unsigned int tailcall_optimization: 1; - unsigned int specialized_instruction: 1; - unsigned int operands_unification: 1; - unsigned int instructions_unification: 1; - signed int frozen_string_literal: 2; /* -1: not specified, 0: false, 1: true */ - unsigned int debug_frozen_string_literal: 1; - unsigned int coverage_enabled: 1; - int debug_level; -}; - -struct iseq_insn_info_entry { - int line_no; -#ifdef USE_ISEQ_NODE_ID - int node_id; -#endif - rb_event_flag_t events; -}; - -/* - * iseq type: - * CATCH_TYPE_RESCUE, CATCH_TYPE_ENSURE: - * use iseq as continuation. - * - * CATCH_TYPE_BREAK (iter): - * use iseq as key. - * - * CATCH_TYPE_BREAK (while), CATCH_TYPE_RETRY, - * CATCH_TYPE_REDO, CATCH_TYPE_NEXT: - * NULL. - */ -enum rb_catch_type { - CATCH_TYPE_RESCUE = INT2FIX(1), - CATCH_TYPE_ENSURE = INT2FIX(2), - CATCH_TYPE_RETRY = INT2FIX(3), - CATCH_TYPE_BREAK = INT2FIX(4), - CATCH_TYPE_REDO = INT2FIX(5), - CATCH_TYPE_NEXT = INT2FIX(6) -}; - -struct iseq_catch_table_entry { - enum rb_catch_type type; - rb_iseq_t *iseq; - - unsigned int start; - unsigned int end; - unsigned int cont; - unsigned int sp; -}; - -RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN() -struct iseq_catch_table { - unsigned int size; - struct iseq_catch_table_entry entries[FLEX_ARY_LEN]; -} RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END(); - -static inline int -iseq_catch_table_bytes(int n) -{ - enum { - catch_table_entry_size = sizeof(struct iseq_catch_table_entry), - catch_table_entries_max = (INT_MAX - offsetof(struct iseq_catch_table, entries)) / catch_table_entry_size - }; - if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n); - return (int)(offsetof(struct iseq_catch_table, entries) + - n * catch_table_entry_size); -} - -#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512) - -struct iseq_compile_data_storage { - struct iseq_compile_data_storage *next; - unsigned int pos; - unsigned int size; - char buff[FLEX_ARY_LEN]; -}; - -/* defined? */ - -enum defined_type { - DEFINED_NOT_DEFINED, - DEFINED_NIL = 1, - DEFINED_IVAR, - DEFINED_LVAR, - DEFINED_GVAR, - DEFINED_CVAR, - DEFINED_CONST, - DEFINED_METHOD, - DEFINED_YIELD, - DEFINED_ZSUPER, - DEFINED_SELF, - DEFINED_TRUE, - DEFINED_FALSE, - DEFINED_ASGN, - DEFINED_EXPR, - DEFINED_REF, - DEFINED_FUNC, - DEFINED_CONST_FROM -}; - -VALUE rb_iseq_defined_string(enum defined_type type); - -/* vm.c */ -VALUE rb_iseq_local_variables(const rb_iseq_t *iseq); - -attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq); - -void rb_free_encoded_insn_data(void); - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_ISEQ_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/known_errors.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/known_errors.inc deleted file mode 100644 index 13ff79a..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/known_errors.inc +++ /dev/null @@ -1,1419 +0,0 @@ -/** -*-c-*- - * DO NOT EDIT - * This file is automatically generated by tool/generic_erb.rb from - * template/known_errors.inc.tmpl and defs/known_errors.def. - */ - -#if 0 - /* "Argument list too long" error */ - rb_define_const(rb_mErrno, "E2BIG", eE2BIG); -#endif -#ifdef E2BIG - defined_error("E2BIG", E2BIG) -#else - undefined_error("E2BIG") -#endif -#if 0 - /* "Permission denied" error */ - rb_define_const(rb_mErrno, "EACCES", eEACCES); -#endif -#ifdef EACCES - defined_error("EACCES", EACCES) -#else - undefined_error("EACCES") -#endif -#if 0 - /* "Address already in use" error */ - rb_define_const(rb_mErrno, "EADDRINUSE", eEADDRINUSE); -#endif -#ifdef EADDRINUSE - defined_error("EADDRINUSE", EADDRINUSE) -#else - undefined_error("EADDRINUSE") -#endif -#if 0 - /* "Address not available" error */ - rb_define_const(rb_mErrno, "EADDRNOTAVAIL", eEADDRNOTAVAIL); -#endif -#ifdef EADDRNOTAVAIL - defined_error("EADDRNOTAVAIL", EADDRNOTAVAIL) -#else - undefined_error("EADDRNOTAVAIL") -#endif -#if 0 - /* "Advertise error" error */ - rb_define_const(rb_mErrno, "EADV", eEADV); -#endif -#ifdef EADV - defined_error("EADV", EADV) -#else - undefined_error("EADV") -#endif -#if 0 - /* "Address family not supported" error */ - rb_define_const(rb_mErrno, "EAFNOSUPPORT", eEAFNOSUPPORT); -#endif -#ifdef EAFNOSUPPORT - defined_error("EAFNOSUPPORT", EAFNOSUPPORT) -#else - undefined_error("EAFNOSUPPORT") -#endif -#if 0 - /* "Resource temporarily unavailable, try again (may be the same value as EWOULDBLOCK)" error */ - rb_define_const(rb_mErrno, "EAGAIN", eEAGAIN); -#endif -#ifdef EAGAIN - defined_error("EAGAIN", EAGAIN) -#else - undefined_error("EAGAIN") -#endif -#if 0 - /* "Connection already in progress" error */ - rb_define_const(rb_mErrno, "EALREADY", eEALREADY); -#endif -#ifdef EALREADY - defined_error("EALREADY", EALREADY) -#else - undefined_error("EALREADY") -#endif -#if 0 - /* "Authentication error" error */ - rb_define_const(rb_mErrno, "EAUTH", eEAUTH); -#endif -#ifdef EAUTH - defined_error("EAUTH", EAUTH) -#else - undefined_error("EAUTH") -#endif -#if 0 - /* "Bad CPU type in executable" error */ - rb_define_const(rb_mErrno, "EBADARCH", eEBADARCH); -#endif -#ifdef EBADARCH - defined_error("EBADARCH", EBADARCH) -#else - undefined_error("EBADARCH") -#endif -#if 0 - /* "Bad exchange" error */ - rb_define_const(rb_mErrno, "EBADE", eEBADE); -#endif -#ifdef EBADE - defined_error("EBADE", EBADE) -#else - undefined_error("EBADE") -#endif -#if 0 - /* "Bad executable" error */ - rb_define_const(rb_mErrno, "EBADEXEC", eEBADEXEC); -#endif -#ifdef EBADEXEC - defined_error("EBADEXEC", EBADEXEC) -#else - undefined_error("EBADEXEC") -#endif -#if 0 - /* "Bad file descriptor" error */ - rb_define_const(rb_mErrno, "EBADF", eEBADF); -#endif -#ifdef EBADF - defined_error("EBADF", EBADF) -#else - undefined_error("EBADF") -#endif -#if 0 - /* "File descriptor in bad state" error */ - rb_define_const(rb_mErrno, "EBADFD", eEBADFD); -#endif -#ifdef EBADFD - defined_error("EBADFD", EBADFD) -#else - undefined_error("EBADFD") -#endif -#if 0 - /* "Malformed Macho file" error */ - rb_define_const(rb_mErrno, "EBADMACHO", eEBADMACHO); -#endif -#ifdef EBADMACHO - defined_error("EBADMACHO", EBADMACHO) -#else - undefined_error("EBADMACHO") -#endif -#if 0 - /* "Bad message" error */ - rb_define_const(rb_mErrno, "EBADMSG", eEBADMSG); -#endif -#ifdef EBADMSG - defined_error("EBADMSG", EBADMSG) -#else - undefined_error("EBADMSG") -#endif -#if 0 - /* "Invalid request descriptor" error */ - rb_define_const(rb_mErrno, "EBADR", eEBADR); -#endif -#ifdef EBADR - defined_error("EBADR", EBADR) -#else - undefined_error("EBADR") -#endif -#if 0 - /* "RPC struct is bad" error */ - rb_define_const(rb_mErrno, "EBADRPC", eEBADRPC); -#endif -#ifdef EBADRPC - defined_error("EBADRPC", EBADRPC) -#else - undefined_error("EBADRPC") -#endif -#if 0 - /* "Invalid request code" error */ - rb_define_const(rb_mErrno, "EBADRQC", eEBADRQC); -#endif -#ifdef EBADRQC - defined_error("EBADRQC", EBADRQC) -#else - undefined_error("EBADRQC") -#endif -#if 0 - /* "Invalid slot" error */ - rb_define_const(rb_mErrno, "EBADSLT", eEBADSLT); -#endif -#ifdef EBADSLT - defined_error("EBADSLT", EBADSLT) -#else - undefined_error("EBADSLT") -#endif -#if 0 - /* "Bad font file format" error */ - rb_define_const(rb_mErrno, "EBFONT", eEBFONT); -#endif -#ifdef EBFONT - defined_error("EBFONT", EBFONT) -#else - undefined_error("EBFONT") -#endif -#if 0 - /* "Device or resource busy" error */ - rb_define_const(rb_mErrno, "EBUSY", eEBUSY); -#endif -#ifdef EBUSY - defined_error("EBUSY", EBUSY) -#else - undefined_error("EBUSY") -#endif -#if 0 - /* "Operation canceled" error */ - rb_define_const(rb_mErrno, "ECANCELED", eECANCELED); -#endif -#ifdef ECANCELED - defined_error("ECANCELED", ECANCELED) -#else - undefined_error("ECANCELED") -#endif -#if 0 - /* "Not permitted in capability mode" error */ - rb_define_const(rb_mErrno, "ECAPMODE", eECAPMODE); -#endif -#ifdef ECAPMODE - defined_error("ECAPMODE", ECAPMODE) -#else - undefined_error("ECAPMODE") -#endif -#if 0 - /* "No child processes" error */ - rb_define_const(rb_mErrno, "ECHILD", eECHILD); -#endif -#ifdef ECHILD - defined_error("ECHILD", ECHILD) -#else - undefined_error("ECHILD") -#endif -#if 0 - /* "Channel number out of range" error */ - rb_define_const(rb_mErrno, "ECHRNG", eECHRNG); -#endif -#ifdef ECHRNG - defined_error("ECHRNG", ECHRNG) -#else - undefined_error("ECHRNG") -#endif -#if 0 - /* "Communication error on send" error */ - rb_define_const(rb_mErrno, "ECOMM", eECOMM); -#endif -#ifdef ECOMM - defined_error("ECOMM", ECOMM) -#else - undefined_error("ECOMM") -#endif -#if 0 - /* "Connection aborted" error */ - rb_define_const(rb_mErrno, "ECONNABORTED", eECONNABORTED); -#endif -#ifdef ECONNABORTED - defined_error("ECONNABORTED", ECONNABORTED) -#else - undefined_error("ECONNABORTED") -#endif -#if 0 - /* "Connection refused" error */ - rb_define_const(rb_mErrno, "ECONNREFUSED", eECONNREFUSED); -#endif -#ifdef ECONNREFUSED - defined_error("ECONNREFUSED", ECONNREFUSED) -#else - undefined_error("ECONNREFUSED") -#endif -#if 0 - /* "Connection reset" error */ - rb_define_const(rb_mErrno, "ECONNRESET", eECONNRESET); -#endif -#ifdef ECONNRESET - defined_error("ECONNRESET", ECONNRESET) -#else - undefined_error("ECONNRESET") -#endif -#if 0 - /* "Resource deadlock avoided" error */ - rb_define_const(rb_mErrno, "EDEADLK", eEDEADLK); -#endif -#ifdef EDEADLK - defined_error("EDEADLK", EDEADLK) -#else - undefined_error("EDEADLK") -#endif -#if 0 - /* "File locking deadlock error" error */ - rb_define_const(rb_mErrno, "EDEADLOCK", eEDEADLOCK); -#endif -#ifdef EDEADLOCK - defined_error("EDEADLOCK", EDEADLOCK) -#else - undefined_error("EDEADLOCK") -#endif -#if 0 - /* "Destination address required" error */ - rb_define_const(rb_mErrno, "EDESTADDRREQ", eEDESTADDRREQ); -#endif -#ifdef EDESTADDRREQ - defined_error("EDESTADDRREQ", EDESTADDRREQ) -#else - undefined_error("EDESTADDRREQ") -#endif -#if 0 - /* "Device error; e.g., printer paper out" error */ - rb_define_const(rb_mErrno, "EDEVERR", eEDEVERR); -#endif -#ifdef EDEVERR - defined_error("EDEVERR", EDEVERR) -#else - undefined_error("EDEVERR") -#endif -#if 0 - /* "Mathematics argument out of domain of function" error */ - rb_define_const(rb_mErrno, "EDOM", eEDOM); -#endif -#ifdef EDOM - defined_error("EDOM", EDOM) -#else - undefined_error("EDOM") -#endif -#if 0 - /* "Improper function use" error */ - rb_define_const(rb_mErrno, "EDOOFUS", eEDOOFUS); -#endif -#ifdef EDOOFUS - defined_error("EDOOFUS", EDOOFUS) -#else - undefined_error("EDOOFUS") -#endif -#if 0 - /* "RFS specific error" error */ - rb_define_const(rb_mErrno, "EDOTDOT", eEDOTDOT); -#endif -#ifdef EDOTDOT - defined_error("EDOTDOT", EDOTDOT) -#else - undefined_error("EDOTDOT") -#endif -#if 0 - /* "Disk quota exceeded" error */ - rb_define_const(rb_mErrno, "EDQUOT", eEDQUOT); -#endif -#ifdef EDQUOT - defined_error("EDQUOT", EDQUOT) -#else - undefined_error("EDQUOT") -#endif -#if 0 - /* "File exists" error */ - rb_define_const(rb_mErrno, "EEXIST", eEEXIST); -#endif -#ifdef EEXIST - defined_error("EEXIST", EEXIST) -#else - undefined_error("EEXIST") -#endif -#if 0 - /* "Bad address" error */ - rb_define_const(rb_mErrno, "EFAULT", eEFAULT); -#endif -#ifdef EFAULT - defined_error("EFAULT", EFAULT) -#else - undefined_error("EFAULT") -#endif -#if 0 - /* "File too large" error */ - rb_define_const(rb_mErrno, "EFBIG", eEFBIG); -#endif -#ifdef EFBIG - defined_error("EFBIG", EFBIG) -#else - undefined_error("EFBIG") -#endif -#if 0 - /* "Invalid file type or format" error */ - rb_define_const(rb_mErrno, "EFTYPE", eEFTYPE); -#endif -#ifdef EFTYPE - defined_error("EFTYPE", EFTYPE) -#else - undefined_error("EFTYPE") -#endif -#if 0 - /* "Host is down" error */ - rb_define_const(rb_mErrno, "EHOSTDOWN", eEHOSTDOWN); -#endif -#ifdef EHOSTDOWN - defined_error("EHOSTDOWN", EHOSTDOWN) -#else - undefined_error("EHOSTDOWN") -#endif -#if 0 - /* "Host is unreachable" error */ - rb_define_const(rb_mErrno, "EHOSTUNREACH", eEHOSTUNREACH); -#endif -#ifdef EHOSTUNREACH - defined_error("EHOSTUNREACH", EHOSTUNREACH) -#else - undefined_error("EHOSTUNREACH") -#endif -#if 0 - /* "Memory page has hardware error" error */ - rb_define_const(rb_mErrno, "EHWPOISON", eEHWPOISON); -#endif -#ifdef EHWPOISON - defined_error("EHWPOISON", EHWPOISON) -#else - undefined_error("EHWPOISON") -#endif -#if 0 - /* "Identifier removed" error */ - rb_define_const(rb_mErrno, "EIDRM", eEIDRM); -#endif -#ifdef EIDRM - defined_error("EIDRM", EIDRM) -#else - undefined_error("EIDRM") -#endif -#if 0 - /* "Invalid or incomplete multibyte or wide character" error */ - rb_define_const(rb_mErrno, "EILSEQ", eEILSEQ); -#endif -#ifdef EILSEQ - defined_error("EILSEQ", EILSEQ) -#else - undefined_error("EILSEQ") -#endif -#if 0 - /* "Operation in progress" error */ - rb_define_const(rb_mErrno, "EINPROGRESS", eEINPROGRESS); -#endif -#ifdef EINPROGRESS - defined_error("EINPROGRESS", EINPROGRESS) -#else - undefined_error("EINPROGRESS") -#endif -#if 0 - /* "Interrupted function call" error */ - rb_define_const(rb_mErrno, "EINTR", eEINTR); -#endif -#ifdef EINTR - defined_error("EINTR", EINTR) -#else - undefined_error("EINTR") -#endif -#if 0 - /* "Invalid argument" error */ - rb_define_const(rb_mErrno, "EINVAL", eEINVAL); -#endif -#ifdef EINVAL - defined_error("EINVAL", EINVAL) -#else - undefined_error("EINVAL") -#endif -#if 0 - /* "Input/output error" error */ - rb_define_const(rb_mErrno, "EIO", eEIO); -#endif -#ifdef EIO - defined_error("EIO", EIO) -#else - undefined_error("EIO") -#endif -#if 0 - /* "IPsec processing failure" error */ - rb_define_const(rb_mErrno, "EIPSEC", eEIPSEC); -#endif -#ifdef EIPSEC - defined_error("EIPSEC", EIPSEC) -#else - undefined_error("EIPSEC") -#endif -#if 0 - /* "Socket is connected" error */ - rb_define_const(rb_mErrno, "EISCONN", eEISCONN); -#endif -#ifdef EISCONN - defined_error("EISCONN", EISCONN) -#else - undefined_error("EISCONN") -#endif -#if 0 - /* "Is a directory" error */ - rb_define_const(rb_mErrno, "EISDIR", eEISDIR); -#endif -#ifdef EISDIR - defined_error("EISDIR", EISDIR) -#else - undefined_error("EISDIR") -#endif -#if 0 - /* "Is a named file type" error */ - rb_define_const(rb_mErrno, "EISNAM", eEISNAM); -#endif -#ifdef EISNAM - defined_error("EISNAM", EISNAM) -#else - undefined_error("EISNAM") -#endif -#if 0 - /* "Key has expired" error */ - rb_define_const(rb_mErrno, "EKEYEXPIRED", eEKEYEXPIRED); -#endif -#ifdef EKEYEXPIRED - defined_error("EKEYEXPIRED", EKEYEXPIRED) -#else - undefined_error("EKEYEXPIRED") -#endif -#if 0 - /* "Key was rejected by service" error */ - rb_define_const(rb_mErrno, "EKEYREJECTED", eEKEYREJECTED); -#endif -#ifdef EKEYREJECTED - defined_error("EKEYREJECTED", EKEYREJECTED) -#else - undefined_error("EKEYREJECTED") -#endif -#if 0 - /* "Key has been revoked" error */ - rb_define_const(rb_mErrno, "EKEYREVOKED", eEKEYREVOKED); -#endif -#ifdef EKEYREVOKED - defined_error("EKEYREVOKED", EKEYREVOKED) -#else - undefined_error("EKEYREVOKED") -#endif -#if 0 - /* "Level 2 halted" error */ - rb_define_const(rb_mErrno, "EL2HLT", eEL2HLT); -#endif -#ifdef EL2HLT - defined_error("EL2HLT", EL2HLT) -#else - undefined_error("EL2HLT") -#endif -#if 0 - /* "Level 2 not synchronized" error */ - rb_define_const(rb_mErrno, "EL2NSYNC", eEL2NSYNC); -#endif -#ifdef EL2NSYNC - defined_error("EL2NSYNC", EL2NSYNC) -#else - undefined_error("EL2NSYNC") -#endif -#if 0 - /* "Level 3 halted" error */ - rb_define_const(rb_mErrno, "EL3HLT", eEL3HLT); -#endif -#ifdef EL3HLT - defined_error("EL3HLT", EL3HLT) -#else - undefined_error("EL3HLT") -#endif -#if 0 - /* "Level 3 reset" error */ - rb_define_const(rb_mErrno, "EL3RST", eEL3RST); -#endif -#ifdef EL3RST - defined_error("EL3RST", EL3RST) -#else - undefined_error("EL3RST") -#endif -#if 0 - /* "Cannot access a needed shared library" error */ - rb_define_const(rb_mErrno, "ELIBACC", eELIBACC); -#endif -#ifdef ELIBACC - defined_error("ELIBACC", ELIBACC) -#else - undefined_error("ELIBACC") -#endif -#if 0 - /* "Accessing a corrupted shared library" error */ - rb_define_const(rb_mErrno, "ELIBBAD", eELIBBAD); -#endif -#ifdef ELIBBAD - defined_error("ELIBBAD", ELIBBAD) -#else - undefined_error("ELIBBAD") -#endif -#if 0 - /* "Cannot exec a shared library directly" error */ - rb_define_const(rb_mErrno, "ELIBEXEC", eELIBEXEC); -#endif -#ifdef ELIBEXEC - defined_error("ELIBEXEC", ELIBEXEC) -#else - undefined_error("ELIBEXEC") -#endif -#if 0 - /* "Attempting to link in too many shared libraries" error */ - rb_define_const(rb_mErrno, "ELIBMAX", eELIBMAX); -#endif -#ifdef ELIBMAX - defined_error("ELIBMAX", ELIBMAX) -#else - undefined_error("ELIBMAX") -#endif -#if 0 - /* ".lib section in a.out corrupted" error */ - rb_define_const(rb_mErrno, "ELIBSCN", eELIBSCN); -#endif -#ifdef ELIBSCN - defined_error("ELIBSCN", ELIBSCN) -#else - undefined_error("ELIBSCN") -#endif -#if 0 - /* "Link number out of range" error */ - rb_define_const(rb_mErrno, "ELNRNG", eELNRNG); -#endif -#ifdef ELNRNG - defined_error("ELNRNG", ELNRNG) -#else - undefined_error("ELNRNG") -#endif -#if 0 - /* "Too many levels of symbolic links" error */ - rb_define_const(rb_mErrno, "ELOOP", eELOOP); -#endif -#ifdef ELOOP - defined_error("ELOOP", ELOOP) -#else - undefined_error("ELOOP") -#endif -#if 0 - /* "Wrong medium type" error */ - rb_define_const(rb_mErrno, "EMEDIUMTYPE", eEMEDIUMTYPE); -#endif -#ifdef EMEDIUMTYPE - defined_error("EMEDIUMTYPE", EMEDIUMTYPE) -#else - undefined_error("EMEDIUMTYPE") -#endif -#if 0 - /* "Too many open files" error */ - rb_define_const(rb_mErrno, "EMFILE", eEMFILE); -#endif -#ifdef EMFILE - defined_error("EMFILE", EMFILE) -#else - undefined_error("EMFILE") -#endif -#if 0 - /* "Too many links" error */ - rb_define_const(rb_mErrno, "EMLINK", eEMLINK); -#endif -#ifdef EMLINK - defined_error("EMLINK", EMLINK) -#else - undefined_error("EMLINK") -#endif -#if 0 - /* "Message too long" error */ - rb_define_const(rb_mErrno, "EMSGSIZE", eEMSGSIZE); -#endif -#ifdef EMSGSIZE - defined_error("EMSGSIZE", EMSGSIZE) -#else - undefined_error("EMSGSIZE") -#endif -#if 0 - /* "Multihop attempted" error */ - rb_define_const(rb_mErrno, "EMULTIHOP", eEMULTIHOP); -#endif -#ifdef EMULTIHOP - defined_error("EMULTIHOP", EMULTIHOP) -#else - undefined_error("EMULTIHOP") -#endif -#if 0 - /* "Filename too long" error */ - rb_define_const(rb_mErrno, "ENAMETOOLONG", eENAMETOOLONG); -#endif -#ifdef ENAMETOOLONG - defined_error("ENAMETOOLONG", ENAMETOOLONG) -#else - undefined_error("ENAMETOOLONG") -#endif -#if 0 - /* "No XENIX semaphores available" error */ - rb_define_const(rb_mErrno, "ENAVAIL", eENAVAIL); -#endif -#ifdef ENAVAIL - defined_error("ENAVAIL", ENAVAIL) -#else - undefined_error("ENAVAIL") -#endif -#if 0 - /* "Need authenticator" error */ - rb_define_const(rb_mErrno, "ENEEDAUTH", eENEEDAUTH); -#endif -#ifdef ENEEDAUTH - defined_error("ENEEDAUTH", ENEEDAUTH) -#else - undefined_error("ENEEDAUTH") -#endif -#if 0 - /* "Network is down" error */ - rb_define_const(rb_mErrno, "ENETDOWN", eENETDOWN); -#endif -#ifdef ENETDOWN - defined_error("ENETDOWN", ENETDOWN) -#else - undefined_error("ENETDOWN") -#endif -#if 0 - /* "Connection aborted by network" error */ - rb_define_const(rb_mErrno, "ENETRESET", eENETRESET); -#endif -#ifdef ENETRESET - defined_error("ENETRESET", ENETRESET) -#else - undefined_error("ENETRESET") -#endif -#if 0 - /* "Network unreachable" error */ - rb_define_const(rb_mErrno, "ENETUNREACH", eENETUNREACH); -#endif -#ifdef ENETUNREACH - defined_error("ENETUNREACH", ENETUNREACH) -#else - undefined_error("ENETUNREACH") -#endif -#if 0 - /* "Too many open files in system" error */ - rb_define_const(rb_mErrno, "ENFILE", eENFILE); -#endif -#ifdef ENFILE - defined_error("ENFILE", ENFILE) -#else - undefined_error("ENFILE") -#endif -#if 0 - /* "No anode" error */ - rb_define_const(rb_mErrno, "ENOANO", eENOANO); -#endif -#ifdef ENOANO - defined_error("ENOANO", ENOANO) -#else - undefined_error("ENOANO") -#endif -#if 0 - /* "Attribute not found" error */ - rb_define_const(rb_mErrno, "ENOATTR", eENOATTR); -#endif -#ifdef ENOATTR - defined_error("ENOATTR", ENOATTR) -#else - undefined_error("ENOATTR") -#endif -#if 0 - /* "No buffer space available" error */ - rb_define_const(rb_mErrno, "ENOBUFS", eENOBUFS); -#endif -#ifdef ENOBUFS - defined_error("ENOBUFS", ENOBUFS) -#else - undefined_error("ENOBUFS") -#endif -#if 0 - /* "No CSI structure available" error */ - rb_define_const(rb_mErrno, "ENOCSI", eENOCSI); -#endif -#ifdef ENOCSI - defined_error("ENOCSI", ENOCSI) -#else - undefined_error("ENOCSI") -#endif -#if 0 - /* "No data available" error */ - rb_define_const(rb_mErrno, "ENODATA", eENODATA); -#endif -#ifdef ENODATA - defined_error("ENODATA", ENODATA) -#else - undefined_error("ENODATA") -#endif -#if 0 - /* "No such device" error */ - rb_define_const(rb_mErrno, "ENODEV", eENODEV); -#endif -#ifdef ENODEV - defined_error("ENODEV", ENODEV) -#else - undefined_error("ENODEV") -#endif -#if 0 - /* "No such file or directory" error */ - rb_define_const(rb_mErrno, "ENOENT", eENOENT); -#endif -#ifdef ENOENT - defined_error("ENOENT", ENOENT) -#else - undefined_error("ENOENT") -#endif -#if 0 - /* "Exec format error" error */ - rb_define_const(rb_mErrno, "ENOEXEC", eENOEXEC); -#endif -#ifdef ENOEXEC - defined_error("ENOEXEC", ENOEXEC) -#else - undefined_error("ENOEXEC") -#endif -#if 0 - /* "Required key not available" error */ - rb_define_const(rb_mErrno, "ENOKEY", eENOKEY); -#endif -#ifdef ENOKEY - defined_error("ENOKEY", ENOKEY) -#else - undefined_error("ENOKEY") -#endif -#if 0 - /* "No locks available" error */ - rb_define_const(rb_mErrno, "ENOLCK", eENOLCK); -#endif -#ifdef ENOLCK - defined_error("ENOLCK", ENOLCK) -#else - undefined_error("ENOLCK") -#endif -#if 0 - /* "Link has been severed" error */ - rb_define_const(rb_mErrno, "ENOLINK", eENOLINK); -#endif -#ifdef ENOLINK - defined_error("ENOLINK", ENOLINK) -#else - undefined_error("ENOLINK") -#endif -#if 0 - /* "No medium found" error */ - rb_define_const(rb_mErrno, "ENOMEDIUM", eENOMEDIUM); -#endif -#ifdef ENOMEDIUM - defined_error("ENOMEDIUM", ENOMEDIUM) -#else - undefined_error("ENOMEDIUM") -#endif -#if 0 - /* "Not enough space/cannot allocate memory" error */ - rb_define_const(rb_mErrno, "ENOMEM", eENOMEM); -#endif -#ifdef ENOMEM - defined_error("ENOMEM", ENOMEM) -#else - undefined_error("ENOMEM") -#endif -#if 0 - /* "No message of the desired type" error */ - rb_define_const(rb_mErrno, "ENOMSG", eENOMSG); -#endif -#ifdef ENOMSG - defined_error("ENOMSG", ENOMSG) -#else - undefined_error("ENOMSG") -#endif -#if 0 - /* "Machine is not on the network" error */ - rb_define_const(rb_mErrno, "ENONET", eENONET); -#endif -#ifdef ENONET - defined_error("ENONET", ENONET) -#else - undefined_error("ENONET") -#endif -#if 0 - /* "Package not installed" error */ - rb_define_const(rb_mErrno, "ENOPKG", eENOPKG); -#endif -#ifdef ENOPKG - defined_error("ENOPKG", ENOPKG) -#else - undefined_error("ENOPKG") -#endif -#if 0 - /* "No such policy" error */ - rb_define_const(rb_mErrno, "ENOPOLICY", eENOPOLICY); -#endif -#ifdef ENOPOLICY - defined_error("ENOPOLICY", ENOPOLICY) -#else - undefined_error("ENOPOLICY") -#endif -#if 0 - /* "Protocol not available" error */ - rb_define_const(rb_mErrno, "ENOPROTOOPT", eENOPROTOOPT); -#endif -#ifdef ENOPROTOOPT - defined_error("ENOPROTOOPT", ENOPROTOOPT) -#else - undefined_error("ENOPROTOOPT") -#endif -#if 0 - /* "No space left on device" error */ - rb_define_const(rb_mErrno, "ENOSPC", eENOSPC); -#endif -#ifdef ENOSPC - defined_error("ENOSPC", ENOSPC) -#else - undefined_error("ENOSPC") -#endif -#if 0 - /* "No STREAM resources" error */ - rb_define_const(rb_mErrno, "ENOSR", eENOSR); -#endif -#ifdef ENOSR - defined_error("ENOSR", ENOSR) -#else - undefined_error("ENOSR") -#endif -#if 0 - /* "Not a STREAM" error */ - rb_define_const(rb_mErrno, "ENOSTR", eENOSTR); -#endif -#ifdef ENOSTR - defined_error("ENOSTR", ENOSTR) -#else - undefined_error("ENOSTR") -#endif -#if 0 - /* "Functionality not implemented" error */ - rb_define_const(rb_mErrno, "ENOSYS", eENOSYS); -#endif -#ifdef ENOSYS - defined_error("ENOSYS", ENOSYS) -#else - undefined_error("ENOSYS") -#endif -#if 0 - /* "Block device required" error */ - rb_define_const(rb_mErrno, "ENOTBLK", eENOTBLK); -#endif -#ifdef ENOTBLK - defined_error("ENOTBLK", ENOTBLK) -#else - undefined_error("ENOTBLK") -#endif -#if 0 - /* "Capabilities insufficient" error */ - rb_define_const(rb_mErrno, "ENOTCAPABLE", eENOTCAPABLE); -#endif -#ifdef ENOTCAPABLE - defined_error("ENOTCAPABLE", ENOTCAPABLE) -#else - undefined_error("ENOTCAPABLE") -#endif -#if 0 - /* "The socket is not connected" error */ - rb_define_const(rb_mErrno, "ENOTCONN", eENOTCONN); -#endif -#ifdef ENOTCONN - defined_error("ENOTCONN", ENOTCONN) -#else - undefined_error("ENOTCONN") -#endif -#if 0 - /* "Not a directory" error */ - rb_define_const(rb_mErrno, "ENOTDIR", eENOTDIR); -#endif -#ifdef ENOTDIR - defined_error("ENOTDIR", ENOTDIR) -#else - undefined_error("ENOTDIR") -#endif -#if 0 - /* "Directory not empty" error */ - rb_define_const(rb_mErrno, "ENOTEMPTY", eENOTEMPTY); -#endif -#ifdef ENOTEMPTY - defined_error("ENOTEMPTY", ENOTEMPTY) -#else - undefined_error("ENOTEMPTY") -#endif -#if 0 - /* "Not a XENIX named type file" error */ - rb_define_const(rb_mErrno, "ENOTNAM", eENOTNAM); -#endif -#ifdef ENOTNAM - defined_error("ENOTNAM", ENOTNAM) -#else - undefined_error("ENOTNAM") -#endif -#if 0 - /* "State not recoverable" error */ - rb_define_const(rb_mErrno, "ENOTRECOVERABLE", eENOTRECOVERABLE); -#endif -#ifdef ENOTRECOVERABLE - defined_error("ENOTRECOVERABLE", ENOTRECOVERABLE) -#else - undefined_error("ENOTRECOVERABLE") -#endif -#if 0 - /* "Not a socket" error */ - rb_define_const(rb_mErrno, "ENOTSOCK", eENOTSOCK); -#endif -#ifdef ENOTSOCK - defined_error("ENOTSOCK", ENOTSOCK) -#else - undefined_error("ENOTSOCK") -#endif -#if 0 - /* "Operation not supported" error */ - rb_define_const(rb_mErrno, "ENOTSUP", eENOTSUP); -#endif -#ifdef ENOTSUP - defined_error("ENOTSUP", ENOTSUP) -#else - undefined_error("ENOTSUP") -#endif -#if 0 - /* "Inappropriate I/O control operation" error */ - rb_define_const(rb_mErrno, "ENOTTY", eENOTTY); -#endif -#ifdef ENOTTY - defined_error("ENOTTY", ENOTTY) -#else - undefined_error("ENOTTY") -#endif -#if 0 - /* "Name not unique on network" error */ - rb_define_const(rb_mErrno, "ENOTUNIQ", eENOTUNIQ); -#endif -#ifdef ENOTUNIQ - defined_error("ENOTUNIQ", ENOTUNIQ) -#else - undefined_error("ENOTUNIQ") -#endif -#if 0 - /* "No such device or address" error */ - rb_define_const(rb_mErrno, "ENXIO", eENXIO); -#endif -#ifdef ENXIO - defined_error("ENXIO", ENXIO) -#else - undefined_error("ENXIO") -#endif -#if 0 - /* "Operation not supported on socket" error */ - rb_define_const(rb_mErrno, "EOPNOTSUPP", eEOPNOTSUPP); -#endif -#ifdef EOPNOTSUPP - defined_error("EOPNOTSUPP", EOPNOTSUPP) -#else - undefined_error("EOPNOTSUPP") -#endif -#if 0 - /* "Value too large to be stored in data type" error */ - rb_define_const(rb_mErrno, "EOVERFLOW", eEOVERFLOW); -#endif -#ifdef EOVERFLOW - defined_error("EOVERFLOW", EOVERFLOW) -#else - undefined_error("EOVERFLOW") -#endif -#if 0 - /* "Owner died" error */ - rb_define_const(rb_mErrno, "EOWNERDEAD", eEOWNERDEAD); -#endif -#ifdef EOWNERDEAD - defined_error("EOWNERDEAD", EOWNERDEAD) -#else - undefined_error("EOWNERDEAD") -#endif -#if 0 - /* "Operation not permitted" error */ - rb_define_const(rb_mErrno, "EPERM", eEPERM); -#endif -#ifdef EPERM - defined_error("EPERM", EPERM) -#else - undefined_error("EPERM") -#endif -#if 0 - /* "Protocol family not supported" error */ - rb_define_const(rb_mErrno, "EPFNOSUPPORT", eEPFNOSUPPORT); -#endif -#ifdef EPFNOSUPPORT - defined_error("EPFNOSUPPORT", EPFNOSUPPORT) -#else - undefined_error("EPFNOSUPPORT") -#endif -#if 0 - /* "Broken pipe" error */ - rb_define_const(rb_mErrno, "EPIPE", eEPIPE); -#endif -#ifdef EPIPE - defined_error("EPIPE", EPIPE) -#else - undefined_error("EPIPE") -#endif -#if 0 - /* "Too many processes" error */ - rb_define_const(rb_mErrno, "EPROCLIM", eEPROCLIM); -#endif -#ifdef EPROCLIM - defined_error("EPROCLIM", EPROCLIM) -#else - undefined_error("EPROCLIM") -#endif -#if 0 - /* "Bad procedure for program" error */ - rb_define_const(rb_mErrno, "EPROCUNAVAIL", eEPROCUNAVAIL); -#endif -#ifdef EPROCUNAVAIL - defined_error("EPROCUNAVAIL", EPROCUNAVAIL) -#else - undefined_error("EPROCUNAVAIL") -#endif -#if 0 - /* "Program version wrong" error */ - rb_define_const(rb_mErrno, "EPROGMISMATCH", eEPROGMISMATCH); -#endif -#ifdef EPROGMISMATCH - defined_error("EPROGMISMATCH", EPROGMISMATCH) -#else - undefined_error("EPROGMISMATCH") -#endif -#if 0 - /* "RPC program isn't available" error */ - rb_define_const(rb_mErrno, "EPROGUNAVAIL", eEPROGUNAVAIL); -#endif -#ifdef EPROGUNAVAIL - defined_error("EPROGUNAVAIL", EPROGUNAVAIL) -#else - undefined_error("EPROGUNAVAIL") -#endif -#if 0 - /* "Protocol error" error */ - rb_define_const(rb_mErrno, "EPROTO", eEPROTO); -#endif -#ifdef EPROTO - defined_error("EPROTO", EPROTO) -#else - undefined_error("EPROTO") -#endif -#if 0 - /* "Protocol not supported" error */ - rb_define_const(rb_mErrno, "EPROTONOSUPPORT", eEPROTONOSUPPORT); -#endif -#ifdef EPROTONOSUPPORT - defined_error("EPROTONOSUPPORT", EPROTONOSUPPORT) -#else - undefined_error("EPROTONOSUPPORT") -#endif -#if 0 - /* "Protocol wrong type for socket" error */ - rb_define_const(rb_mErrno, "EPROTOTYPE", eEPROTOTYPE); -#endif -#ifdef EPROTOTYPE - defined_error("EPROTOTYPE", EPROTOTYPE) -#else - undefined_error("EPROTOTYPE") -#endif -#if 0 - /* "Device power is off" error */ - rb_define_const(rb_mErrno, "EPWROFF", eEPWROFF); -#endif -#ifdef EPWROFF - defined_error("EPWROFF", EPWROFF) -#else - undefined_error("EPWROFF") -#endif -#if 0 - /* "Interface output queue is full" error */ - rb_define_const(rb_mErrno, "EQFULL", eEQFULL); -#endif -#ifdef EQFULL - defined_error("EQFULL", EQFULL) -#else - undefined_error("EQFULL") -#endif -#if 0 - /* "Result too large" error */ - rb_define_const(rb_mErrno, "ERANGE", eERANGE); -#endif -#ifdef ERANGE - defined_error("ERANGE", ERANGE) -#else - undefined_error("ERANGE") -#endif -#if 0 - /* "Remote address changed" error */ - rb_define_const(rb_mErrno, "EREMCHG", eEREMCHG); -#endif -#ifdef EREMCHG - defined_error("EREMCHG", EREMCHG) -#else - undefined_error("EREMCHG") -#endif -#if 0 - /* "Object is remote" error */ - rb_define_const(rb_mErrno, "EREMOTE", eEREMOTE); -#endif -#ifdef EREMOTE - defined_error("EREMOTE", EREMOTE) -#else - undefined_error("EREMOTE") -#endif -#if 0 - /* "Remote I/O error" error */ - rb_define_const(rb_mErrno, "EREMOTEIO", eEREMOTEIO); -#endif -#ifdef EREMOTEIO - defined_error("EREMOTEIO", EREMOTEIO) -#else - undefined_error("EREMOTEIO") -#endif -#if 0 - /* "Interrupted system call should be restarted" error */ - rb_define_const(rb_mErrno, "ERESTART", eERESTART); -#endif -#ifdef ERESTART - defined_error("ERESTART", ERESTART) -#else - undefined_error("ERESTART") -#endif -#if 0 - /* "Operation not possible due to RF-kill" error */ - rb_define_const(rb_mErrno, "ERFKILL", eERFKILL); -#endif -#ifdef ERFKILL - defined_error("ERFKILL", ERFKILL) -#else - undefined_error("ERFKILL") -#endif -#if 0 - /* "Read-only file system" error */ - rb_define_const(rb_mErrno, "EROFS", eEROFS); -#endif -#ifdef EROFS - defined_error("EROFS", EROFS) -#else - undefined_error("EROFS") -#endif -#if 0 - /* "RPC version wrong" error */ - rb_define_const(rb_mErrno, "ERPCMISMATCH", eERPCMISMATCH); -#endif -#ifdef ERPCMISMATCH - defined_error("ERPCMISMATCH", ERPCMISMATCH) -#else - undefined_error("ERPCMISMATCH") -#endif -#if 0 - /* "Shared library version mismatch" error */ - rb_define_const(rb_mErrno, "ESHLIBVERS", eESHLIBVERS); -#endif -#ifdef ESHLIBVERS - defined_error("ESHLIBVERS", ESHLIBVERS) -#else - undefined_error("ESHLIBVERS") -#endif -#if 0 - /* "Cannot send after transport endpoint shutdown" error */ - rb_define_const(rb_mErrno, "ESHUTDOWN", eESHUTDOWN); -#endif -#ifdef ESHUTDOWN - defined_error("ESHUTDOWN", ESHUTDOWN) -#else - undefined_error("ESHUTDOWN") -#endif -#if 0 - /* "Socket type not supported" error */ - rb_define_const(rb_mErrno, "ESOCKTNOSUPPORT", eESOCKTNOSUPPORT); -#endif -#ifdef ESOCKTNOSUPPORT - defined_error("ESOCKTNOSUPPORT", ESOCKTNOSUPPORT) -#else - undefined_error("ESOCKTNOSUPPORT") -#endif -#if 0 - /* "Illegal seek" error */ - rb_define_const(rb_mErrno, "ESPIPE", eESPIPE); -#endif -#ifdef ESPIPE - defined_error("ESPIPE", ESPIPE) -#else - undefined_error("ESPIPE") -#endif -#if 0 - /* "No such process" error */ - rb_define_const(rb_mErrno, "ESRCH", eESRCH); -#endif -#ifdef ESRCH - defined_error("ESRCH", ESRCH) -#else - undefined_error("ESRCH") -#endif -#if 0 - /* "Server mount error" error */ - rb_define_const(rb_mErrno, "ESRMNT", eESRMNT); -#endif -#ifdef ESRMNT - defined_error("ESRMNT", ESRMNT) -#else - undefined_error("ESRMNT") -#endif -#if 0 - /* "Stale file handle" error */ - rb_define_const(rb_mErrno, "ESTALE", eESTALE); -#endif -#ifdef ESTALE - defined_error("ESTALE", ESTALE) -#else - undefined_error("ESTALE") -#endif -#if 0 - /* "Streams pipe error" error */ - rb_define_const(rb_mErrno, "ESTRPIPE", eESTRPIPE); -#endif -#ifdef ESTRPIPE - defined_error("ESTRPIPE", ESTRPIPE) -#else - undefined_error("ESTRPIPE") -#endif -#if 0 - /* "Timer expired" error */ - rb_define_const(rb_mErrno, "ETIME", eETIME); -#endif -#ifdef ETIME - defined_error("ETIME", ETIME) -#else - undefined_error("ETIME") -#endif -#if 0 - /* "Connection timed out" error */ - rb_define_const(rb_mErrno, "ETIMEDOUT", eETIMEDOUT); -#endif -#ifdef ETIMEDOUT - defined_error("ETIMEDOUT", ETIMEDOUT) -#else - undefined_error("ETIMEDOUT") -#endif -#if 0 - /* "Too many references: cannot splice" error */ - rb_define_const(rb_mErrno, "ETOOMANYREFS", eETOOMANYREFS); -#endif -#ifdef ETOOMANYREFS - defined_error("ETOOMANYREFS", ETOOMANYREFS) -#else - undefined_error("ETOOMANYREFS") -#endif -#if 0 - /* "Text file busy" error */ - rb_define_const(rb_mErrno, "ETXTBSY", eETXTBSY); -#endif -#ifdef ETXTBSY - defined_error("ETXTBSY", ETXTBSY) -#else - undefined_error("ETXTBSY") -#endif -#if 0 - /* "Structure needs cleaning" error */ - rb_define_const(rb_mErrno, "EUCLEAN", eEUCLEAN); -#endif -#ifdef EUCLEAN - defined_error("EUCLEAN", EUCLEAN) -#else - undefined_error("EUCLEAN") -#endif -#if 0 - /* "Protocol driver not attached" error */ - rb_define_const(rb_mErrno, "EUNATCH", eEUNATCH); -#endif -#ifdef EUNATCH - defined_error("EUNATCH", EUNATCH) -#else - undefined_error("EUNATCH") -#endif -#if 0 - /* "Too many users" error */ - rb_define_const(rb_mErrno, "EUSERS", eEUSERS); -#endif -#ifdef EUSERS - defined_error("EUSERS", EUSERS) -#else - undefined_error("EUSERS") -#endif -#if 0 - /* "Operation would block" error */ - rb_define_const(rb_mErrno, "EWOULDBLOCK", eEWOULDBLOCK); -#endif -#ifdef EWOULDBLOCK - defined_error("EWOULDBLOCK", EWOULDBLOCK) -#else - undefined_error("EWOULDBLOCK") -#endif -#if 0 - /* "Invalid cross-device link" error */ - rb_define_const(rb_mErrno, "EXDEV", eEXDEV); -#endif -#ifdef EXDEV - defined_error("EXDEV", EXDEV) -#else - undefined_error("EXDEV") -#endif -#if 0 - /* "Exchange full" error */ - rb_define_const(rb_mErrno, "EXFULL", eEXFULL); -#endif -#ifdef EXFULL - defined_error("EXFULL", EXFULL) -#else - undefined_error("EXFULL") -#endif -#if 0 - /* "Largest errno value" error */ - rb_define_const(rb_mErrno, "ELAST", eELAST); -#endif -#ifdef ELAST - defined_error("ELAST", ELAST) -#else - undefined_error("ELAST") -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/method.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/method.h deleted file mode 100644 index fdc7c26..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/method.h +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef RUBY_METHOD_H -#define RUBY_METHOD_H 1 -/********************************************************************** - - method.h - - - $Author$ - created at: Wed Jul 15 20:02:33 2009 - - Copyright (C) 2009 Koichi Sasada - -**********************************************************************/ - -#include "internal.h" -#include "internal/imemo.h" -#include "internal/compilers.h" -#include "internal/static_assert.h" - -#ifndef END_OF_ENUMERATION -# if defined(__GNUC__) &&! defined(__STRICT_ANSI__) -# define END_OF_ENUMERATION(key) -# else -# define END_OF_ENUMERATION(key) END_OF_##key##_PLACEHOLDER = 0 -# endif -#endif - -/* cref */ - -typedef enum { - METHOD_VISI_UNDEF = 0x00, - METHOD_VISI_PUBLIC = 0x01, - METHOD_VISI_PRIVATE = 0x02, - METHOD_VISI_PROTECTED = 0x03, - - METHOD_VISI_MASK = 0x03 -} rb_method_visibility_t; - -typedef struct rb_scope_visi_struct { - BITFIELD(rb_method_visibility_t, method_visi, 3); - unsigned int module_func : 1; -} rb_scope_visibility_t; - -/*! CREF (Class REFerence) */ -typedef struct rb_cref_struct { - VALUE flags; - VALUE refinements; - VALUE klass_or_self; - struct rb_cref_struct * next; - const rb_scope_visibility_t scope_visi; -} rb_cref_t; - -/* method data type */ - -typedef struct rb_method_entry_struct { - VALUE flags; - VALUE defined_class; - struct rb_method_definition_struct * const def; - ID called_id; - VALUE owner; -} rb_method_entry_t; - -typedef struct rb_callable_method_entry_struct { /* same fields with rb_method_entry_t */ - VALUE flags; - const VALUE defined_class; - struct rb_method_definition_struct * const def; - ID called_id; - const VALUE owner; -} rb_callable_method_entry_t; - -#define METHOD_ENTRY_VISI(me) (rb_method_visibility_t)(((me)->flags & (IMEMO_FL_USER0 | IMEMO_FL_USER1)) >> (IMEMO_FL_USHIFT+0)) -#define METHOD_ENTRY_BASIC(me) (int) (((me)->flags & (IMEMO_FL_USER2 )) >> (IMEMO_FL_USHIFT+2)) -#define METHOD_ENTRY_COMPLEMENTED(me) ((me)->flags & IMEMO_FL_USER3) -#define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags |= IMEMO_FL_USER3) -#define METHOD_ENTRY_CACHED(me) ((me)->flags & IMEMO_FL_USER4) -#define METHOD_ENTRY_CACHED_SET(me) ((me)->flags |= IMEMO_FL_USER4) -#define METHOD_ENTRY_INVALIDATED(me) ((me)->flags & IMEMO_FL_USER5) -#define METHOD_ENTRY_INVALIDATED_SET(me) ((me)->flags |= IMEMO_FL_USER5) - -static inline void -METHOD_ENTRY_VISI_SET(rb_method_entry_t *me, rb_method_visibility_t visi) -{ - VM_ASSERT((int)visi >= 0 && visi <= 3); - me->flags = (me->flags & ~(IMEMO_FL_USER0 | IMEMO_FL_USER1)) | (visi << (IMEMO_FL_USHIFT+0)); -} -static inline void -METHOD_ENTRY_BASIC_SET(rb_method_entry_t *me, unsigned int basic) -{ - VM_ASSERT(basic <= 1); - me->flags = (me->flags & ~(IMEMO_FL_USER2 )) | (basic << (IMEMO_FL_USHIFT+2)); -} -static inline void -METHOD_ENTRY_FLAGS_SET(rb_method_entry_t *me, rb_method_visibility_t visi, unsigned int basic) -{ - VM_ASSERT((int)visi >= 0 && visi <= 3); - VM_ASSERT(basic <= 1); - me->flags = - (me->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2)) | - ((visi << (IMEMO_FL_USHIFT+0)) | (basic << (IMEMO_FL_USHIFT+2))); -} -static inline void -METHOD_ENTRY_FLAGS_COPY(rb_method_entry_t *dst, const rb_method_entry_t *src) -{ - dst->flags = - (dst->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2 - |IMEMO_FL_USER3)) | - (src->flags & (IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2|IMEMO_FL_USER3)); -} - -typedef enum { - VM_METHOD_TYPE_ISEQ, /*!< Ruby method */ - VM_METHOD_TYPE_CFUNC, /*!< C method */ - VM_METHOD_TYPE_ATTRSET, /*!< attr_writer or attr_accessor */ - VM_METHOD_TYPE_IVAR, /*!< attr_reader or attr_accessor */ - VM_METHOD_TYPE_BMETHOD, - VM_METHOD_TYPE_ZSUPER, - VM_METHOD_TYPE_ALIAS, - VM_METHOD_TYPE_UNDEF, - VM_METHOD_TYPE_NOTIMPLEMENTED, - VM_METHOD_TYPE_OPTIMIZED, /*!< Kernel#send, Proc#call, etc */ - VM_METHOD_TYPE_MISSING, /*!< wrapper for method_missing(id) */ - VM_METHOD_TYPE_REFINED, /*!< refinement */ - - END_OF_ENUMERATION(VM_METHOD_TYPE) -} rb_method_type_t; -#define VM_METHOD_TYPE_MINIMUM_BITS 4 -STATIC_ASSERT(VM_METHOD_TYPE_MINIMUM_BITS, - VM_METHOD_TYPE_REFINED <= (1<klass is original owner */ -} rb_method_alias_t; - -typedef struct rb_method_refined_struct { - struct rb_method_entry_struct * orig_me; -} rb_method_refined_t; - -typedef struct rb_method_bmethod_struct { - VALUE proc; /* should be marked */ - struct rb_hook_list_struct *hooks; - VALUE defined_ractor; -} rb_method_bmethod_t; - -enum method_optimized_type { - OPTIMIZED_METHOD_TYPE_SEND, - OPTIMIZED_METHOD_TYPE_CALL, - OPTIMIZED_METHOD_TYPE_BLOCK_CALL, - OPTIMIZED_METHOD_TYPE_STRUCT_AREF, - OPTIMIZED_METHOD_TYPE_STRUCT_ASET, - OPTIMIZED_METHOD_TYPE__MAX -}; - -typedef struct rb_method_optimized { - enum method_optimized_type type; - unsigned int index; -} rb_method_optimized_t; - -struct rb_method_definition_struct { - BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS); - unsigned int iseq_overload: 1; - unsigned int no_redef_warning: 1; - unsigned int aliased : 1; - int reference_count : 28; - - union { - rb_method_iseq_t iseq; - rb_method_cfunc_t cfunc; - rb_method_attr_t attr; - rb_method_alias_t alias; - rb_method_refined_t refined; - rb_method_bmethod_t bmethod; - rb_method_optimized_t optimized; - } body; - - ID original_id; - uintptr_t method_serial; -}; - -struct rb_id_table; - -typedef struct rb_method_definition_struct rb_method_definition_t; -STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8); - -#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF) -#define UNDEFINED_REFINED_METHOD_P(def) \ - ((def)->type == VM_METHOD_TYPE_REFINED && \ - UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me)) - -void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi); -void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi); -void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi); -void rb_add_method_optimized(VALUE klass, ID mid, enum method_optimized_type, unsigned int index, rb_method_visibility_t visi); -void rb_add_refined_method_entry(VALUE refined_class, ID mid); - -rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex); -rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, rb_method_definition_t *def); - -const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id); - -const rb_method_entry_t *rb_method_entry(VALUE klass, ID id); -const rb_method_entry_t *rb_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class); -const rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class); -const rb_method_entry_t *rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me); -RUBY_SYMBOL_EXPORT_BEGIN -const rb_method_entry_t *rb_resolve_me_location(const rb_method_entry_t *, VALUE[5]); -RUBY_SYMBOL_EXPORT_END - -const rb_callable_method_entry_t *rb_callable_method_entry(VALUE klass, ID id); -const rb_callable_method_entry_t *rb_callable_method_entry_or_negative(VALUE klass, ID id); -const rb_callable_method_entry_t *rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class); -const rb_callable_method_entry_t *rb_callable_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class); - -int rb_method_entry_arity(const rb_method_entry_t *me); -int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2); -st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me); - -VALUE rb_method_entry_location(const rb_method_entry_t *me); - -void rb_free_method_entry(const rb_method_entry_t *me); - -const rb_method_entry_t *rb_method_entry_clone(const rb_method_entry_t *me); -const rb_callable_method_entry_t *rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID called_id, VALUE defined_class); -void rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src); - -void rb_method_table_insert(VALUE klass, struct rb_id_table *table, ID method_id, const rb_method_entry_t *me); - -void rb_scope_visibility_set(rb_method_visibility_t); - -VALUE rb_unnamed_parameters(int arity); - -void rb_clear_method_cache(VALUE klass_or_module, ID mid); -void rb_clear_all_refinement_method_cache(void); - -#endif /* RUBY_METHOD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node.h deleted file mode 100644 index 1e411f2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef RUBY_NODE_H -#define RUBY_NODE_H 1 -/********************************************************************** - - node.h - - - $Author$ - created at: Fri May 28 15:14:02 JST 1993 - - Copyright (C) 1993-2007 Yukihiro Matsumoto - -**********************************************************************/ - -#include -#include "rubyparser.h" -#include "ruby/backward/2/attributes.h" - -typedef void (*bug_report_func)(const char *fmt, ...) RUBYPARSER_ATTRIBUTE_FORMAT(1, 2); -typedef struct node_buffer_elem_struct { - struct node_buffer_elem_struct *next; - long len; /* Length of nodes */ - size_t allocated; /* Total memory size of allocated buf */ - size_t used; /* Current usage of buf */ - NODE **nodes; /* Array of node pointers */ - NODE *buf[FLEX_ARY_LEN]; -} node_buffer_elem_t; - -typedef struct { - node_buffer_elem_t *head; - node_buffer_elem_t *last; -} node_buffer_list_t; - -struct node_buffer_struct { - node_buffer_list_t buffer_list; - struct rb_ast_local_table_link *local_tables; - // - id (sequence number) - // - token_type - // - text of token - // - location info - // Array, whose entry is array - rb_parser_ary_t *tokens; -}; - -RUBY_SYMBOL_EXPORT_BEGIN - -#ifdef UNIVERSAL_PARSER -rb_ast_t *rb_ast_new(const rb_parser_config_t *config); -#else -rb_ast_t *rb_ast_new(void); -#endif -size_t rb_ast_memsize(const rb_ast_t*); -void rb_ast_dispose(rb_ast_t*); -const char *ruby_node_name(int node); -void rb_node_init(NODE *n, enum node_type type); - -void rb_ast_update_references(rb_ast_t*); -void rb_ast_free(rb_ast_t*); -NODE *rb_ast_newnode(rb_ast_t*, enum node_type type, size_t size, size_t alignment); -void rb_ast_delete_node(rb_ast_t*, NODE *n); -rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int); -rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int); - -VALUE rb_parser_dump_tree(const NODE *node, int comment); - -const struct kwtable *rb_reserved_word(const char *, unsigned int); - -struct parser_params; -PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3); -VALUE rb_node_set_type(NODE *n, enum node_type t); - -RUBY_SYMBOL_EXPORT_END - -#define NODE_LSHIFT (NODE_TYPESHIFT+7) -#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1) - -#define nd_line(n) (int)(((SIGNED_VALUE)(n)->flags)>>NODE_LSHIFT) -#define nd_set_line(n,l) \ - (n)->flags=(((n)->flags&~((VALUE)(-1)<nd_loc) -#define nd_first_column(n) ((int)(RNODE(n)->nd_loc.beg_pos.column)) -#define nd_set_first_column(n, v) (RNODE(n)->nd_loc.beg_pos.column = (v)) -#define nd_first_lineno(n) ((int)(RNODE(n)->nd_loc.beg_pos.lineno)) -#define nd_set_first_lineno(n, v) (RNODE(n)->nd_loc.beg_pos.lineno = (v)) -#define nd_first_loc(n) (RNODE(n)->nd_loc.beg_pos) -#define nd_set_first_loc(n, v) (nd_first_loc(n) = (v)) - -#define nd_last_column(n) ((int)(RNODE(n)->nd_loc.end_pos.column)) -#define nd_set_last_column(n, v) (RNODE(n)->nd_loc.end_pos.column = (v)) -#define nd_last_lineno(n) ((int)(RNODE(n)->nd_loc.end_pos.lineno)) -#define nd_set_last_lineno(n, v) (RNODE(n)->nd_loc.end_pos.lineno = (v)) -#define nd_last_loc(n) (RNODE(n)->nd_loc.end_pos) -#define nd_set_last_loc(n, v) (nd_last_loc(n) = (v)) -#define nd_node_id(n) (RNODE(n)->node_id) -#define nd_set_node_id(n,id) (RNODE(n)->node_id = (id)) - -static inline bool -nd_type_p(const NODE *n, enum node_type t) -{ - return (enum node_type)nd_type(n) == t; -} - -#endif /* RUBY_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node_name.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node_name.inc deleted file mode 100644 index 626da27..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node_name.inc +++ /dev/null @@ -1,224 +0,0 @@ - case NODE_SCOPE: - return "NODE_SCOPE"; - case NODE_BLOCK: - return "NODE_BLOCK"; - case NODE_IF: - return "NODE_IF"; - case NODE_UNLESS: - return "NODE_UNLESS"; - case NODE_CASE: - return "NODE_CASE"; - case NODE_CASE2: - return "NODE_CASE2"; - case NODE_CASE3: - return "NODE_CASE3"; - case NODE_WHEN: - return "NODE_WHEN"; - case NODE_IN: - return "NODE_IN"; - case NODE_WHILE: - return "NODE_WHILE"; - case NODE_UNTIL: - return "NODE_UNTIL"; - case NODE_ITER: - return "NODE_ITER"; - case NODE_FOR: - return "NODE_FOR"; - case NODE_FOR_MASGN: - return "NODE_FOR_MASGN"; - case NODE_BREAK: - return "NODE_BREAK"; - case NODE_NEXT: - return "NODE_NEXT"; - case NODE_REDO: - return "NODE_REDO"; - case NODE_RETRY: - return "NODE_RETRY"; - case NODE_BEGIN: - return "NODE_BEGIN"; - case NODE_RESCUE: - return "NODE_RESCUE"; - case NODE_RESBODY: - return "NODE_RESBODY"; - case NODE_ENSURE: - return "NODE_ENSURE"; - case NODE_AND: - return "NODE_AND"; - case NODE_OR: - return "NODE_OR"; - case NODE_MASGN: - return "NODE_MASGN"; - case NODE_LASGN: - return "NODE_LASGN"; - case NODE_DASGN: - return "NODE_DASGN"; - case NODE_GASGN: - return "NODE_GASGN"; - case NODE_IASGN: - return "NODE_IASGN"; - case NODE_CDECL: - return "NODE_CDECL"; - case NODE_CVASGN: - return "NODE_CVASGN"; - case NODE_OP_ASGN1: - return "NODE_OP_ASGN1"; - case NODE_OP_ASGN2: - return "NODE_OP_ASGN2"; - case NODE_OP_ASGN_AND: - return "NODE_OP_ASGN_AND"; - case NODE_OP_ASGN_OR: - return "NODE_OP_ASGN_OR"; - case NODE_OP_CDECL: - return "NODE_OP_CDECL"; - case NODE_CALL: - return "NODE_CALL"; - case NODE_OPCALL: - return "NODE_OPCALL"; - case NODE_FCALL: - return "NODE_FCALL"; - case NODE_VCALL: - return "NODE_VCALL"; - case NODE_QCALL: - return "NODE_QCALL"; - case NODE_SUPER: - return "NODE_SUPER"; - case NODE_ZSUPER: - return "NODE_ZSUPER"; - case NODE_LIST: - return "NODE_LIST"; - case NODE_ZLIST: - return "NODE_ZLIST"; - case NODE_HASH: - return "NODE_HASH"; - case NODE_RETURN: - return "NODE_RETURN"; - case NODE_YIELD: - return "NODE_YIELD"; - case NODE_LVAR: - return "NODE_LVAR"; - case NODE_DVAR: - return "NODE_DVAR"; - case NODE_GVAR: - return "NODE_GVAR"; - case NODE_IVAR: - return "NODE_IVAR"; - case NODE_CONST: - return "NODE_CONST"; - case NODE_CVAR: - return "NODE_CVAR"; - case NODE_NTH_REF: - return "NODE_NTH_REF"; - case NODE_BACK_REF: - return "NODE_BACK_REF"; - case NODE_MATCH: - return "NODE_MATCH"; - case NODE_MATCH2: - return "NODE_MATCH2"; - case NODE_MATCH3: - return "NODE_MATCH3"; - case NODE_INTEGER: - return "NODE_INTEGER"; - case NODE_FLOAT: - return "NODE_FLOAT"; - case NODE_RATIONAL: - return "NODE_RATIONAL"; - case NODE_IMAGINARY: - return "NODE_IMAGINARY"; - case NODE_STR: - return "NODE_STR"; - case NODE_DSTR: - return "NODE_DSTR"; - case NODE_XSTR: - return "NODE_XSTR"; - case NODE_DXSTR: - return "NODE_DXSTR"; - case NODE_EVSTR: - return "NODE_EVSTR"; - case NODE_REGX: - return "NODE_REGX"; - case NODE_DREGX: - return "NODE_DREGX"; - case NODE_ONCE: - return "NODE_ONCE"; - case NODE_ARGS: - return "NODE_ARGS"; - case NODE_ARGS_AUX: - return "NODE_ARGS_AUX"; - case NODE_OPT_ARG: - return "NODE_OPT_ARG"; - case NODE_KW_ARG: - return "NODE_KW_ARG"; - case NODE_POSTARG: - return "NODE_POSTARG"; - case NODE_ARGSCAT: - return "NODE_ARGSCAT"; - case NODE_ARGSPUSH: - return "NODE_ARGSPUSH"; - case NODE_SPLAT: - return "NODE_SPLAT"; - case NODE_BLOCK_PASS: - return "NODE_BLOCK_PASS"; - case NODE_DEFN: - return "NODE_DEFN"; - case NODE_DEFS: - return "NODE_DEFS"; - case NODE_ALIAS: - return "NODE_ALIAS"; - case NODE_VALIAS: - return "NODE_VALIAS"; - case NODE_UNDEF: - return "NODE_UNDEF"; - case NODE_CLASS: - return "NODE_CLASS"; - case NODE_MODULE: - return "NODE_MODULE"; - case NODE_SCLASS: - return "NODE_SCLASS"; - case NODE_COLON2: - return "NODE_COLON2"; - case NODE_COLON3: - return "NODE_COLON3"; - case NODE_DOT2: - return "NODE_DOT2"; - case NODE_DOT3: - return "NODE_DOT3"; - case NODE_FLIP2: - return "NODE_FLIP2"; - case NODE_FLIP3: - return "NODE_FLIP3"; - case NODE_SELF: - return "NODE_SELF"; - case NODE_NIL: - return "NODE_NIL"; - case NODE_TRUE: - return "NODE_TRUE"; - case NODE_FALSE: - return "NODE_FALSE"; - case NODE_ERRINFO: - return "NODE_ERRINFO"; - case NODE_DEFINED: - return "NODE_DEFINED"; - case NODE_POSTEXE: - return "NODE_POSTEXE"; - case NODE_SYM: - return "NODE_SYM"; - case NODE_DSYM: - return "NODE_DSYM"; - case NODE_ATTRASGN: - return "NODE_ATTRASGN"; - case NODE_LAMBDA: - return "NODE_LAMBDA"; - case NODE_ARYPTN: - return "NODE_ARYPTN"; - case NODE_HSHPTN: - return "NODE_HSHPTN"; - case NODE_FNDPTN: - return "NODE_FNDPTN"; - case NODE_ERROR: - return "NODE_ERROR"; - case NODE_LINE: - return "NODE_LINE"; - case NODE_FILE: - return "NODE_FILE"; - case NODE_ENCODING: - return "NODE_ENCODING"; diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc deleted file mode 100644 index 2f8c0b2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/optinsn.inc.erb" - or tool/insns2vm.rb - */ - -static INSN * -insn_operands_unification(INSN *iobj) -{ -#ifdef OPT_OPERANDS_UNIFICATION - VALUE *op = iobj->operands; - - switch (iobj->insn_id) { - default: - /* do nothing */; - break; - - case BIN(getlocal): - - /* getlocal_WC_0(idx)()(val) */ - if ( op[1] == LONG2NUM(0) ) { - iobj->insn_id = BIN(getlocal_WC_0); - iobj->operand_size = 1; - break; - } - - /* getlocal_WC_1(idx)()(val) */ - if ( op[1] == LONG2NUM(1) ) { - iobj->insn_id = BIN(getlocal_WC_1); - iobj->operand_size = 1; - break; - } - - break; - case BIN(setlocal): - - /* setlocal_WC_0(idx)(val)() */ - if ( op[1] == LONG2NUM(0) ) { - iobj->insn_id = BIN(setlocal_WC_0); - iobj->operand_size = 1; - break; - } - - /* setlocal_WC_1(idx)(val)() */ - if ( op[1] == LONG2NUM(1) ) { - iobj->insn_id = BIN(setlocal_WC_1); - iobj->operand_size = 1; - break; - } - - break; - case BIN(putobject): - - /* putobject_INT2FIX_0_()()(val) */ - if ( op[0] == INT2FIX(0) ) { - iobj->insn_id = BIN(putobject_INT2FIX_0_); - iobj->operand_size = 0; - break; - } - - /* putobject_INT2FIX_1_()()(val) */ - if ( op[0] == INT2FIX(1) ) { - iobj->insn_id = BIN(putobject_INT2FIX_1_); - iobj->operand_size = 0; - break; - } - - break; - } -#endif - return iobj; -} - -int -rb_insn_unified_local_var_level(VALUE insn) -{ -#ifdef OPT_OPERANDS_UNIFICATION - /* optimize rule */ - switch (insn) { - default: - return -1; /* do nothing */; - case BIN(getlocal_WC_0): - return 0; - case BIN(getlocal_WC_1): - return 1; - case BIN(setlocal_WC_0): - return 0; - case BIN(setlocal_WC_1): - return 1; - case BIN(putobject_INT2FIX_0_): - return INT2FIX(0); - case BIN(putobject_INT2FIX_1_): - return INT2FIX(1); - } -#endif - return -1; -} diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optunifs.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optunifs.inc deleted file mode 100644 index 7339616..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optunifs.inc +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/optunifs.inc.erb" - or tool/insns2vm.rb - */ - -/* Let .bss section automatically initialize this variable */ -/* cf. Section 6.7.8 of ISO/IEC 9899:1999 */ -static const int *const *const unified_insns_data[218]; - -ASSERT_VM_INSTRUCTION_SIZE(unified_insns_data); diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parse.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parse.h deleted file mode 100644 index 4c001f2..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parse.h +++ /dev/null @@ -1,244 +0,0 @@ -/* A Bison parser, made by Lrama 0.6.10. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ -#ifndef YY_YY_PARSE_H_INCLUDED -# define YY_YY_PARSE_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG && !defined(yydebug) -extern int yydebug; -#endif - - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - END_OF_INPUT = 0, /* "end-of-input" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - keyword_class = 258, /* "'class'" */ - keyword_module = 259, /* "'module'" */ - keyword_def = 260, /* "'def'" */ - keyword_undef = 261, /* "'undef'" */ - keyword_begin = 262, /* "'begin'" */ - keyword_rescue = 263, /* "'rescue'" */ - keyword_ensure = 264, /* "'ensure'" */ - keyword_end = 265, /* "'end'" */ - keyword_if = 266, /* "'if'" */ - keyword_unless = 267, /* "'unless'" */ - keyword_then = 268, /* "'then'" */ - keyword_elsif = 269, /* "'elsif'" */ - keyword_else = 270, /* "'else'" */ - keyword_case = 271, /* "'case'" */ - keyword_when = 272, /* "'when'" */ - keyword_while = 273, /* "'while'" */ - keyword_until = 274, /* "'until'" */ - keyword_for = 275, /* "'for'" */ - keyword_break = 276, /* "'break'" */ - keyword_next = 277, /* "'next'" */ - keyword_redo = 278, /* "'redo'" */ - keyword_retry = 279, /* "'retry'" */ - keyword_in = 280, /* "'in'" */ - keyword_do = 281, /* "'do'" */ - keyword_do_cond = 282, /* "'do' for condition" */ - keyword_do_block = 283, /* "'do' for block" */ - keyword_do_LAMBDA = 284, /* "'do' for lambda" */ - keyword_return = 285, /* "'return'" */ - keyword_yield = 286, /* "'yield'" */ - keyword_super = 287, /* "'super'" */ - keyword_self = 288, /* "'self'" */ - keyword_nil = 289, /* "'nil'" */ - keyword_true = 290, /* "'true'" */ - keyword_false = 291, /* "'false'" */ - keyword_and = 292, /* "'and'" */ - keyword_or = 293, /* "'or'" */ - keyword_not = 294, /* "'not'" */ - modifier_if = 295, /* "'if' modifier" */ - modifier_unless = 296, /* "'unless' modifier" */ - modifier_while = 297, /* "'while' modifier" */ - modifier_until = 298, /* "'until' modifier" */ - modifier_rescue = 299, /* "'rescue' modifier" */ - keyword_alias = 300, /* "'alias'" */ - keyword_defined = 301, /* "'defined?'" */ - keyword_BEGIN = 302, /* "'BEGIN'" */ - keyword_END = 303, /* "'END'" */ - keyword__LINE__ = 304, /* "'__LINE__'" */ - keyword__FILE__ = 305, /* "'__FILE__'" */ - keyword__ENCODING__ = 306, /* "'__ENCODING__'" */ - tIDENTIFIER = 307, /* "local variable or method" */ - tFID = 308, /* "method" */ - tGVAR = 309, /* "global variable" */ - tIVAR = 310, /* "instance variable" */ - tCONSTANT = 311, /* "constant" */ - tCVAR = 312, /* "class variable" */ - tLABEL = 313, /* "label" */ - tINTEGER = 314, /* "integer literal" */ - tFLOAT = 315, /* "float literal" */ - tRATIONAL = 316, /* "rational literal" */ - tIMAGINARY = 317, /* "imaginary literal" */ - tCHAR = 318, /* "char literal" */ - tNTH_REF = 319, /* "numbered reference" */ - tBACK_REF = 320, /* "back reference" */ - tSTRING_CONTENT = 321, /* "literal content" */ - tREGEXP_END = 322, /* tREGEXP_END */ - tDUMNY_END = 323, /* "dummy end" */ - tSP = 324, /* "escaped space" */ - tUPLUS = 132, /* "unary+" */ - tUMINUS = 133, /* "unary-" */ - tPOW = 134, /* "**" */ - tCMP = 135, /* "<=>" */ - tEQ = 140, /* "==" */ - tEQQ = 141, /* "===" */ - tNEQ = 142, /* "!=" */ - tGEQ = 139, /* ">=" */ - tLEQ = 138, /* "<=" */ - tANDOP = 148, /* "&&" */ - tOROP = 149, /* "||" */ - tMATCH = 143, /* "=~" */ - tNMATCH = 144, /* "!~" */ - tDOT2 = 128, /* ".." */ - tDOT3 = 129, /* "..." */ - tBDOT2 = 130, /* "(.." */ - tBDOT3 = 131, /* "(..." */ - tAREF = 145, /* "[]" */ - tASET = 146, /* "[]=" */ - tLSHFT = 136, /* "<<" */ - tRSHFT = 137, /* ">>" */ - tANDDOT = 150, /* "&." */ - tCOLON2 = 147, /* "::" */ - tCOLON3 = 325, /* ":: at EXPR_BEG" */ - tOP_ASGN = 326, /* "operator-assignment" */ - tASSOC = 327, /* "=>" */ - tLPAREN = 328, /* "(" */ - tLPAREN_ARG = 329, /* "( arg" */ - tRPAREN = 330, /* ")" */ - tLBRACK = 331, /* "[" */ - tLBRACE = 332, /* "{" */ - tLBRACE_ARG = 333, /* "{ arg" */ - tSTAR = 334, /* "*" */ - tDSTAR = 335, /* "**arg" */ - tAMPER = 336, /* "&" */ - tLAMBDA = 337, /* "->" */ - tSYMBEG = 338, /* "symbol literal" */ - tSTRING_BEG = 339, /* "string literal" */ - tXSTRING_BEG = 340, /* "backtick literal" */ - tREGEXP_BEG = 341, /* "regexp literal" */ - tWORDS_BEG = 342, /* "word list" */ - tQWORDS_BEG = 343, /* "verbatim word list" */ - tSYMBOLS_BEG = 344, /* "symbol list" */ - tQSYMBOLS_BEG = 345, /* "verbatim symbol list" */ - tSTRING_END = 346, /* "terminator" */ - tSTRING_DEND = 347, /* "'}'" */ - tSTRING_DBEG = 348, /* "'#{'" */ - tSTRING_DVAR = 349, /* tSTRING_DVAR */ - tLAMBEG = 350, /* tLAMBEG */ - tLABEL_END = 351, /* tLABEL_END */ - tIGNORED_NL = 352, /* tIGNORED_NL */ - tCOMMENT = 353, /* tCOMMENT */ - tEMBDOC_BEG = 354, /* tEMBDOC_BEG */ - tEMBDOC = 355, /* tEMBDOC */ - tEMBDOC_END = 356, /* tEMBDOC_END */ - tHEREDOC_BEG = 357, /* tHEREDOC_BEG */ - tHEREDOC_END = 358, /* tHEREDOC_END */ - k__END__ = 359, /* k__END__ */ - tLOWEST = 360, /* tLOWEST */ - tUMINUS_NUM = 361, /* tUMINUS_NUM */ - tLAST_TOKEN = 362 /* tLAST_TOKEN */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 2668 "parse.y" - - NODE *node; - rb_node_fcall_t *node_fcall; - rb_node_args_t *node_args; - rb_node_args_aux_t *node_args_aux; - rb_node_opt_arg_t *node_opt_arg; - rb_node_kw_arg_t *node_kw_arg; - rb_node_block_pass_t *node_block_pass; - rb_node_masgn_t *node_masgn; - rb_node_def_temp_t *node_def_temp; - rb_node_exits_t *node_exits; - ID id; - int num; - st_table *tbl; - st_table *labels; - const struct vtable *vars; - struct rb_strterm_struct *strterm; - struct lex_context ctxt; - enum lex_state_e state; - -#line 215 "parse.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE YYLTYPE; -struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - - - -int yyparse (struct parser_params *p); - - - -#endif /* !YY_YY_PARSE_H_INCLUDED */ - diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h deleted file mode 100644 index ca75352..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h +++ /dev/null @@ -1,564 +0,0 @@ -#ifndef INTERNAL_BITS2_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_BITS2_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for bitwise integer algorithms. - * @see Henry S. Warren Jr., "Hacker's Delight" (2nd ed.), 2013. - * @see SEI CERT C Coding Standard INT32-C. "Ensure that operations on - * signed integers do not result in overflow" - * @see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateleft - * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateright - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/byteswap-uint64-byteswap-ulong-byteswap-ushort - * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/rotl-rotl64-rotr-rotr64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/lzcnt16-lzcnt-lzcnt64 - * @see https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_tzcnt_u32 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotl64 - * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotr64 - * @see https://stackoverflow.com/a/776523 - */ -#include "ruby/internal/config.h" -#include /* for CHAR_BITS */ -#include /* for uintptr_t */ -#include "internal/compilers.h" /* for MSC_VERSION_SINCE */ - -#if MSC_VERSION_SINCE(1310) -# include /* for _byteswap_uint64 */ -#endif - -#if defined(HAVE_X86INTRIN_H) -# include /* for _lzcnt_u64 */ -#elif MSC_VERSION_SINCE(1310) -# include /* for the following intrinsics */ -#endif - -#if defined(_MSC_VER) && defined(__AVX__) -# pragma intrinsic(__popcnt) -# pragma intrinsic(__popcnt64) -#endif - -#if defined(_MSC_VER) && defined(__AVX2__) -# pragma intrinsic(__lzcnt) -# pragma intrinsic(__lzcnt64) -#endif - -#if MSC_VERSION_SINCE(1310) -# pragma intrinsic(_rotl) -# pragma intrinsic(_rotr) -# ifdef _WIN64 -# pragma intrinsic(_rotl64) -# pragma intrinsic(_rotr64) -# endif -#endif - -#if MSC_VERSION_SINCE(1400) -# pragma intrinsic(_BitScanForward) -# pragma intrinsic(_BitScanReverse) -# ifdef _WIN64 -# pragma intrinsic(_BitScanForward64) -# pragma intrinsic(_BitScanReverse64) -# endif -#endif - -#include "parser_value.h" /* for VALUE */ -#include "internal/static_assert.h" /* for STATIC_ASSERT */ - -/* The most significant bit of the lower part of half-long integer. - * If sizeof(long) == 4, this is 0x8000. - * If sizeof(long) == 8, this is 0x80000000. - */ -#define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2)) - -#define SIGNED_INTEGER_TYPE_P(T) (0 > ((T)0)-1) - -#define SIGNED_INTEGER_MIN(T) \ - ((sizeof(T) == sizeof(int8_t)) ? ((T)INT8_MIN) : \ - ((sizeof(T) == sizeof(int16_t)) ? ((T)INT16_MIN) : \ - ((sizeof(T) == sizeof(int32_t)) ? ((T)INT32_MIN) : \ - ((sizeof(T) == sizeof(int64_t)) ? ((T)INT64_MIN) : \ - 0)))) - -#define SIGNED_INTEGER_MAX(T) ((T)(SIGNED_INTEGER_MIN(T) ^ ((T)~(T)0))) - -#define UNSIGNED_INTEGER_MAX(T) ((T)~(T)0) - -#if __has_builtin(__builtin_mul_overflow_p) -# define MUL_OVERFLOW_P(a, b) \ - __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0) -#elif __has_builtin(__builtin_mul_overflow) -# define MUL_OVERFLOW_P(a, b) \ - __extension__ ({ __typeof__(a) c; __builtin_mul_overflow((a), (b), &c); }) -#endif - -#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \ - (a) == 0 ? 0 : \ - (a) == -1 ? (b) < -(max) : \ - (a) > 0 ? \ - ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \ - ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b))) - -#if __has_builtin(__builtin_mul_overflow_p) -/* __builtin_mul_overflow_p can take bitfield */ -/* and GCC permits bitfields for integers other than int */ -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - __extension__ ({ \ - struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \ - __builtin_mul_overflow_p((a), (b), c.fixnum); \ - }) -#else -# define MUL_OVERFLOW_FIXNUM_P(a, b) \ - MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX) -#endif - -#ifdef MUL_OVERFLOW_P -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b) -#else -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) -# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX) -# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX) -#endif - -#ifdef HAVE_UINT128_T -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - sizeof(x) <= sizeof(int64_t) ? 64 - nlz_int64((uint64_t)(x)) : \ - 128 - nlz_int128((uint128_t)(x))) -#else -# define bit_length(x) \ - (unsigned int) \ - (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ - 64 - nlz_int64((uint64_t)(x))) -#endif - -#ifndef swap16 -# define swap16 ruby_swap16 -#endif - -#ifndef swap32 -# define swap32 ruby_swap32 -#endif - -#ifndef swap64 -# define swap64 ruby_swap64 -#endif - -static inline uint16_t ruby_swap16(uint16_t); -static inline uint32_t ruby_swap32(uint32_t); -static inline uint64_t ruby_swap64(uint64_t); -static inline unsigned nlz_int(unsigned x); -static inline unsigned nlz_long(unsigned long x); -static inline unsigned nlz_long_long(unsigned long long x); -static inline unsigned nlz_intptr(uintptr_t x); -static inline unsigned nlz_int32(uint32_t x); -static inline unsigned nlz_int64(uint64_t x); -#ifdef HAVE_UINT128_T -static inline unsigned nlz_int128(uint128_t x); -#endif -static inline unsigned rb_popcount32(uint32_t x); -static inline unsigned rb_popcount64(uint64_t x); -static inline unsigned rb_popcount_intptr(uintptr_t x); -static inline int ntz_int32(uint32_t x); -static inline int ntz_int64(uint64_t x); -static inline int ntz_intptr(uintptr_t x); -static inline VALUE RUBY_BIT_ROTL(VALUE, int); -static inline VALUE RUBY_BIT_ROTR(VALUE, int); - -static inline uint16_t -ruby_swap16(uint16_t x) -{ -#if __has_builtin(__builtin_bswap16) - return __builtin_bswap16(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ushort(x); - -#else - return (x << 8) | (x >> 8); - -#endif -} - -static inline uint32_t -ruby_swap32(uint32_t x) -{ -#if __has_builtin(__builtin_bswap32) - return __builtin_bswap32(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_ulong(x); - -#else - x = ((x & 0x0000FFFF) << 16) | ((x & 0xFFFF0000) >> 16); - x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >> 8); - return x; - -#endif -} - -static inline uint64_t -ruby_swap64(uint64_t x) -{ -#if __has_builtin(__builtin_bswap64) - return __builtin_bswap64(x); - -#elif MSC_VERSION_SINCE(1310) - return _byteswap_uint64(x); - -#else - x = ((x & 0x00000000FFFFFFFFULL) << 32) | ((x & 0xFFFFFFFF00000000ULL) >> 32); - x = ((x & 0x0000FFFF0000FFFFULL) << 16) | ((x & 0xFFFF0000FFFF0000ULL) >> 16); - x = ((x & 0x00FF00FF00FF00FFULL) << 8) | ((x & 0xFF00FF00FF00FF00ULL) >> 8); - return x; - -#endif -} - -static inline unsigned int -nlz_int32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - /* Note: It seems there is no such thing like __LZCNT__ predefined in MSVC. - * AMD CPUs have had this instruction for decades (since K10) but for - * Intel, Haswell is the oldest one. We need to use __AVX2__ for maximum - * safety. */ - return (unsigned int)__lzcnt(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse(&r, x) ? (31 - (int)r) : 32; - -#elif __has_builtin(__builtin_clz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned int)__builtin_clz(x) : 32; - -#else - uint32_t y; - unsigned n = 32; - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); -#endif -} - -static inline unsigned int -nlz_int64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX2__) - return (unsigned int)__lzcnt64(x); - -#elif defined(__x86_64__) && defined(__LZCNT__) - return (unsigned int)_lzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ - unsigned long r; - return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64; - -#elif __has_builtin(__builtin_clzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_clzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - uint64_t y; - unsigned int n = 64; - y = x >> 32; if (y) {n -= 32; x = y;} - y = x >> 16; if (y) {n -= 16; x = y;} - y = x >> 8; if (y) {n -= 8; x = y;} - y = x >> 4; if (y) {n -= 4; x = y;} - y = x >> 2; if (y) {n -= 2; x = y;} - y = x >> 1; if (y) {return n - 2;} - return (unsigned int)(n - x); - -#endif -} - -#ifdef HAVE_UINT128_T -static inline unsigned int -nlz_int128(uint128_t x) -{ - uint64_t y = (uint64_t)(x >> 64); - - if (x == 0) { - return 128; - } - else if (y == 0) { - return (unsigned int)nlz_int64(x) + 64; - } - else { - return (unsigned int)nlz_int64(y); - } -} -#endif - -static inline unsigned int -nlz_int(unsigned int x) -{ - if (sizeof(unsigned int) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned int) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long(unsigned long x) -{ - if (sizeof(unsigned long) * CHAR_BIT == 32) { - return nlz_int32((uint32_t)x); - } - else if (sizeof(unsigned long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_long_long(unsigned long long x) -{ - if (sizeof(unsigned long long) * CHAR_BIT == 64) { - return nlz_int64((uint64_t)x); - } -#ifdef HAVE_UINT128_T - else if (sizeof(unsigned long long) * CHAR_BIT == 128) { - return nlz_int128((uint128_t)x); - } -#endif - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -nlz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) == sizeof(unsigned int)) { - return nlz_int((unsigned int)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long)) { - return nlz_long((unsigned long)x); - } - if (sizeof(uintptr_t) == sizeof(unsigned long long)) { - return nlz_long_long((unsigned long long)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline unsigned int -rb_popcount32(uint32_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - /* Note: CPUs since Nehalem and Barcelona have had this instruction so SSE - * 4.2 should suffice, but it seems there is no such thing like __SSE_4_2__ - * predefined macro in MSVC. They do have __AVX__ so use it instead. */ - return (unsigned int)__popcnt(x); - -#elif __has_builtin(__builtin_popcount) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT >= 32); - return (unsigned int)__builtin_popcount(x); - -#else - x = (x & 0x55555555) + (x >> 1 & 0x55555555); - x = (x & 0x33333333) + (x >> 2 & 0x33333333); - x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f); - x = (x & 0x001f001f) + (x >> 8 & 0x001f001f); - x = (x & 0x0000003f) + (x >>16 & 0x0000003f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount64(uint64_t x) -{ -#if defined(_MSC_VER) && defined(__AVX__) - return (unsigned int)__popcnt64(x); - -#elif __has_builtin(__builtin_popcount) - if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned int)__builtin_popcountll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555); - x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333); - x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707); - x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f); - x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f); - x = (x & 0x000000000000007f) + (x >>32 & 0x000000000000007f); - return (unsigned int)x; - -#endif -} - -static inline unsigned int -rb_popcount_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return rb_popcount64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return rb_popcount32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline int -ntz_int32(uint32_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u32(x); - -#elif MSC_VERSION_SINCE(1400) - /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using - * assembly? Because issuing LZCNT seems possible (see nlz.h). */ - unsigned long r; - return _BitScanForward(&r, x) ? (int)r : 32; - -#elif __has_builtin(__builtin_ctz) - STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); - return x ? (unsigned)__builtin_ctz(x) : 32; - -#else - return rb_popcount32((~x) & (x-1)); - -#endif -} - -static inline int -ntz_int64(uint64_t x) -{ -#if defined(__x86_64__) && defined(__BMI__) - return (unsigned)_tzcnt_u64(x); - -#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) - unsigned long r; - return _BitScanForward64(&r, x) ? (int)r : 64; - -#elif __has_builtin(__builtin_ctzl) - if (x == 0) { - return 64; - } - else if (sizeof(long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzl((unsigned long)x); - } - else if (sizeof(long long) * CHAR_BIT == 64) { - return (unsigned)__builtin_ctzll((unsigned long long)x); - } - else { - /* :FIXME: Is there a way to make this branch a compile-time error? */ - UNREACHABLE_RETURN(~0); - } - -#else - return rb_popcount64((~x) & (x-1)); - -#endif -} - -static inline int -ntz_intptr(uintptr_t x) -{ - if (sizeof(uintptr_t) * CHAR_BIT == 64) { - return ntz_int64((uint64_t)x); - } - else if (sizeof(uintptr_t) * CHAR_BIT == 32) { - return ntz_int32((uint32_t)x); - } - else { - UNREACHABLE_RETURN(~0); - } -} - -static inline VALUE -RUBY_BIT_ROTL(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateleft32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateleft32(v, n); - -#elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateleft64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotl(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotl64(v, n); - -#elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotl(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (n & m)) | (v >> (-n & m)); -#endif -} - -static inline VALUE -RUBY_BIT_ROTR(VALUE v, int n) -{ -#if __has_builtin(__builtin_rotateright32) && (SIZEOF_VALUE * CHAR_BIT == 32) - return __builtin_rotateright32(v, n); - -#elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64) - return __builtin_rotateright64(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) - return _rotr(v, n); - -#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) - return _rotr64(v, n); - -#elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG) - return _lrotr(v, n); - -#else - const int m = (sizeof(VALUE) * CHAR_BIT) - 1; - return (v << (-n & m)) | (v >> (n & m)); -#endif -} - -#endif /* INTERNAL_BITS2_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_node.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_node.h deleted file mode 100644 index 2955720..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_node.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef RUBY_PARSER_NODE_H -#define RUBY_PARSER_NODE_H 1 -/* - * This is a header file used by only "parse.y" - */ -#include "rubyparser.h" -#include "internal/compilers.h" - -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -static inline rb_code_location_t -code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2) -{ - rb_code_location_t loc; - loc.beg_pos = loc1->beg_pos; - loc.end_pos = loc2->end_pos; - return loc; -} - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_PARSER_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_st.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_st.h deleted file mode 100644 index 877b1e9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_st.h +++ /dev/null @@ -1,162 +0,0 @@ -/* This is a public domain general purpose hash table package - originally written by Peter Moore @ UCB. - - The hash table data structures were redesigned and the package was - rewritten by Vladimir Makarov . */ - -#ifndef RUBY_ST2_H -#define RUBY_ST2_H 1 - -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -#include -#include -#include "ruby/config.h" -#include "ruby/backward/2/long_long.h" -#include "ruby/defines.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#if SIZEOF_LONG == SIZEOF_VOIDP -typedef unsigned long parser_st_data_t; -#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP -typedef unsigned LONG_LONG parser_st_data_t; -#else -# error ---->> parser_st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- -#endif -#define ST2_DATA_T_DEFINED - -#ifndef CHAR_BIT -# ifdef HAVE_LIMITS_H -# include -# else -# define CHAR_BIT 8 -# endif -#endif -#ifndef _ -# define _(args) args -#endif -#ifndef ANYARGS -# ifdef __cplusplus -# define ANYARGS ... -# else -# define ANYARGS -# endif -#endif - -typedef struct parser_st_table parser_st_table; - -typedef parser_st_data_t parser_st_index_t; - -/* Maximal value of unsigned integer type parser_st_index_t. */ -#define MAX_ST2_INDEX_VAL (~(parser_st_index_t) 0) - -typedef int parser_st_compare_func(parser_st_data_t, parser_st_data_t); -typedef parser_st_index_t parser_st_hash_func(parser_st_data_t); - -typedef char st_check_for_sizeof_parser_st_index_t[SIZEOF_VOIDP == (int)sizeof(parser_st_index_t) ? 1 : -1]; -#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP - -struct parser_st_hash_type { - int (*compare)(parser_st_data_t, parser_st_data_t); /* parser_st_compare_func* */ - parser_st_index_t (*hash)(parser_st_data_t); /* parser_st_hash_func* */ -}; - -#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT) - -#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR) && defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P) -# define ST2_DATA_COMPATIBLE_P(type) \ - __builtin_choose_expr(__builtin_types_compatible_p(type, parser_st_data_t), 1, 0) -#else -# define ST2_DATA_COMPATIBLE_P(type) 0 -#endif - -typedef struct parser_st_table_entry parser_st_table_entry; - -struct parser_st_table_entry; /* defined in parser_st.c */ - -struct parser_st_table { - /* Cached features of the table -- see st.c for more details. */ - unsigned char entry_power, bin_power, size_ind; - /* How many times the table was rebuilt. */ - unsigned int rebuilds_num; - const struct parser_st_hash_type *type; - /* Number of entries currently in the table. */ - parser_st_index_t num_entries; - /* Array of bins used for access by keys. */ - parser_st_index_t *bins; - /* Start and bound index of entries in array entries. - entries_starts and entries_bound are in interval - [0,allocated_entries]. */ - parser_st_index_t entries_start, entries_bound; - /* Array of size 2^entry_power. */ - parser_st_table_entry *entries; -}; - -#define parser_st_is_member(table,key) rb_parser_st_lookup((table),(key),(parser_st_data_t *)0) - -enum parser_st_retval {ST2_CONTINUE, ST2_STOP, ST2_DELETE, ST2_CHECK, ST2_REPLACE}; - -size_t rb_parser_st_table_size(const struct parser_st_table *tbl); -parser_st_table *rb_parser_st_init_table(const struct parser_st_hash_type *); -parser_st_table *rb_parser_st_init_table_with_size(const struct parser_st_hash_type *, parser_st_index_t); -parser_st_table *rb_parser_st_init_existing_table_with_size(parser_st_table *, const struct parser_st_hash_type *, parser_st_index_t); -parser_st_table *rb_parser_st_init_numtable(void); -parser_st_table *rb_parser_st_init_numtable_with_size(parser_st_index_t); -parser_st_table *rb_parser_st_init_strtable(void); -parser_st_table *rb_parser_st_init_strtable_with_size(parser_st_index_t); -parser_st_table *rb_parser_st_init_strcasetable(void); -parser_st_table *rb_parser_st_init_strcasetable_with_size(parser_st_index_t); -int rb_parser_st_delete(parser_st_table *, parser_st_data_t *, parser_st_data_t *); /* returns 0:notfound 1:deleted */ -int rb_parser_st_delete_safe(parser_st_table *, parser_st_data_t *, parser_st_data_t *, parser_st_data_t); -int rb_parser_st_shift(parser_st_table *, parser_st_data_t *, parser_st_data_t *); /* returns 0:notfound 1:deleted */ -int rb_parser_st_insert(parser_st_table *, parser_st_data_t, parser_st_data_t); -int rb_parser_st_insert2(parser_st_table *, parser_st_data_t, parser_st_data_t, parser_st_data_t (*)(parser_st_data_t)); -int rb_parser_st_lookup(parser_st_table *, parser_st_data_t, parser_st_data_t *); -int rb_parser_st_get_key(parser_st_table *, parser_st_data_t, parser_st_data_t *); -typedef int parser_st_update_callback_func(parser_st_data_t *key, parser_st_data_t *value, parser_st_data_t arg, int existing); -/* *key may be altered, but must equal to the old key, i.e., the - * results of hash() are same and compare() returns 0, otherwise the - * behavior is undefined */ -int rb_parser_st_update(parser_st_table *table, parser_st_data_t key, parser_st_update_callback_func *func, parser_st_data_t arg); -typedef int parser_st_foreach_callback_func(parser_st_data_t, parser_st_data_t, parser_st_data_t); -typedef int parser_st_foreach_check_callback_func(parser_st_data_t, parser_st_data_t, parser_st_data_t, int); -int rb_parser_st_foreach_with_replace(parser_st_table *tab, parser_st_foreach_check_callback_func *func, parser_st_update_callback_func *replace, parser_st_data_t arg); -int rb_parser_st_foreach(parser_st_table *, parser_st_foreach_callback_func *, parser_st_data_t); -int rb_parser_st_foreach_check(parser_st_table *, parser_st_foreach_check_callback_func *, parser_st_data_t, parser_st_data_t); -parser_st_index_t rb_parser_st_keys(parser_st_table *table, parser_st_data_t *keys, parser_st_index_t size); -parser_st_index_t rb_parser_st_keys_check(parser_st_table *table, parser_st_data_t *keys, parser_st_index_t size, parser_st_data_t never); -parser_st_index_t rb_parser_st_values(parser_st_table *table, parser_st_data_t *values, parser_st_index_t size); -parser_st_index_t rb_parser_st_values_check(parser_st_table *table, parser_st_data_t *values, parser_st_index_t size, parser_st_data_t never); -void rb_parser_st_add_direct(parser_st_table *, parser_st_data_t, parser_st_data_t); -void rb_parser_st_free_table(parser_st_table *); -void rb_parser_st_cleanup_safe(parser_st_table *, parser_st_data_t); -void rb_parser_st_clear(parser_st_table *); -parser_st_table *rb_parser_st_replace(parser_st_table *, parser_st_table *); -parser_st_table *rb_parser_st_copy(parser_st_table *); -CONSTFUNC(int rb_parser_st_numcmp(parser_st_data_t, parser_st_data_t)); -CONSTFUNC(parser_st_index_t rb_parser_st_numhash(parser_st_data_t)); -PUREFUNC(int rb_parser_st_locale_insensitive_strcasecmp(const char *s1, const char *s2)); -PUREFUNC(int rb_parser_st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n)); -PUREFUNC(size_t rb_parser_st_memsize(const parser_st_table *)); -PUREFUNC(parser_st_index_t rb_parser_st_hash(const void *ptr, size_t len, parser_st_index_t h)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_uint32(parser_st_index_t h, uint32_t i)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_uint(parser_st_index_t h, parser_st_index_t i)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_end(parser_st_index_t h)); -CONSTFUNC(parser_st_index_t rb_parser_st_hash_start(parser_st_index_t h)); - -RUBY_SYMBOL_EXPORT_END - -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_ST2_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_value.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_value.h deleted file mode 100644 index 4fe444e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_value.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef EXTERNAL_VALUE_H -#define EXTERNAL_VALUE_H - -#include "ruby/config.h" - -#if defined(__DOXYGEN__) - -/** - * Type that represents a Ruby object. It is an unsigned integer of some kind, - * depending on platforms. - * - * ```CXX - * VALUE value = rb_eval_string("ARGF.readlines.map.with_index"); - * ``` - * - * @warning ::VALUE is not a pointer. - * @warning ::VALUE can be wider than `long`. - */ -typedef uintptr_t VALUE; - -/** - * Type that represents a Ruby identifier such as a variable name. - * - * ```CXX - * ID method = rb_intern("method"); - * VALUE result = rb_funcall(obj, method, 0); - * ``` - * - * @note ::rb_cSymbol is a Ruby-level data type for the same thing. - */ -typedef uintptr_t ID; - -/** - * A signed integer type that has the same width with ::VALUE. - * - * @internal - * - * @shyouhei wonders: is it guaranteed that `uintptr_t` and `intptr_t` are the - * same width? As far as I read ISO/IEC 9899:2018 section 7.20.1.4 paragraph 1 - * no such description is given... or defined elsewhere? - */ -typedef intptr_t SIGNED_VALUE; - -/** - * Identical to `sizeof(VALUE)`, except it is a macro that can also be used - * inside of preprocessor directives such as `#if`. Handy on occasions. - */ -#define SIZEOF_VALUE SIZEOF_UINTPTR_T - -/** - * @private - * - * A compile-time constant of type ::VALUE whose value is 0. - */ -#define RBIMPL_VALUE_NULL UINTPTR_C(0) - -/** - * @private - * - * A compile-time constant of type ::VALUE whose value is 1. - */ -#define RBIMPL_VALUE_ONE UINTPTR_C(1) - -/** - * @private - * - * Maximum possible value that a ::VALUE can take. - */ -#define RBIMPL_VALUE_FULL UINTPTR_MAX - -#elif defined HAVE_UINTPTR_T && 0 -typedef uintptr_t VALUE; -typedef uintptr_t ID; -# define SIGNED_VALUE intptr_t -# define SIZEOF_VALUE SIZEOF_UINTPTR_T -# undef PRI_VALUE_PREFIX -# define RBIMPL_VALUE_NULL UINTPTR_C(0) -# define RBIMPL_VALUE_ONE UINTPTR_C(1) -# define RBIMPL_VALUE_FULL UINTPTR_MAX - -#elif SIZEOF_LONG == SIZEOF_VOIDP -typedef unsigned long VALUE; -typedef unsigned long ID; -# define SIGNED_VALUE long -# define SIZEOF_VALUE SIZEOF_LONG -# define PRI_VALUE_PREFIX "l" -# define RBIMPL_VALUE_NULL 0UL -# define RBIMPL_VALUE_ONE 1UL -# define RBIMPL_VALUE_FULL ULONG_MAX - -#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP -typedef unsigned LONG_LONG VALUE; -typedef unsigned LONG_LONG ID; -# define SIGNED_VALUE LONG_LONG -# define LONG_LONG_VALUE 1 -# define SIZEOF_VALUE SIZEOF_LONG_LONG -# define PRI_VALUE_PREFIX PRI_LL_PREFIX -# define RBIMPL_VALUE_NULL 0ULL -# define RBIMPL_VALUE_ONE 1ULL -# define RBIMPL_VALUE_FULL ULLONG_MAX - -#else -# error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- -#endif - -#endif /* EXTERNAL_VALUE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h deleted file mode 100644 index 9ecc9cf..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h +++ /dev/null @@ -1,7524 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* This file is generated by the templates/template.rb script and should not */ -/* be modified manually. See */ -/* templates/include/prism/ast.h.erb */ -/* if you are looking to modify the */ -/* template */ -/*----------------------------------------------------------------------------*/ - -/** - * @file ast.h - * - * The abstract syntax tree. - */ -#ifndef PRISM_AST_H -#define PRISM_AST_H - -#include "prism/defines.h" -#include "prism/util/pm_constant_pool.h" -#include "prism/util/pm_integer.h" -#include "prism/util/pm_string.h" - -#include -#include -#include - -/** - * This enum represents every type of token in the Ruby source. - */ -typedef enum pm_token_type { - /** final token in the file */ - PM_TOKEN_EOF = 1, - - /** a token that was expected but not found */ - PM_TOKEN_MISSING, - - /** a token that was not present but it is okay */ - PM_TOKEN_NOT_PROVIDED, - - /** & */ - PM_TOKEN_AMPERSAND, - - /** && */ - PM_TOKEN_AMPERSAND_AMPERSAND, - - /** &&= */ - PM_TOKEN_AMPERSAND_AMPERSAND_EQUAL, - - /** &. */ - PM_TOKEN_AMPERSAND_DOT, - - /** &= */ - PM_TOKEN_AMPERSAND_EQUAL, - - /** ` */ - PM_TOKEN_BACKTICK, - - /** a back reference */ - PM_TOKEN_BACK_REFERENCE, - - /** ! or !@ */ - PM_TOKEN_BANG, - - /** != */ - PM_TOKEN_BANG_EQUAL, - - /** !~ */ - PM_TOKEN_BANG_TILDE, - - /** { */ - PM_TOKEN_BRACE_LEFT, - - /** } */ - PM_TOKEN_BRACE_RIGHT, - - /** [ */ - PM_TOKEN_BRACKET_LEFT, - - /** [ for the beginning of an array */ - PM_TOKEN_BRACKET_LEFT_ARRAY, - - /** [] */ - PM_TOKEN_BRACKET_LEFT_RIGHT, - - /** []= */ - PM_TOKEN_BRACKET_LEFT_RIGHT_EQUAL, - - /** ] */ - PM_TOKEN_BRACKET_RIGHT, - - /** ^ */ - PM_TOKEN_CARET, - - /** ^= */ - PM_TOKEN_CARET_EQUAL, - - /** a character literal */ - PM_TOKEN_CHARACTER_LITERAL, - - /** a class variable */ - PM_TOKEN_CLASS_VARIABLE, - - /** : */ - PM_TOKEN_COLON, - - /** :: */ - PM_TOKEN_COLON_COLON, - - /** , */ - PM_TOKEN_COMMA, - - /** a comment */ - PM_TOKEN_COMMENT, - - /** a constant */ - PM_TOKEN_CONSTANT, - - /** the . call operator */ - PM_TOKEN_DOT, - - /** the .. range operator */ - PM_TOKEN_DOT_DOT, - - /** the ... range operator or forwarding parameter */ - PM_TOKEN_DOT_DOT_DOT, - - /** =begin */ - PM_TOKEN_EMBDOC_BEGIN, - - /** =end */ - PM_TOKEN_EMBDOC_END, - - /** a line inside of embedded documentation */ - PM_TOKEN_EMBDOC_LINE, - - /** #{ */ - PM_TOKEN_EMBEXPR_BEGIN, - - /** } */ - PM_TOKEN_EMBEXPR_END, - - /** # */ - PM_TOKEN_EMBVAR, - - /** = */ - PM_TOKEN_EQUAL, - - /** == */ - PM_TOKEN_EQUAL_EQUAL, - - /** === */ - PM_TOKEN_EQUAL_EQUAL_EQUAL, - - /** => */ - PM_TOKEN_EQUAL_GREATER, - - /** =~ */ - PM_TOKEN_EQUAL_TILDE, - - /** a floating point number */ - PM_TOKEN_FLOAT, - - /** a floating pointer number with an imaginary suffix */ - PM_TOKEN_FLOAT_IMAGINARY, - - /** a floating pointer number with a rational suffix */ - PM_TOKEN_FLOAT_RATIONAL, - - /** a floating pointer number with a rational and imaginary suffix */ - PM_TOKEN_FLOAT_RATIONAL_IMAGINARY, - - /** a global variable */ - PM_TOKEN_GLOBAL_VARIABLE, - - /** > */ - PM_TOKEN_GREATER, - - /** >= */ - PM_TOKEN_GREATER_EQUAL, - - /** >> */ - PM_TOKEN_GREATER_GREATER, - - /** >>= */ - PM_TOKEN_GREATER_GREATER_EQUAL, - - /** the end of a heredoc */ - PM_TOKEN_HEREDOC_END, - - /** the start of a heredoc */ - PM_TOKEN_HEREDOC_START, - - /** an identifier */ - PM_TOKEN_IDENTIFIER, - - /** an ignored newline */ - PM_TOKEN_IGNORED_NEWLINE, - - /** an instance variable */ - PM_TOKEN_INSTANCE_VARIABLE, - - /** an integer (any base) */ - PM_TOKEN_INTEGER, - - /** an integer with an imaginary suffix */ - PM_TOKEN_INTEGER_IMAGINARY, - - /** an integer with a rational suffix */ - PM_TOKEN_INTEGER_RATIONAL, - - /** an integer with a rational and imaginary suffix */ - PM_TOKEN_INTEGER_RATIONAL_IMAGINARY, - - /** alias */ - PM_TOKEN_KEYWORD_ALIAS, - - /** and */ - PM_TOKEN_KEYWORD_AND, - - /** begin */ - PM_TOKEN_KEYWORD_BEGIN, - - /** BEGIN */ - PM_TOKEN_KEYWORD_BEGIN_UPCASE, - - /** break */ - PM_TOKEN_KEYWORD_BREAK, - - /** case */ - PM_TOKEN_KEYWORD_CASE, - - /** class */ - PM_TOKEN_KEYWORD_CLASS, - - /** def */ - PM_TOKEN_KEYWORD_DEF, - - /** defined? */ - PM_TOKEN_KEYWORD_DEFINED, - - /** do */ - PM_TOKEN_KEYWORD_DO, - - /** do keyword for a predicate in a while, until, or for loop */ - PM_TOKEN_KEYWORD_DO_LOOP, - - /** else */ - PM_TOKEN_KEYWORD_ELSE, - - /** elsif */ - PM_TOKEN_KEYWORD_ELSIF, - - /** end */ - PM_TOKEN_KEYWORD_END, - - /** END */ - PM_TOKEN_KEYWORD_END_UPCASE, - - /** ensure */ - PM_TOKEN_KEYWORD_ENSURE, - - /** false */ - PM_TOKEN_KEYWORD_FALSE, - - /** for */ - PM_TOKEN_KEYWORD_FOR, - - /** if */ - PM_TOKEN_KEYWORD_IF, - - /** if in the modifier form */ - PM_TOKEN_KEYWORD_IF_MODIFIER, - - /** in */ - PM_TOKEN_KEYWORD_IN, - - /** module */ - PM_TOKEN_KEYWORD_MODULE, - - /** next */ - PM_TOKEN_KEYWORD_NEXT, - - /** nil */ - PM_TOKEN_KEYWORD_NIL, - - /** not */ - PM_TOKEN_KEYWORD_NOT, - - /** or */ - PM_TOKEN_KEYWORD_OR, - - /** redo */ - PM_TOKEN_KEYWORD_REDO, - - /** rescue */ - PM_TOKEN_KEYWORD_RESCUE, - - /** rescue in the modifier form */ - PM_TOKEN_KEYWORD_RESCUE_MODIFIER, - - /** retry */ - PM_TOKEN_KEYWORD_RETRY, - - /** return */ - PM_TOKEN_KEYWORD_RETURN, - - /** self */ - PM_TOKEN_KEYWORD_SELF, - - /** super */ - PM_TOKEN_KEYWORD_SUPER, - - /** then */ - PM_TOKEN_KEYWORD_THEN, - - /** true */ - PM_TOKEN_KEYWORD_TRUE, - - /** undef */ - PM_TOKEN_KEYWORD_UNDEF, - - /** unless */ - PM_TOKEN_KEYWORD_UNLESS, - - /** unless in the modifier form */ - PM_TOKEN_KEYWORD_UNLESS_MODIFIER, - - /** until */ - PM_TOKEN_KEYWORD_UNTIL, - - /** until in the modifier form */ - PM_TOKEN_KEYWORD_UNTIL_MODIFIER, - - /** when */ - PM_TOKEN_KEYWORD_WHEN, - - /** while */ - PM_TOKEN_KEYWORD_WHILE, - - /** while in the modifier form */ - PM_TOKEN_KEYWORD_WHILE_MODIFIER, - - /** yield */ - PM_TOKEN_KEYWORD_YIELD, - - /** __ENCODING__ */ - PM_TOKEN_KEYWORD___ENCODING__, - - /** __FILE__ */ - PM_TOKEN_KEYWORD___FILE__, - - /** __LINE__ */ - PM_TOKEN_KEYWORD___LINE__, - - /** a label */ - PM_TOKEN_LABEL, - - /** the end of a label */ - PM_TOKEN_LABEL_END, - - /** { */ - PM_TOKEN_LAMBDA_BEGIN, - - /** < */ - PM_TOKEN_LESS, - - /** <= */ - PM_TOKEN_LESS_EQUAL, - - /** <=> */ - PM_TOKEN_LESS_EQUAL_GREATER, - - /** << */ - PM_TOKEN_LESS_LESS, - - /** <<= */ - PM_TOKEN_LESS_LESS_EQUAL, - - /** a method name */ - PM_TOKEN_METHOD_NAME, - - /** - */ - PM_TOKEN_MINUS, - - /** -= */ - PM_TOKEN_MINUS_EQUAL, - - /** -> */ - PM_TOKEN_MINUS_GREATER, - - /** a newline character outside of other tokens */ - PM_TOKEN_NEWLINE, - - /** a numbered reference to a capture group in the previous regular expression match */ - PM_TOKEN_NUMBERED_REFERENCE, - - /** ( */ - PM_TOKEN_PARENTHESIS_LEFT, - - /** ( for a parentheses node */ - PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES, - - /** ) */ - PM_TOKEN_PARENTHESIS_RIGHT, - - /** % */ - PM_TOKEN_PERCENT, - - /** %= */ - PM_TOKEN_PERCENT_EQUAL, - - /** %i */ - PM_TOKEN_PERCENT_LOWER_I, - - /** %w */ - PM_TOKEN_PERCENT_LOWER_W, - - /** %x */ - PM_TOKEN_PERCENT_LOWER_X, - - /** %I */ - PM_TOKEN_PERCENT_UPPER_I, - - /** %W */ - PM_TOKEN_PERCENT_UPPER_W, - - /** | */ - PM_TOKEN_PIPE, - - /** |= */ - PM_TOKEN_PIPE_EQUAL, - - /** || */ - PM_TOKEN_PIPE_PIPE, - - /** ||= */ - PM_TOKEN_PIPE_PIPE_EQUAL, - - /** + */ - PM_TOKEN_PLUS, - - /** += */ - PM_TOKEN_PLUS_EQUAL, - - /** ? */ - PM_TOKEN_QUESTION_MARK, - - /** the beginning of a regular expression */ - PM_TOKEN_REGEXP_BEGIN, - - /** the end of a regular expression */ - PM_TOKEN_REGEXP_END, - - /** ; */ - PM_TOKEN_SEMICOLON, - - /** / */ - PM_TOKEN_SLASH, - - /** /= */ - PM_TOKEN_SLASH_EQUAL, - - /** * */ - PM_TOKEN_STAR, - - /** *= */ - PM_TOKEN_STAR_EQUAL, - - /** ** */ - PM_TOKEN_STAR_STAR, - - /** **= */ - PM_TOKEN_STAR_STAR_EQUAL, - - /** the beginning of a string */ - PM_TOKEN_STRING_BEGIN, - - /** the contents of a string */ - PM_TOKEN_STRING_CONTENT, - - /** the end of a string */ - PM_TOKEN_STRING_END, - - /** the beginning of a symbol */ - PM_TOKEN_SYMBOL_BEGIN, - - /** ~ or ~@ */ - PM_TOKEN_TILDE, - - /** unary & */ - PM_TOKEN_UAMPERSAND, - - /** unary :: */ - PM_TOKEN_UCOLON_COLON, - - /** unary .. operator */ - PM_TOKEN_UDOT_DOT, - - /** unary ... operator */ - PM_TOKEN_UDOT_DOT_DOT, - - /** -@ */ - PM_TOKEN_UMINUS, - - /** -@ for a number */ - PM_TOKEN_UMINUS_NUM, - - /** +@ */ - PM_TOKEN_UPLUS, - - /** unary * */ - PM_TOKEN_USTAR, - - /** unary ** */ - PM_TOKEN_USTAR_STAR, - - /** a separator between words in a list */ - PM_TOKEN_WORDS_SEP, - - /** marker for the point in the file at which the parser should stop */ - PM_TOKEN___END__, - - /** The maximum token value. */ - PM_TOKEN_MAXIMUM, -} pm_token_type_t; - -/** - * This struct represents a token in the Ruby source. We use it to track both - * type and location information. - */ -typedef struct { - /** The type of the token. */ - pm_token_type_t type; - - /** A pointer to the start location of the token in the source. */ - const uint8_t *start; - - /** A pointer to the end location of the token in the source. */ - const uint8_t *end; -} pm_token_t; - -/** - * This represents a range of bytes in the source string to which a node or - * token corresponds. - */ -typedef struct { - /** A pointer to the start location of the range in the source. */ - const uint8_t *start; - - /** A pointer to the end location of the range in the source. */ - const uint8_t *end; -} pm_location_t; - -struct pm_node; - -/** - * A list of nodes in the source, most often used for lists of children. - */ -typedef struct pm_node_list { - /** The number of nodes in the list. */ - size_t size; - - /** The capacity of the list that has been allocated. */ - size_t capacity; - - /** The nodes in the list. */ - struct pm_node **nodes; -} pm_node_list_t; - -/** - * This enum represents every type of node in the Ruby syntax tree. - */ -enum pm_node_type { - /** AliasGlobalVariableNode */ - PM_ALIAS_GLOBAL_VARIABLE_NODE = 1, - - /** AliasMethodNode */ - PM_ALIAS_METHOD_NODE = 2, - - /** AlternationPatternNode */ - PM_ALTERNATION_PATTERN_NODE = 3, - - /** AndNode */ - PM_AND_NODE = 4, - - /** ArgumentsNode */ - PM_ARGUMENTS_NODE = 5, - - /** ArrayNode */ - PM_ARRAY_NODE = 6, - - /** ArrayPatternNode */ - PM_ARRAY_PATTERN_NODE = 7, - - /** AssocNode */ - PM_ASSOC_NODE = 8, - - /** AssocSplatNode */ - PM_ASSOC_SPLAT_NODE = 9, - - /** BackReferenceReadNode */ - PM_BACK_REFERENCE_READ_NODE = 10, - - /** BeginNode */ - PM_BEGIN_NODE = 11, - - /** BlockArgumentNode */ - PM_BLOCK_ARGUMENT_NODE = 12, - - /** BlockLocalVariableNode */ - PM_BLOCK_LOCAL_VARIABLE_NODE = 13, - - /** BlockNode */ - PM_BLOCK_NODE = 14, - - /** BlockParameterNode */ - PM_BLOCK_PARAMETER_NODE = 15, - - /** BlockParametersNode */ - PM_BLOCK_PARAMETERS_NODE = 16, - - /** BreakNode */ - PM_BREAK_NODE = 17, - - /** CallAndWriteNode */ - PM_CALL_AND_WRITE_NODE = 18, - - /** CallNode */ - PM_CALL_NODE = 19, - - /** CallOperatorWriteNode */ - PM_CALL_OPERATOR_WRITE_NODE = 20, - - /** CallOrWriteNode */ - PM_CALL_OR_WRITE_NODE = 21, - - /** CallTargetNode */ - PM_CALL_TARGET_NODE = 22, - - /** CapturePatternNode */ - PM_CAPTURE_PATTERN_NODE = 23, - - /** CaseMatchNode */ - PM_CASE_MATCH_NODE = 24, - - /** CaseNode */ - PM_CASE_NODE = 25, - - /** ClassNode */ - PM_CLASS_NODE = 26, - - /** ClassVariableAndWriteNode */ - PM_CLASS_VARIABLE_AND_WRITE_NODE = 27, - - /** ClassVariableOperatorWriteNode */ - PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE = 28, - - /** ClassVariableOrWriteNode */ - PM_CLASS_VARIABLE_OR_WRITE_NODE = 29, - - /** ClassVariableReadNode */ - PM_CLASS_VARIABLE_READ_NODE = 30, - - /** ClassVariableTargetNode */ - PM_CLASS_VARIABLE_TARGET_NODE = 31, - - /** ClassVariableWriteNode */ - PM_CLASS_VARIABLE_WRITE_NODE = 32, - - /** ConstantAndWriteNode */ - PM_CONSTANT_AND_WRITE_NODE = 33, - - /** ConstantOperatorWriteNode */ - PM_CONSTANT_OPERATOR_WRITE_NODE = 34, - - /** ConstantOrWriteNode */ - PM_CONSTANT_OR_WRITE_NODE = 35, - - /** ConstantPathAndWriteNode */ - PM_CONSTANT_PATH_AND_WRITE_NODE = 36, - - /** ConstantPathNode */ - PM_CONSTANT_PATH_NODE = 37, - - /** ConstantPathOperatorWriteNode */ - PM_CONSTANT_PATH_OPERATOR_WRITE_NODE = 38, - - /** ConstantPathOrWriteNode */ - PM_CONSTANT_PATH_OR_WRITE_NODE = 39, - - /** ConstantPathTargetNode */ - PM_CONSTANT_PATH_TARGET_NODE = 40, - - /** ConstantPathWriteNode */ - PM_CONSTANT_PATH_WRITE_NODE = 41, - - /** ConstantReadNode */ - PM_CONSTANT_READ_NODE = 42, - - /** ConstantTargetNode */ - PM_CONSTANT_TARGET_NODE = 43, - - /** ConstantWriteNode */ - PM_CONSTANT_WRITE_NODE = 44, - - /** DefNode */ - PM_DEF_NODE = 45, - - /** DefinedNode */ - PM_DEFINED_NODE = 46, - - /** ElseNode */ - PM_ELSE_NODE = 47, - - /** EmbeddedStatementsNode */ - PM_EMBEDDED_STATEMENTS_NODE = 48, - - /** EmbeddedVariableNode */ - PM_EMBEDDED_VARIABLE_NODE = 49, - - /** EnsureNode */ - PM_ENSURE_NODE = 50, - - /** FalseNode */ - PM_FALSE_NODE = 51, - - /** FindPatternNode */ - PM_FIND_PATTERN_NODE = 52, - - /** FlipFlopNode */ - PM_FLIP_FLOP_NODE = 53, - - /** FloatNode */ - PM_FLOAT_NODE = 54, - - /** ForNode */ - PM_FOR_NODE = 55, - - /** ForwardingArgumentsNode */ - PM_FORWARDING_ARGUMENTS_NODE = 56, - - /** ForwardingParameterNode */ - PM_FORWARDING_PARAMETER_NODE = 57, - - /** ForwardingSuperNode */ - PM_FORWARDING_SUPER_NODE = 58, - - /** GlobalVariableAndWriteNode */ - PM_GLOBAL_VARIABLE_AND_WRITE_NODE = 59, - - /** GlobalVariableOperatorWriteNode */ - PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE = 60, - - /** GlobalVariableOrWriteNode */ - PM_GLOBAL_VARIABLE_OR_WRITE_NODE = 61, - - /** GlobalVariableReadNode */ - PM_GLOBAL_VARIABLE_READ_NODE = 62, - - /** GlobalVariableTargetNode */ - PM_GLOBAL_VARIABLE_TARGET_NODE = 63, - - /** GlobalVariableWriteNode */ - PM_GLOBAL_VARIABLE_WRITE_NODE = 64, - - /** HashNode */ - PM_HASH_NODE = 65, - - /** HashPatternNode */ - PM_HASH_PATTERN_NODE = 66, - - /** IfNode */ - PM_IF_NODE = 67, - - /** ImaginaryNode */ - PM_IMAGINARY_NODE = 68, - - /** ImplicitNode */ - PM_IMPLICIT_NODE = 69, - - /** ImplicitRestNode */ - PM_IMPLICIT_REST_NODE = 70, - - /** InNode */ - PM_IN_NODE = 71, - - /** IndexAndWriteNode */ - PM_INDEX_AND_WRITE_NODE = 72, - - /** IndexOperatorWriteNode */ - PM_INDEX_OPERATOR_WRITE_NODE = 73, - - /** IndexOrWriteNode */ - PM_INDEX_OR_WRITE_NODE = 74, - - /** IndexTargetNode */ - PM_INDEX_TARGET_NODE = 75, - - /** InstanceVariableAndWriteNode */ - PM_INSTANCE_VARIABLE_AND_WRITE_NODE = 76, - - /** InstanceVariableOperatorWriteNode */ - PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE = 77, - - /** InstanceVariableOrWriteNode */ - PM_INSTANCE_VARIABLE_OR_WRITE_NODE = 78, - - /** InstanceVariableReadNode */ - PM_INSTANCE_VARIABLE_READ_NODE = 79, - - /** InstanceVariableTargetNode */ - PM_INSTANCE_VARIABLE_TARGET_NODE = 80, - - /** InstanceVariableWriteNode */ - PM_INSTANCE_VARIABLE_WRITE_NODE = 81, - - /** IntegerNode */ - PM_INTEGER_NODE = 82, - - /** InterpolatedMatchLastLineNode */ - PM_INTERPOLATED_MATCH_LAST_LINE_NODE = 83, - - /** InterpolatedRegularExpressionNode */ - PM_INTERPOLATED_REGULAR_EXPRESSION_NODE = 84, - - /** InterpolatedStringNode */ - PM_INTERPOLATED_STRING_NODE = 85, - - /** InterpolatedSymbolNode */ - PM_INTERPOLATED_SYMBOL_NODE = 86, - - /** InterpolatedXStringNode */ - PM_INTERPOLATED_X_STRING_NODE = 87, - - /** ItLocalVariableReadNode */ - PM_IT_LOCAL_VARIABLE_READ_NODE = 88, - - /** ItParametersNode */ - PM_IT_PARAMETERS_NODE = 89, - - /** KeywordHashNode */ - PM_KEYWORD_HASH_NODE = 90, - - /** KeywordRestParameterNode */ - PM_KEYWORD_REST_PARAMETER_NODE = 91, - - /** LambdaNode */ - PM_LAMBDA_NODE = 92, - - /** LocalVariableAndWriteNode */ - PM_LOCAL_VARIABLE_AND_WRITE_NODE = 93, - - /** LocalVariableOperatorWriteNode */ - PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE = 94, - - /** LocalVariableOrWriteNode */ - PM_LOCAL_VARIABLE_OR_WRITE_NODE = 95, - - /** LocalVariableReadNode */ - PM_LOCAL_VARIABLE_READ_NODE = 96, - - /** LocalVariableTargetNode */ - PM_LOCAL_VARIABLE_TARGET_NODE = 97, - - /** LocalVariableWriteNode */ - PM_LOCAL_VARIABLE_WRITE_NODE = 98, - - /** MatchLastLineNode */ - PM_MATCH_LAST_LINE_NODE = 99, - - /** MatchPredicateNode */ - PM_MATCH_PREDICATE_NODE = 100, - - /** MatchRequiredNode */ - PM_MATCH_REQUIRED_NODE = 101, - - /** MatchWriteNode */ - PM_MATCH_WRITE_NODE = 102, - - /** MissingNode */ - PM_MISSING_NODE = 103, - - /** ModuleNode */ - PM_MODULE_NODE = 104, - - /** MultiTargetNode */ - PM_MULTI_TARGET_NODE = 105, - - /** MultiWriteNode */ - PM_MULTI_WRITE_NODE = 106, - - /** NextNode */ - PM_NEXT_NODE = 107, - - /** NilNode */ - PM_NIL_NODE = 108, - - /** NoKeywordsParameterNode */ - PM_NO_KEYWORDS_PARAMETER_NODE = 109, - - /** NumberedParametersNode */ - PM_NUMBERED_PARAMETERS_NODE = 110, - - /** NumberedReferenceReadNode */ - PM_NUMBERED_REFERENCE_READ_NODE = 111, - - /** OptionalKeywordParameterNode */ - PM_OPTIONAL_KEYWORD_PARAMETER_NODE = 112, - - /** OptionalParameterNode */ - PM_OPTIONAL_PARAMETER_NODE = 113, - - /** OrNode */ - PM_OR_NODE = 114, - - /** ParametersNode */ - PM_PARAMETERS_NODE = 115, - - /** ParenthesesNode */ - PM_PARENTHESES_NODE = 116, - - /** PinnedExpressionNode */ - PM_PINNED_EXPRESSION_NODE = 117, - - /** PinnedVariableNode */ - PM_PINNED_VARIABLE_NODE = 118, - - /** PostExecutionNode */ - PM_POST_EXECUTION_NODE = 119, - - /** PreExecutionNode */ - PM_PRE_EXECUTION_NODE = 120, - - /** ProgramNode */ - PM_PROGRAM_NODE = 121, - - /** RangeNode */ - PM_RANGE_NODE = 122, - - /** RationalNode */ - PM_RATIONAL_NODE = 123, - - /** RedoNode */ - PM_REDO_NODE = 124, - - /** RegularExpressionNode */ - PM_REGULAR_EXPRESSION_NODE = 125, - - /** RequiredKeywordParameterNode */ - PM_REQUIRED_KEYWORD_PARAMETER_NODE = 126, - - /** RequiredParameterNode */ - PM_REQUIRED_PARAMETER_NODE = 127, - - /** RescueModifierNode */ - PM_RESCUE_MODIFIER_NODE = 128, - - /** RescueNode */ - PM_RESCUE_NODE = 129, - - /** RestParameterNode */ - PM_REST_PARAMETER_NODE = 130, - - /** RetryNode */ - PM_RETRY_NODE = 131, - - /** ReturnNode */ - PM_RETURN_NODE = 132, - - /** SelfNode */ - PM_SELF_NODE = 133, - - /** ShareableConstantNode */ - PM_SHAREABLE_CONSTANT_NODE = 134, - - /** SingletonClassNode */ - PM_SINGLETON_CLASS_NODE = 135, - - /** SourceEncodingNode */ - PM_SOURCE_ENCODING_NODE = 136, - - /** SourceFileNode */ - PM_SOURCE_FILE_NODE = 137, - - /** SourceLineNode */ - PM_SOURCE_LINE_NODE = 138, - - /** SplatNode */ - PM_SPLAT_NODE = 139, - - /** StatementsNode */ - PM_STATEMENTS_NODE = 140, - - /** StringNode */ - PM_STRING_NODE = 141, - - /** SuperNode */ - PM_SUPER_NODE = 142, - - /** SymbolNode */ - PM_SYMBOL_NODE = 143, - - /** TrueNode */ - PM_TRUE_NODE = 144, - - /** UndefNode */ - PM_UNDEF_NODE = 145, - - /** UnlessNode */ - PM_UNLESS_NODE = 146, - - /** UntilNode */ - PM_UNTIL_NODE = 147, - - /** WhenNode */ - PM_WHEN_NODE = 148, - - /** WhileNode */ - PM_WHILE_NODE = 149, - - /** XStringNode */ - PM_X_STRING_NODE = 150, - - /** YieldNode */ - PM_YIELD_NODE = 151, - - /** A special kind of node used for compilation. */ - PM_SCOPE_NODE -}; - -/** - * This is the type of node embedded in the node struct. We explicitly control - * the size of it here to avoid having the variable-width enum. - */ -typedef uint16_t pm_node_type_t; - -/** - * These are the flags embedded in the node struct. We explicitly control the - * size of it here to avoid having the variable-width enum. - */ -typedef uint16_t pm_node_flags_t; - -/** - * We store the flags enum in every node in the tree. Some flags are common to - * all nodes (the ones listed below). Others are specific to certain node types. - */ -static const pm_node_flags_t PM_NODE_FLAG_NEWLINE = 0x1; -static const pm_node_flags_t PM_NODE_FLAG_STATIC_LITERAL = 0x2; - -/** - * Cast the type to an enum to allow the compiler to provide exhaustiveness - * checking. - */ -#define PM_NODE_TYPE(node) ((enum pm_node_type) (node)->type) - -/** - * Return true if the type of the given node matches the given type. - */ -#define PM_NODE_TYPE_P(node, type) (PM_NODE_TYPE(node) == (type)) - -/** - * Return true if the given flag is set on the given node. - */ -#define PM_NODE_FLAG_P(node, flag) ((((pm_node_t *)(node))->flags & (flag)) != 0) - -/** - * This is the base structure that represents a node in the syntax tree. It is - * embedded into every node type. - */ -typedef struct pm_node { - /** - * This represents the type of the node. It somewhat maps to the nodes that - * existed in the original grammar and ripper, but it's not a 1:1 mapping. - */ - pm_node_type_t type; - - /** - * This represents any flags on the node. Some are common to all nodes, and - * some are specific to the type of node. - */ - pm_node_flags_t flags; - - /** - * The unique identifier for this node, which is deterministic based on the - * source. It is used to identify unique nodes across parses. - */ - uint32_t node_id; - - /** - * This is the location of the node in the source. It's a range of bytes - * containing a start and an end. - */ - pm_location_t location; -} pm_node_t; - -/** - * AliasGlobalVariableNode - * - * Represents the use of the `alias` keyword to alias a global variable. - * - * alias $foo $bar - * ^^^^^^^^^^^^^^^ - * - * Type: ::PM_ALIAS_GLOBAL_VARIABLE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_alias_global_variable_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * AliasGlobalVariableNode#new_name - * - * Represents the new name of the global variable that can be used after aliasing. - * - * alias $foo $bar - * ^^^^ - */ - struct pm_node *new_name; - - /** - * AliasGlobalVariableNode#old_name - * - * Represents the old name of the global variable that can be used before aliasing. - * - * alias $foo $bar - * ^^^^ - */ - struct pm_node *old_name; - - /** - * AliasGlobalVariableNode#keyword_loc - * - * The location of the `alias` keyword. - * - * alias $foo $bar - * ^^^^^ - */ - pm_location_t keyword_loc; -} pm_alias_global_variable_node_t; - -/** - * AliasMethodNode - * - * Represents the use of the `alias` keyword to alias a method. - * - * alias foo bar - * ^^^^^^^^^^^^^ - * - * Type: ::PM_ALIAS_METHOD_NODE - * - * @extends pm_node_t - */ -typedef struct pm_alias_method_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * AliasMethodNode#new_name - * - * Represents the new name of the method that will be aliased. - * - * alias foo bar - * ^^^ - * - * alias :foo :bar - * ^^^^ - * - * alias :"#{foo}" :"#{bar}" - * ^^^^^^^^^ - */ - struct pm_node *new_name; - - /** - * AliasMethodNode#old_name - * - * Represents the old name of the method that will be aliased. - * - * alias foo bar - * ^^^ - * - * alias :foo :bar - * ^^^^ - * - * alias :"#{foo}" :"#{bar}" - * ^^^^^^^^^ - */ - struct pm_node *old_name; - - /** - * AliasMethodNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_alias_method_node_t; - -/** - * AlternationPatternNode - * - * Represents an alternation pattern in pattern matching. - * - * foo => bar | baz - * ^^^^^^^^^ - * - * Type: ::PM_ALTERNATION_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_alternation_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * AlternationPatternNode#left - * - * Represents the left side of the expression. - * - * foo => bar | baz - * ^^^ - */ - struct pm_node *left; - - /** - * AlternationPatternNode#right - * - * Represents the right side of the expression. - * - * foo => bar | baz - * ^^^ - */ - struct pm_node *right; - - /** - * AlternationPatternNode#operator_loc - * - * Represents the alternation operator location. - * - * foo => bar | baz - * ^ - */ - pm_location_t operator_loc; -} pm_alternation_pattern_node_t; - -/** - * AndNode - * - * Represents the use of the `&&` operator or the `and` keyword. - * - * left and right - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_AND_NODE - * - * @extends pm_node_t - */ -typedef struct pm_and_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * AndNode#left - * - * Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * left and right - * ^^^^ - * - * 1 && 2 - * ^ - */ - struct pm_node *left; - - /** - * AndNode#right - * - * Represents the right side of the expression. - * - * left && right - * ^^^^^ - * - * 1 and 2 - * ^ - */ - struct pm_node *right; - - /** - * AndNode#operator_loc - * - * The location of the `and` keyword or the `&&` operator. - * - * left and right - * ^^^ - */ - pm_location_t operator_loc; -} pm_and_node_t; - -/** - * ArgumentsNode - * - * Represents a set of arguments to a method or a keyword. - * - * return foo, bar, baz - * ^^^^^^^^^^^^^ - * - * Type: ::PM_ARGUMENTS_NODE - - * Flags (#pm_arguments_node_flags): - * * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING - * * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS - * * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT - * * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT - * * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS - * - * @extends pm_node_t - */ -typedef struct pm_arguments_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ArgumentsNode#arguments - */ - struct pm_node_list arguments; -} pm_arguments_node_t; - -/** - * ArrayNode - * - * Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i. - * - * [1, 2, 3] - * ^^^^^^^^^ - * - * Type: ::PM_ARRAY_NODE - - * Flags (#pm_array_node_flags): - * * ::PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT - * - * @extends pm_node_t - */ -typedef struct pm_array_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ArrayNode#elements - * - * Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array. - */ - struct pm_node_list elements; - - /** - * ArrayNode#opening_loc - * - * Represents the optional source location for the opening token. - * - * [1,2,3] # "[" - * %w[foo bar baz] # "%w[" - * %I(apple orange banana) # "%I(" - * foo = 1, 2, 3 # nil - */ - pm_location_t opening_loc; - - /** - * ArrayNode#closing_loc - * - * Represents the optional source location for the closing token. - * - * [1,2,3] # "]" - * %w[foo bar baz] # "]" - * %I(apple orange banana) # ")" - * foo = 1, 2, 3 # nil - */ - pm_location_t closing_loc; -} pm_array_node_t; - -/** - * ArrayPatternNode - * - * Represents an array pattern in pattern matching. - * - * foo in 1, 2 - * ^^^^^^^^^^^ - * - * foo in [1, 2] - * ^^^^^^^^^^^^^ - * - * foo in *1 - * ^^^^^^^^^ - * - * foo in Bar[] - * ^^^^^^^^^^^^ - * - * foo in Bar[1, 2, 3] - * ^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_ARRAY_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_array_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ArrayPatternNode#constant - */ - struct pm_node *constant; - - /** - * ArrayPatternNode#requireds - */ - struct pm_node_list requireds; - - /** - * ArrayPatternNode#rest - */ - struct pm_node *rest; - - /** - * ArrayPatternNode#posts - */ - struct pm_node_list posts; - - /** - * ArrayPatternNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * ArrayPatternNode#closing_loc - */ - pm_location_t closing_loc; -} pm_array_pattern_node_t; - -/** - * AssocNode - * - * Represents a hash key/value pair. - * - * { a => b } - * ^^^^^^ - * - * Type: ::PM_ASSOC_NODE - * - * @extends pm_node_t - */ -typedef struct pm_assoc_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * AssocNode#key - * - * The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * { a: b } - * ^ - * - * { foo => bar } - * ^^^ - * - * { def a; end => 1 } - * ^^^^^^^^^^ - */ - struct pm_node *key; - - /** - * AssocNode#value - * - * The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * { foo => bar } - * ^^^ - * - * { x: 1 } - * ^ - */ - struct pm_node *value; - - /** - * AssocNode#operator_loc - * - * The location of the `=>` operator, if present. - * - * { foo => bar } - * ^^ - */ - pm_location_t operator_loc; -} pm_assoc_node_t; - -/** - * AssocSplatNode - * - * Represents a splat in a hash literal. - * - * { **foo } - * ^^^^^ - * - * Type: ::PM_ASSOC_SPLAT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_assoc_splat_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * AssocSplatNode#value - * - * The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. - * - * { **foo } - * ^^^ - */ - struct pm_node *value; - - /** - * AssocSplatNode#operator_loc - * - * The location of the `**` operator. - * - * { **x } - * ^^ - */ - pm_location_t operator_loc; -} pm_assoc_splat_node_t; - -/** - * BackReferenceReadNode - * - * Represents reading a reference to a field in the previous match. - * - * $' - * ^^ - * - * Type: ::PM_BACK_REFERENCE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_back_reference_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BackReferenceReadNode#name - * - * The name of the back-reference variable, including the leading `$`. - * - * $& # name `:$&` - * - * $+ # name `:$+` - */ - pm_constant_id_t name; -} pm_back_reference_read_node_t; - -/** - * BeginNode - * - * Represents a begin statement. - * - * begin - * foo - * end - * ^^^^^ - * - * Type: ::PM_BEGIN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_begin_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BeginNode#begin_keyword_loc - */ - pm_location_t begin_keyword_loc; - - /** - * BeginNode#statements - */ - struct pm_statements_node *statements; - - /** - * BeginNode#rescue_clause - */ - struct pm_rescue_node *rescue_clause; - - /** - * BeginNode#else_clause - */ - struct pm_else_node *else_clause; - - /** - * BeginNode#ensure_clause - */ - struct pm_ensure_node *ensure_clause; - - /** - * BeginNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_begin_node_t; - -/** - * BlockArgumentNode - * - * Represents a block argument using `&`. - * - * bar(&args) - * ^^^^^^^^^^ - * - * Type: ::PM_BLOCK_ARGUMENT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_block_argument_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BlockArgumentNode#expression - */ - struct pm_node *expression; - - /** - * BlockArgumentNode#operator_loc - */ - pm_location_t operator_loc; -} pm_block_argument_node_t; - -/** - * BlockLocalVariableNode - * - * Represents a block local variable. - * - * a { |; b| } - * ^ - * - * Type: ::PM_BLOCK_LOCAL_VARIABLE_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_block_local_variable_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BlockLocalVariableNode#name - */ - pm_constant_id_t name; -} pm_block_local_variable_node_t; - -/** - * BlockNode - * - * Represents a block of ruby code. - * - * [1, 2, 3].each { |i| puts x } - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_BLOCK_NODE - * - * @extends pm_node_t - */ -typedef struct pm_block_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BlockNode#locals - */ - pm_constant_id_list_t locals; - - /** - * BlockNode#parameters - */ - struct pm_node *parameters; - - /** - * BlockNode#body - */ - struct pm_node *body; - - /** - * BlockNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * BlockNode#closing_loc - */ - pm_location_t closing_loc; -} pm_block_node_t; - -/** - * BlockParameterNode - * - * Represents a block parameter of a method, block, or lambda definition. - * - * def a(&b) - * ^^ - * end - * - * Type: ::PM_BLOCK_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_block_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BlockParameterNode#name - */ - pm_constant_id_t name; - - /** - * BlockParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * BlockParameterNode#operator_loc - */ - pm_location_t operator_loc; -} pm_block_parameter_node_t; - -/** - * BlockParametersNode - * - * Represents a block's parameters declaration. - * - * -> (a, b = 1; local) { } - * ^^^^^^^^^^^^^^^^^ - * - * foo do |a, b = 1; local| - * ^^^^^^^^^^^^^^^^^ - * end - * - * Type: ::PM_BLOCK_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_block_parameters_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BlockParametersNode#parameters - */ - struct pm_parameters_node *parameters; - - /** - * BlockParametersNode#locals - */ - struct pm_node_list locals; - - /** - * BlockParametersNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * BlockParametersNode#closing_loc - */ - pm_location_t closing_loc; -} pm_block_parameters_node_t; - -/** - * BreakNode - * - * Represents the use of the `break` keyword. - * - * break foo - * ^^^^^^^^^ - * - * Type: ::PM_BREAK_NODE - * - * @extends pm_node_t - */ -typedef struct pm_break_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * BreakNode#arguments - * - * The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * break foo - * ^^^ - */ - struct pm_arguments_node *arguments; - - /** - * BreakNode#keyword_loc - * - * The location of the `break` keyword. - * - * break foo - * ^^^^^ - */ - pm_location_t keyword_loc; -} pm_break_node_t; - -/** - * CallAndWriteNode - * - * Represents the use of the `&&=` operator on a call. - * - * foo.bar &&= value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CALL_AND_WRITE_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CallAndWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * CallAndWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallAndWriteNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallAndWriteNode#read_name - */ - pm_constant_id_t read_name; - - /** - * CallAndWriteNode#write_name - */ - pm_constant_id_t write_name; - - /** - * CallAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * CallAndWriteNode#value - */ - struct pm_node *value; -} pm_call_and_write_node_t; - -/** - * CallNode - * - * Represents a method call, in all of the various forms that can take. - * - * foo - * ^^^ - * - * foo() - * ^^^^^ - * - * +foo - * ^^^^ - * - * foo + bar - * ^^^^^^^^^ - * - * foo.bar - * ^^^^^^^ - * - * foo&.bar - * ^^^^^^^^ - * - * Type: ::PM_CALL_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CallNode#receiver - * - * The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * foo.bar - * ^^^ - * - * +foo - * ^^^ - * - * foo + bar - * ^^^ - */ - struct pm_node *receiver; - - /** - * CallNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallNode#name - */ - pm_constant_id_t name; - - /** - * CallNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * CallNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * CallNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * CallNode#block - */ - struct pm_node *block; -} pm_call_node_t; - -/** - * CallOperatorWriteNode - * - * Represents the use of an assignment operator on a call. - * - * foo.bar += baz - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_CALL_OPERATOR_WRITE_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CallOperatorWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * CallOperatorWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallOperatorWriteNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallOperatorWriteNode#read_name - */ - pm_constant_id_t read_name; - - /** - * CallOperatorWriteNode#write_name - */ - pm_constant_id_t write_name; - - /** - * CallOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; - - /** - * CallOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * CallOperatorWriteNode#value - */ - struct pm_node *value; -} pm_call_operator_write_node_t; - -/** - * CallOrWriteNode - * - * Represents the use of the `||=` operator on a call. - * - * foo.bar ||= value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CALL_OR_WRITE_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CallOrWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * CallOrWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallOrWriteNode#message_loc - */ - pm_location_t message_loc; - - /** - * CallOrWriteNode#read_name - */ - pm_constant_id_t read_name; - - /** - * CallOrWriteNode#write_name - */ - pm_constant_id_t write_name; - - /** - * CallOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * CallOrWriteNode#value - */ - struct pm_node *value; -} pm_call_or_write_node_t; - -/** - * CallTargetNode - * - * Represents assigning to a method call. - * - * foo.bar, = 1 - * ^^^^^^^ - * - * begin - * rescue => foo.bar - * ^^^^^^^ - * end - * - * for foo.bar in baz do end - * ^^^^^^^ - * - * Type: ::PM_CALL_TARGET_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_call_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CallTargetNode#receiver - */ - struct pm_node *receiver; - - /** - * CallTargetNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * CallTargetNode#name - */ - pm_constant_id_t name; - - /** - * CallTargetNode#message_loc - */ - pm_location_t message_loc; -} pm_call_target_node_t; - -/** - * CapturePatternNode - * - * Represents assigning to a local variable in pattern matching. - * - * foo => [bar => baz] - * ^^^^^^^^^^^^ - * - * Type: ::PM_CAPTURE_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_capture_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CapturePatternNode#value - */ - struct pm_node *value; - - /** - * CapturePatternNode#target - */ - struct pm_local_variable_target_node *target; - - /** - * CapturePatternNode#operator_loc - */ - pm_location_t operator_loc; -} pm_capture_pattern_node_t; - -/** - * CaseMatchNode - * - * Represents the use of a case statement for pattern matching. - * - * case true - * in false - * end - * ^^^^^^^^^ - * - * Type: ::PM_CASE_MATCH_NODE - * - * @extends pm_node_t - */ -typedef struct pm_case_match_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CaseMatchNode#predicate - */ - struct pm_node *predicate; - - /** - * CaseMatchNode#conditions - */ - struct pm_node_list conditions; - - /** - * CaseMatchNode#else_clause - */ - struct pm_else_node *else_clause; - - /** - * CaseMatchNode#case_keyword_loc - */ - pm_location_t case_keyword_loc; - - /** - * CaseMatchNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_case_match_node_t; - -/** - * CaseNode - * - * Represents the use of a case statement. - * - * case true - * when false - * end - * ^^^^^^^^^^ - * - * Type: ::PM_CASE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_case_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * CaseNode#predicate - */ - struct pm_node *predicate; - - /** - * CaseNode#conditions - */ - struct pm_node_list conditions; - - /** - * CaseNode#else_clause - */ - struct pm_else_node *else_clause; - - /** - * CaseNode#case_keyword_loc - */ - pm_location_t case_keyword_loc; - - /** - * CaseNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_case_node_t; - -/** - * ClassNode - * - * Represents a class declaration involving the `class` keyword. - * - * class Foo end - * ^^^^^^^^^^^^^ - * - * Type: ::PM_CLASS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassNode#locals - */ - pm_constant_id_list_t locals; - - /** - * ClassNode#class_keyword_loc - */ - pm_location_t class_keyword_loc; - - /** - * ClassNode#constant_path - */ - struct pm_node *constant_path; - - /** - * ClassNode#inheritance_operator_loc - */ - pm_location_t inheritance_operator_loc; - - /** - * ClassNode#superclass - */ - struct pm_node *superclass; - - /** - * ClassNode#body - */ - struct pm_node *body; - - /** - * ClassNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; - - /** - * ClassNode#name - */ - pm_constant_id_t name; -} pm_class_node_t; - -/** - * ClassVariableAndWriteNode - * - * Represents the use of the `&&=` operator for assignment to a class variable. - * - * @@target &&= value - * ^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CLASS_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * ClassVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ClassVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ClassVariableAndWriteNode#value - */ - struct pm_node *value; -} pm_class_variable_and_write_node_t; - -/** - * ClassVariableOperatorWriteNode - * - * Represents assigning to a class variable using an operator that isn't `=`. - * - * @@target += value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * ClassVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ClassVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * ClassVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * ClassVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_class_variable_operator_write_node_t; - -/** - * ClassVariableOrWriteNode - * - * Represents the use of the `||=` operator for assignment to a class variable. - * - * @@target ||= value - * ^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CLASS_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * ClassVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ClassVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ClassVariableOrWriteNode#value - */ - struct pm_node *value; -} pm_class_variable_or_write_node_t; - -/** - * ClassVariableReadNode - * - * Represents referencing a class variable. - * - * @@foo - * ^^^^^ - * - * Type: ::PM_CLASS_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassVariableReadNode#name - * - * The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @@abc # name `:@@abc` - * - * @@_test # name `:@@_test` - */ - pm_constant_id_t name; -} pm_class_variable_read_node_t; - -/** - * ClassVariableTargetNode - * - * Represents writing to a class variable in a context that doesn't have an explicit value. - * - * @@foo, @@bar = baz - * ^^^^^ ^^^^^ - * - * Type: ::PM_CLASS_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassVariableTargetNode#name - */ - pm_constant_id_t name; -} pm_class_variable_target_node_t; - -/** - * ClassVariableWriteNode - * - * Represents writing to a class variable. - * - * @@foo = 1 - * ^^^^^^^^^ - * - * Type: ::PM_CLASS_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_class_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ClassVariableWriteNode#name - * - * The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @@abc = 123 # name `@@abc` - * - * @@_test = :test # name `@@_test` - */ - pm_constant_id_t name; - - /** - * ClassVariableWriteNode#name_loc - * - * The location of the variable name. - * - * @@foo = :bar - * ^^^^^ - */ - pm_location_t name_loc; - - /** - * ClassVariableWriteNode#value - * - * The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * @@foo = :bar - * ^^^^ - * - * @@_xyz = 123 - * ^^^ - */ - struct pm_node *value; - - /** - * ClassVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * @@foo = :bar - * ^ - */ - pm_location_t operator_loc; -} pm_class_variable_write_node_t; - -/** - * ConstantAndWriteNode - * - * Represents the use of the `&&=` operator for assignment to a constant. - * - * Target &&= value - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * ConstantAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ConstantAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantAndWriteNode#value - */ - struct pm_node *value; -} pm_constant_and_write_node_t; - -/** - * ConstantOperatorWriteNode - * - * Represents assigning to a constant using an operator that isn't `=`. - * - * Target += value - * ^^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * ConstantOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ConstantOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * ConstantOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * ConstantOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_constant_operator_write_node_t; - -/** - * ConstantOrWriteNode - * - * Represents the use of the `||=` operator for assignment to a constant. - * - * Target ||= value - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * ConstantOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * ConstantOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantOrWriteNode#value - */ - struct pm_node *value; -} pm_constant_or_write_node_t; - -/** - * ConstantPathAndWriteNode - * - * Represents the use of the `&&=` operator for assignment to a constant path. - * - * Parent::Child &&= value - * ^^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_PATH_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantPathAndWriteNode#target - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantPathAndWriteNode#value - */ - struct pm_node *value; -} pm_constant_path_and_write_node_t; - -/** - * ConstantPathNode - * - * Represents accessing a constant through a path of `::` operators. - * - * Foo::Bar - * ^^^^^^^^ - * - * Type: ::PM_CONSTANT_PATH_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantPathNode#parent - * - * The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. - * - * Foo::Bar - * ^^^ - * - * self::Test - * ^^^^ - * - * a.b::C - * ^^^ - */ - struct pm_node *parent; - - /** - * ConstantPathNode#name - * - * The name of the constant being accessed. This could be `nil` in the event of a syntax error. - */ - pm_constant_id_t name; - - /** - * ConstantPathNode#delimiter_loc - * - * The location of the `::` delimiter. - * - * ::Foo - * ^^ - * - * One::Two - * ^^ - */ - pm_location_t delimiter_loc; - - /** - * ConstantPathNode#name_loc - * - * The location of the name of the constant. - * - * ::Foo - * ^^^ - * - * One::Two - * ^^^ - */ - pm_location_t name_loc; -} pm_constant_path_node_t; - -/** - * ConstantPathOperatorWriteNode - * - * Represents assigning to a constant path using an operator that isn't `=`. - * - * Parent::Child += value - * ^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_PATH_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantPathOperatorWriteNode#target - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * ConstantPathOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * ConstantPathOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_constant_path_operator_write_node_t; - -/** - * ConstantPathOrWriteNode - * - * Represents the use of the `||=` operator for assignment to a constant path. - * - * Parent::Child ||= value - * ^^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_PATH_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantPathOrWriteNode#target - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * ConstantPathOrWriteNode#value - */ - struct pm_node *value; -} pm_constant_path_or_write_node_t; - -/** - * ConstantPathTargetNode - * - * Represents writing to a constant path in a context that doesn't have an explicit value. - * - * Foo::Foo, Bar::Bar = baz - * ^^^^^^^^ ^^^^^^^^ - * - * Type: ::PM_CONSTANT_PATH_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantPathTargetNode#parent - */ - struct pm_node *parent; - - /** - * ConstantPathTargetNode#name - */ - pm_constant_id_t name; - - /** - * ConstantPathTargetNode#delimiter_loc - */ - pm_location_t delimiter_loc; - - /** - * ConstantPathTargetNode#name_loc - */ - pm_location_t name_loc; -} pm_constant_path_target_node_t; - -/** - * ConstantPathWriteNode - * - * Represents writing to a constant path. - * - * ::Foo = 1 - * ^^^^^^^^^ - * - * Foo::Bar = 1 - * ^^^^^^^^^^^^ - * - * ::Foo::Bar = 1 - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_CONSTANT_PATH_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_path_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantPathWriteNode#target - * - * A node representing the constant path being written to. - * - * Foo::Bar = 1 - * ^^^^^^^^ - * - * ::Foo = :abc - * ^^^^^ - */ - struct pm_constant_path_node *target; - - /** - * ConstantPathWriteNode#operator_loc - * - * The location of the `=` operator. - * - * ::ABC = 123 - * ^ - */ - pm_location_t operator_loc; - - /** - * ConstantPathWriteNode#value - * - * The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * FOO::BAR = :abc - * ^^^^ - */ - struct pm_node *value; -} pm_constant_path_write_node_t; - -/** - * ConstantReadNode - * - * Represents referencing a constant. - * - * Foo - * ^^^ - * - * Type: ::PM_CONSTANT_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantReadNode#name - * - * The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - * - * X # name `:X` - * - * SOME_CONSTANT # name `:SOME_CONSTANT` - */ - pm_constant_id_t name; -} pm_constant_read_node_t; - -/** - * ConstantTargetNode - * - * Represents writing to a constant in a context that doesn't have an explicit value. - * - * Foo, Bar = baz - * ^^^ ^^^ - * - * Type: ::PM_CONSTANT_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantTargetNode#name - */ - pm_constant_id_t name; -} pm_constant_target_node_t; - -/** - * ConstantWriteNode - * - * Represents writing to a constant. - * - * Foo = 1 - * ^^^^^^^ - * - * Type: ::PM_CONSTANT_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_constant_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ConstantWriteNode#name - * - * The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - * - * Foo = :bar # name `:Foo` - * - * XYZ = 1 # name `:XYZ` - */ - pm_constant_id_t name; - - /** - * ConstantWriteNode#name_loc - * - * The location of the constant name. - * - * FOO = 1 - * ^^^ - */ - pm_location_t name_loc; - - /** - * ConstantWriteNode#value - * - * The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * FOO = :bar - * ^^^^ - * - * MyClass = Class.new - * ^^^^^^^^^ - */ - struct pm_node *value; - - /** - * ConstantWriteNode#operator_loc - * - * The location of the `=` operator. - * - * FOO = :bar - * ^ - */ - pm_location_t operator_loc; -} pm_constant_write_node_t; - -/** - * DefNode - * - * Represents a method definition. - * - * def method - * end - * ^^^^^^^^^^ - * - * Type: ::PM_DEF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_def_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * DefNode#name - */ - pm_constant_id_t name; - - /** - * DefNode#name_loc - */ - pm_location_t name_loc; - - /** - * DefNode#receiver - */ - struct pm_node *receiver; - - /** - * DefNode#parameters - */ - struct pm_parameters_node *parameters; - - /** - * DefNode#body - */ - struct pm_node *body; - - /** - * DefNode#locals - */ - pm_constant_id_list_t locals; - - /** - * DefNode#def_keyword_loc - */ - pm_location_t def_keyword_loc; - - /** - * DefNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * DefNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * DefNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * DefNode#equal_loc - */ - pm_location_t equal_loc; - - /** - * DefNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_def_node_t; - -/** - * DefinedNode - * - * Represents the use of the `defined?` keyword. - * - * defined?(a) - * ^^^^^^^^^^^ - * - * Type: ::PM_DEFINED_NODE - * - * @extends pm_node_t - */ -typedef struct pm_defined_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * DefinedNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * DefinedNode#value - */ - struct pm_node *value; - - /** - * DefinedNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * DefinedNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_defined_node_t; - -/** - * ElseNode - * - * Represents an `else` clause in a `case`, `if`, or `unless` statement. - * - * if a then b else c end - * ^^^^^^^^^^ - * - * Type: ::PM_ELSE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_else_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ElseNode#else_keyword_loc - */ - pm_location_t else_keyword_loc; - - /** - * ElseNode#statements - */ - struct pm_statements_node *statements; - - /** - * ElseNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_else_node_t; - -/** - * EmbeddedStatementsNode - * - * Represents an interpolated set of statements. - * - * "foo #{bar}" - * ^^^^^^ - * - * Type: ::PM_EMBEDDED_STATEMENTS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_embedded_statements_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * EmbeddedStatementsNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * EmbeddedStatementsNode#statements - */ - struct pm_statements_node *statements; - - /** - * EmbeddedStatementsNode#closing_loc - */ - pm_location_t closing_loc; -} pm_embedded_statements_node_t; - -/** - * EmbeddedVariableNode - * - * Represents an interpolated variable. - * - * "foo #@bar" - * ^^^^^ - * - * Type: ::PM_EMBEDDED_VARIABLE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_embedded_variable_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * EmbeddedVariableNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * EmbeddedVariableNode#variable - */ - struct pm_node *variable; -} pm_embedded_variable_node_t; - -/** - * EnsureNode - * - * Represents an `ensure` clause in a `begin` statement. - * - * begin - * foo - * ensure - * ^^^^^^ - * bar - * end - * - * Type: ::PM_ENSURE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_ensure_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * EnsureNode#ensure_keyword_loc - */ - pm_location_t ensure_keyword_loc; - - /** - * EnsureNode#statements - */ - struct pm_statements_node *statements; - - /** - * EnsureNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_ensure_node_t; - -/** - * FalseNode - * - * Represents the use of the literal `false` keyword. - * - * false - * ^^^^^ - * - * Type: ::PM_FALSE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_false_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_false_node_t; - -/** - * FindPatternNode - * - * Represents a find pattern in pattern matching. - * - * foo in *bar, baz, *qux - * ^^^^^^^^^^^^^^^ - * - * foo in [*bar, baz, *qux] - * ^^^^^^^^^^^^^^^^^ - * - * foo in Foo(*bar, baz, *qux) - * ^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_FIND_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_find_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * FindPatternNode#constant - */ - struct pm_node *constant; - - /** - * FindPatternNode#left - */ - struct pm_splat_node *left; - - /** - * FindPatternNode#requireds - */ - struct pm_node_list requireds; - - /** - * FindPatternNode#right - */ - struct pm_node *right; - - /** - * FindPatternNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * FindPatternNode#closing_loc - */ - pm_location_t closing_loc; -} pm_find_pattern_node_t; - -/** - * FlipFlopNode - * - * Represents the use of the `..` or `...` operators to create flip flops. - * - * baz if foo .. bar - * ^^^^^^^^^^ - * - * Type: ::PM_FLIP_FLOP_NODE - - * Flags (#pm_range_flags): - * * ::PM_RANGE_FLAGS_EXCLUDE_END - * - * @extends pm_node_t - */ -typedef struct pm_flip_flop_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * FlipFlopNode#left - */ - struct pm_node *left; - - /** - * FlipFlopNode#right - */ - struct pm_node *right; - - /** - * FlipFlopNode#operator_loc - */ - pm_location_t operator_loc; -} pm_flip_flop_node_t; - -/** - * FloatNode - * - * Represents a floating point number literal. - * - * 1.0 - * ^^^ - * - * Type: ::PM_FLOAT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_float_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * FloatNode#value - * - * The value of the floating point number as a Float. - */ - double value; -} pm_float_node_t; - -/** - * ForNode - * - * Represents the use of the `for` keyword. - * - * for i in a end - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_FOR_NODE - * - * @extends pm_node_t - */ -typedef struct pm_for_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ForNode#index - * - * The index expression for `for` loops. - * - * for i in a end - * ^ - */ - struct pm_node *index; - - /** - * ForNode#collection - * - * The collection to iterate over. - * - * for i in a end - * ^ - */ - struct pm_node *collection; - - /** - * ForNode#statements - * - * Represents the body of statements to execute for each iteration of the loop. - * - * for i in a - * foo(i) - * ^^^^^^ - * end - */ - struct pm_statements_node *statements; - - /** - * ForNode#for_keyword_loc - * - * The location of the `for` keyword. - * - * for i in a end - * ^^^ - */ - pm_location_t for_keyword_loc; - - /** - * ForNode#in_keyword_loc - * - * The location of the `in` keyword. - * - * for i in a end - * ^^ - */ - pm_location_t in_keyword_loc; - - /** - * ForNode#do_keyword_loc - * - * The location of the `do` keyword, if present. - * - * for i in a do end - * ^^ - */ - pm_location_t do_keyword_loc; - - /** - * ForNode#end_keyword_loc - * - * The location of the `end` keyword. - * - * for i in a end - * ^^^ - */ - pm_location_t end_keyword_loc; -} pm_for_node_t; - -/** - * ForwardingArgumentsNode - * - * Represents forwarding all arguments to this method to another method. - * - * def foo(...) - * bar(...) - * ^^^ - * end - * - * Type: ::PM_FORWARDING_ARGUMENTS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_forwarding_arguments_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_forwarding_arguments_node_t; - -/** - * ForwardingParameterNode - * - * Represents the use of the forwarding parameter in a method, block, or lambda declaration. - * - * def foo(...) - * ^^^ - * end - * - * Type: ::PM_FORWARDING_PARAMETER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_forwarding_parameter_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_forwarding_parameter_node_t; - -/** - * ForwardingSuperNode - * - * Represents the use of the `super` keyword without parentheses or arguments. - * - * super - * ^^^^^ - * - * Type: ::PM_FORWARDING_SUPER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_forwarding_super_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ForwardingSuperNode#block - */ - struct pm_block_node *block; -} pm_forwarding_super_node_t; - -/** - * GlobalVariableAndWriteNode - * - * Represents the use of the `&&=` operator for assignment to a global variable. - * - * $target &&= value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_GLOBAL_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * GlobalVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * GlobalVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * GlobalVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * GlobalVariableAndWriteNode#value - */ - struct pm_node *value; -} pm_global_variable_and_write_node_t; - -/** - * GlobalVariableOperatorWriteNode - * - * Represents assigning to a global variable using an operator that isn't `=`. - * - * $target += value - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * GlobalVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * GlobalVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * GlobalVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * GlobalVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * GlobalVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_global_variable_operator_write_node_t; - -/** - * GlobalVariableOrWriteNode - * - * Represents the use of the `||=` operator for assignment to a global variable. - * - * $target ||= value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_GLOBAL_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * GlobalVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * GlobalVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * GlobalVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * GlobalVariableOrWriteNode#value - */ - struct pm_node *value; -} pm_global_variable_or_write_node_t; - -/** - * GlobalVariableReadNode - * - * Represents referencing a global variable. - * - * $foo - * ^^^^ - * - * Type: ::PM_GLOBAL_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * GlobalVariableReadNode#name - * - * The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - * - * $foo # name `:$foo` - * - * $_Test # name `:$_Test` - */ - pm_constant_id_t name; -} pm_global_variable_read_node_t; - -/** - * GlobalVariableTargetNode - * - * Represents writing to a global variable in a context that doesn't have an explicit value. - * - * $foo, $bar = baz - * ^^^^ ^^^^ - * - * Type: ::PM_GLOBAL_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * GlobalVariableTargetNode#name - */ - pm_constant_id_t name; -} pm_global_variable_target_node_t; - -/** - * GlobalVariableWriteNode - * - * Represents writing to a global variable. - * - * $foo = 1 - * ^^^^^^^^ - * - * Type: ::PM_GLOBAL_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_global_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * GlobalVariableWriteNode#name - * - * The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - * - * $foo = :bar # name `:$foo` - * - * $_Test = 123 # name `:$_Test` - */ - pm_constant_id_t name; - - /** - * GlobalVariableWriteNode#name_loc - * - * The location of the global variable's name. - * - * $foo = :bar - * ^^^^ - */ - pm_location_t name_loc; - - /** - * GlobalVariableWriteNode#value - * - * The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * $foo = :bar - * ^^^^ - * - * $-xyz = 123 - * ^^^ - */ - struct pm_node *value; - - /** - * GlobalVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * $foo = :bar - * ^ - */ - pm_location_t operator_loc; -} pm_global_variable_write_node_t; - -/** - * HashNode - * - * Represents a hash literal. - * - * { a => b } - * ^^^^^^^^^^ - * - * Type: ::PM_HASH_NODE - * - * @extends pm_node_t - */ -typedef struct pm_hash_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * HashNode#opening_loc - * - * The location of the opening brace. - * - * { a => b } - * ^ - */ - pm_location_t opening_loc; - - /** - * HashNode#elements - * - * The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. - * - * { a: b } - * ^^^^ - * - * { **foo } - * ^^^^^ - */ - struct pm_node_list elements; - - /** - * HashNode#closing_loc - * - * The location of the closing brace. - * - * { a => b } - * ^ - */ - pm_location_t closing_loc; -} pm_hash_node_t; - -/** - * HashPatternNode - * - * Represents a hash pattern in pattern matching. - * - * foo => { a: 1, b: 2 } - * ^^^^^^^^^^^^^^ - * - * foo => { a: 1, b: 2, **c } - * ^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_HASH_PATTERN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_hash_pattern_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * HashPatternNode#constant - */ - struct pm_node *constant; - - /** - * HashPatternNode#elements - */ - struct pm_node_list elements; - - /** - * HashPatternNode#rest - */ - struct pm_node *rest; - - /** - * HashPatternNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * HashPatternNode#closing_loc - */ - pm_location_t closing_loc; -} pm_hash_pattern_node_t; - -/** - * IfNode - * - * Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression. - * - * bar if foo - * ^^^^^^^^^^ - * - * if foo then bar end - * ^^^^^^^^^^^^^^^^^^^ - * - * foo ? bar : baz - * ^^^^^^^^^^^^^^^ - * - * Type: ::PM_IF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_if_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * IfNode#if_keyword_loc - * - * The location of the `if` keyword if present. - * - * bar if foo - * ^^ - * - * The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. - */ - pm_location_t if_keyword_loc; - - /** - * IfNode#predicate - * - * The node for the condition the `IfNode` is testing. - * - * if foo - * ^^^ - * bar - * end - * - * bar if foo - * ^^^ - * - * foo ? bar : baz - * ^^^ - */ - struct pm_node *predicate; - - /** - * IfNode#then_keyword_loc - * - * The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. - * - * if foo then bar end - * ^^^^ - * - * a ? b : c - * ^ - */ - pm_location_t then_keyword_loc; - - /** - * IfNode#statements - * - * Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. - * - * if foo - * bar - * ^^^ - * baz - * ^^^ - * end - */ - struct pm_statements_node *statements; - - /** - * IfNode#subsequent - * - * Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. - * - * if foo - * bar - * elsif baz - * ^^^^^^^^^ - * qux - * ^^^ - * end - * ^^^ - * - * if foo then bar else baz end - * ^^^^^^^^^^^^ - */ - struct pm_node *subsequent; - - /** - * IfNode#end_keyword_loc - * - * The location of the `end` keyword if present, `nil` otherwise. - * - * if foo - * bar - * end - * ^^^ - */ - pm_location_t end_keyword_loc; -} pm_if_node_t; - -/** - * ImaginaryNode - * - * Represents an imaginary number literal. - * - * 1.0i - * ^^^^ - * - * Type: ::PM_IMAGINARY_NODE - * - * @extends pm_node_t - */ -typedef struct pm_imaginary_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ImaginaryNode#numeric - */ - struct pm_node *numeric; -} pm_imaginary_node_t; - -/** - * ImplicitNode - * - * Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source. - * - * { foo: } - * ^^^^ - * - * { Foo: } - * ^^^^ - * - * foo in { bar: } - * ^^^^ - * - * Type: ::PM_IMPLICIT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_implicit_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ImplicitNode#value - */ - struct pm_node *value; -} pm_implicit_node_t; - -/** - * ImplicitRestNode - * - * Represents using a trailing comma to indicate an implicit rest parameter. - * - * foo { |bar,| } - * ^ - * - * foo in [bar,] - * ^ - * - * for foo, in bar do end - * ^ - * - * foo, = bar - * ^ - * - * Type: ::PM_IMPLICIT_REST_NODE - * - * @extends pm_node_t - */ -typedef struct pm_implicit_rest_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_implicit_rest_node_t; - -/** - * InNode - * - * Represents the use of the `in` keyword in a case statement. - * - * case a; in b then c end - * ^^^^^^^^^^^ - * - * Type: ::PM_IN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_in_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InNode#pattern - */ - struct pm_node *pattern; - - /** - * InNode#statements - */ - struct pm_statements_node *statements; - - /** - * InNode#in_loc - */ - pm_location_t in_loc; - - /** - * InNode#then_loc - */ - pm_location_t then_loc; -} pm_in_node_t; - -/** - * IndexAndWriteNode - * - * Represents the use of the `&&=` operator on a call to the `[]` method. - * - * foo.bar[baz] &&= value - * ^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INDEX_AND_WRITE_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * IndexAndWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexAndWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * IndexAndWriteNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexAndWriteNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexAndWriteNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexAndWriteNode#block - */ - struct pm_block_argument_node *block; - - /** - * IndexAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * IndexAndWriteNode#value - */ - struct pm_node *value; -} pm_index_and_write_node_t; - -/** - * IndexOperatorWriteNode - * - * Represents the use of an assignment operator on a call to `[]`. - * - * foo.bar[baz] += value - * ^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INDEX_OPERATOR_WRITE_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * IndexOperatorWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexOperatorWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * IndexOperatorWriteNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexOperatorWriteNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexOperatorWriteNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexOperatorWriteNode#block - */ - struct pm_block_argument_node *block; - - /** - * IndexOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; - - /** - * IndexOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * IndexOperatorWriteNode#value - */ - struct pm_node *value; -} pm_index_operator_write_node_t; - -/** - * IndexOrWriteNode - * - * Represents the use of the `||=` operator on a call to `[]`. - * - * foo.bar[baz] ||= value - * ^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INDEX_OR_WRITE_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * IndexOrWriteNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexOrWriteNode#call_operator_loc - */ - pm_location_t call_operator_loc; - - /** - * IndexOrWriteNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexOrWriteNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexOrWriteNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexOrWriteNode#block - */ - struct pm_block_argument_node *block; - - /** - * IndexOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * IndexOrWriteNode#value - */ - struct pm_node *value; -} pm_index_or_write_node_t; - -/** - * IndexTargetNode - * - * Represents assigning to an index. - * - * foo[bar], = 1 - * ^^^^^^^^ - * - * begin - * rescue => foo[bar] - * ^^^^^^^^ - * end - * - * for foo[bar] in baz do end - * ^^^^^^^^ - * - * Type: ::PM_INDEX_TARGET_NODE - - * Flags (#pm_call_node_flags): - * * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION - * * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL - * * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE - * * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY - * - * @extends pm_node_t - */ -typedef struct pm_index_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * IndexTargetNode#receiver - */ - struct pm_node *receiver; - - /** - * IndexTargetNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * IndexTargetNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * IndexTargetNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * IndexTargetNode#block - */ - struct pm_block_argument_node *block; -} pm_index_target_node_t; - -/** - * InstanceVariableAndWriteNode - * - * Represents the use of the `&&=` operator for assignment to an instance variable. - * - * @target &&= value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INSTANCE_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InstanceVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * InstanceVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * InstanceVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * InstanceVariableAndWriteNode#value - */ - struct pm_node *value; -} pm_instance_variable_and_write_node_t; - -/** - * InstanceVariableOperatorWriteNode - * - * Represents assigning to an instance variable using an operator that isn't `=`. - * - * @target += value - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InstanceVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * InstanceVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * InstanceVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * InstanceVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * InstanceVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; -} pm_instance_variable_operator_write_node_t; - -/** - * InstanceVariableOrWriteNode - * - * Represents the use of the `||=` operator for assignment to an instance variable. - * - * @target ||= value - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INSTANCE_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InstanceVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * InstanceVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * InstanceVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * InstanceVariableOrWriteNode#value - */ - struct pm_node *value; -} pm_instance_variable_or_write_node_t; - -/** - * InstanceVariableReadNode - * - * Represents referencing an instance variable. - * - * @foo - * ^^^^ - * - * Type: ::PM_INSTANCE_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InstanceVariableReadNode#name - * - * The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @x # name `:@x` - * - * @_test # name `:@_test` - */ - pm_constant_id_t name; -} pm_instance_variable_read_node_t; - -/** - * InstanceVariableTargetNode - * - * Represents writing to an instance variable in a context that doesn't have an explicit value. - * - * @foo, @bar = baz - * ^^^^ ^^^^ - * - * Type: ::PM_INSTANCE_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InstanceVariableTargetNode#name - */ - pm_constant_id_t name; -} pm_instance_variable_target_node_t; - -/** - * InstanceVariableWriteNode - * - * Represents writing to an instance variable. - * - * @foo = 1 - * ^^^^^^^^ - * - * Type: ::PM_INSTANCE_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_instance_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InstanceVariableWriteNode#name - * - * The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * @x = :y # name `:@x` - * - * @_foo = "bar" # name `@_foo` - */ - pm_constant_id_t name; - - /** - * InstanceVariableWriteNode#name_loc - * - * The location of the variable name. - * - * @_x = 1 - * ^^^ - */ - pm_location_t name_loc; - - /** - * InstanceVariableWriteNode#value - * - * The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * @foo = :bar - * ^^^^ - * - * @_x = 1234 - * ^^^^ - */ - struct pm_node *value; - - /** - * InstanceVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * @x = y - * ^ - */ - pm_location_t operator_loc; -} pm_instance_variable_write_node_t; - -/** - * IntegerNode - * - * Represents an integer number literal. - * - * 1 - * ^ - * - * Type: ::PM_INTEGER_NODE - - * Flags (#pm_integer_base_flags): - * * ::PM_INTEGER_BASE_FLAGS_BINARY - * * ::PM_INTEGER_BASE_FLAGS_DECIMAL - * * ::PM_INTEGER_BASE_FLAGS_OCTAL - * * ::PM_INTEGER_BASE_FLAGS_HEXADECIMAL - * - * @extends pm_node_t - */ -typedef struct pm_integer_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * IntegerNode#value - * - * The value of the integer literal as a number. - */ - pm_integer_t value; -} pm_integer_node_t; - -/** - * InterpolatedMatchLastLineNode - * - * Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object. - * - * if /foo #{bar} baz/ then end - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INTERPOLATED_MATCH_LAST_LINE_NODE - - * Flags (#pm_regular_expression_flags): - * * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_match_last_line_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InterpolatedMatchLastLineNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedMatchLastLineNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedMatchLastLineNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_match_last_line_node_t; - -/** - * InterpolatedRegularExpressionNode - * - * Represents a regular expression literal that contains interpolation. - * - * /foo #{bar} baz/ - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INTERPOLATED_REGULAR_EXPRESSION_NODE - - * Flags (#pm_regular_expression_flags): - * * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_regular_expression_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InterpolatedRegularExpressionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedRegularExpressionNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedRegularExpressionNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_regular_expression_node_t; - -/** - * InterpolatedStringNode - * - * Represents a string literal that contains interpolation. - * - * "foo #{bar} baz" - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INTERPOLATED_STRING_NODE - - * Flags (#pm_interpolated_string_node_flags): - * * ::PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN - * * ::PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_string_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InterpolatedStringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedStringNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedStringNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_string_node_t; - -/** - * InterpolatedSymbolNode - * - * Represents a symbol literal that contains interpolation. - * - * :"foo #{bar} baz" - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INTERPOLATED_SYMBOL_NODE - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_symbol_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InterpolatedSymbolNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedSymbolNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedSymbolNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_symbol_node_t; - -/** - * InterpolatedXStringNode - * - * Represents an xstring literal that contains interpolation. - * - * `foo #{bar} baz` - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_INTERPOLATED_X_STRING_NODE - * - * @extends pm_node_t - */ -typedef struct pm_interpolated_x_string_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * InterpolatedXStringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * InterpolatedXStringNode#parts - */ - struct pm_node_list parts; - - /** - * InterpolatedXStringNode#closing_loc - */ - pm_location_t closing_loc; -} pm_interpolated_x_string_node_t; - -/** - * ItLocalVariableReadNode - * - * Represents reading from the implicit `it` local variable. - * - * -> { it } - * ^^ - * - * Type: ::PM_IT_LOCAL_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_it_local_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_it_local_variable_read_node_t; - -/** - * ItParametersNode - * - * Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda. - * - * -> { it + it } - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_IT_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_it_parameters_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_it_parameters_node_t; - -/** - * KeywordHashNode - * - * Represents a hash literal without opening and closing braces. - * - * foo(a: b) - * ^^^^ - * - * Type: ::PM_KEYWORD_HASH_NODE - - * Flags (#pm_keyword_hash_node_flags): - * * ::PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS - * - * @extends pm_node_t - */ -typedef struct pm_keyword_hash_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * KeywordHashNode#elements - */ - struct pm_node_list elements; -} pm_keyword_hash_node_t; - -/** - * KeywordRestParameterNode - * - * Represents a keyword rest parameter to a method, block, or lambda definition. - * - * def a(**b) - * ^^^ - * end - * - * Type: ::PM_KEYWORD_REST_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_keyword_rest_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * KeywordRestParameterNode#name - */ - pm_constant_id_t name; - - /** - * KeywordRestParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * KeywordRestParameterNode#operator_loc - */ - pm_location_t operator_loc; -} pm_keyword_rest_parameter_node_t; - -/** - * LambdaNode - * - * Represents using a lambda literal (not the lambda method call). - * - * ->(value) { value * 2 } - * ^^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_LAMBDA_NODE - * - * @extends pm_node_t - */ -typedef struct pm_lambda_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LambdaNode#locals - */ - pm_constant_id_list_t locals; - - /** - * LambdaNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * LambdaNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * LambdaNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * LambdaNode#parameters - */ - struct pm_node *parameters; - - /** - * LambdaNode#body - */ - struct pm_node *body; -} pm_lambda_node_t; - -/** - * LocalVariableAndWriteNode - * - * Represents the use of the `&&=` operator for assignment to a local variable. - * - * target &&= value - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_LOCAL_VARIABLE_AND_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_and_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LocalVariableAndWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * LocalVariableAndWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * LocalVariableAndWriteNode#value - */ - struct pm_node *value; - - /** - * LocalVariableAndWriteNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableAndWriteNode#depth - */ - uint32_t depth; -} pm_local_variable_and_write_node_t; - -/** - * LocalVariableOperatorWriteNode - * - * Represents assigning to a local variable using an operator that isn't `=`. - * - * target += value - * ^^^^^^^^^^^^^^^ - * - * Type: ::PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_operator_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LocalVariableOperatorWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * LocalVariableOperatorWriteNode#binary_operator_loc - */ - pm_location_t binary_operator_loc; - - /** - * LocalVariableOperatorWriteNode#value - */ - struct pm_node *value; - - /** - * LocalVariableOperatorWriteNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableOperatorWriteNode#binary_operator - */ - pm_constant_id_t binary_operator; - - /** - * LocalVariableOperatorWriteNode#depth - */ - uint32_t depth; -} pm_local_variable_operator_write_node_t; - -/** - * LocalVariableOrWriteNode - * - * Represents the use of the `||=` operator for assignment to a local variable. - * - * target ||= value - * ^^^^^^^^^^^^^^^^ - * - * Type: ::PM_LOCAL_VARIABLE_OR_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_or_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LocalVariableOrWriteNode#name_loc - */ - pm_location_t name_loc; - - /** - * LocalVariableOrWriteNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * LocalVariableOrWriteNode#value - */ - struct pm_node *value; - - /** - * LocalVariableOrWriteNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableOrWriteNode#depth - */ - uint32_t depth; -} pm_local_variable_or_write_node_t; - -/** - * LocalVariableReadNode - * - * Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. - * - * foo - * ^^^ - * - * Type: ::PM_LOCAL_VARIABLE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LocalVariableReadNode#name - * - * The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * x # name `:x` - * - * _Test # name `:_Test` - * - * Note that this can also be an underscore followed by a number for the default block parameters. - * - * _1 # name `:_1` - */ - pm_constant_id_t name; - - /** - * LocalVariableReadNode#depth - * - * The number of visible scopes that should be searched to find the origin of this local variable. - * - * foo = 1; foo # depth 0 - * - * bar = 2; tap { bar } # depth 1 - * - * The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - */ - uint32_t depth; -} pm_local_variable_read_node_t; - -/** - * LocalVariableTargetNode - * - * Represents writing to a local variable in a context that doesn't have an explicit value. - * - * foo, bar = baz - * ^^^ ^^^ - * - * Type: ::PM_LOCAL_VARIABLE_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LocalVariableTargetNode#name - */ - pm_constant_id_t name; - - /** - * LocalVariableTargetNode#depth - */ - uint32_t depth; -} pm_local_variable_target_node_t; - -/** - * LocalVariableWriteNode - * - * Represents writing to a local variable. - * - * foo = 1 - * ^^^^^^^ - * - * Type: ::PM_LOCAL_VARIABLE_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_local_variable_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * LocalVariableWriteNode#name - * - * The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - * - * foo = :bar # name `:foo` - * - * abc = 123 # name `:abc` - */ - pm_constant_id_t name; - - /** - * LocalVariableWriteNode#depth - * - * The number of semantic scopes we have to traverse to find the declaration of this variable. - * - * foo = 1 # depth 0 - * - * tap { foo = 1 } # depth 1 - * - * The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - */ - uint32_t depth; - - /** - * LocalVariableWriteNode#name_loc - * - * The location of the variable name. - * - * foo = :bar - * ^^^ - */ - pm_location_t name_loc; - - /** - * LocalVariableWriteNode#value - * - * The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * foo = :bar - * ^^^^ - * - * abc = 1234 - * ^^^^ - * - * Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write. - * - * foo = foo - */ - struct pm_node *value; - - /** - * LocalVariableWriteNode#operator_loc - * - * The location of the `=` operator. - * - * x = :y - * ^ - */ - pm_location_t operator_loc; -} pm_local_variable_write_node_t; - -/** - * MatchLastLineNode - * - * Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. - * - * if /foo/i then end - * ^^^^^^ - * - * Type: ::PM_MATCH_LAST_LINE_NODE - - * Flags (#pm_regular_expression_flags): - * * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_match_last_line_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * MatchLastLineNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * MatchLastLineNode#content_loc - */ - pm_location_t content_loc; - - /** - * MatchLastLineNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * MatchLastLineNode#unescaped - */ - pm_string_t unescaped; -} pm_match_last_line_node_t; - -/** - * MatchPredicateNode - * - * Represents the use of the modifier `in` operator. - * - * foo in bar - * ^^^^^^^^^^ - * - * Type: ::PM_MATCH_PREDICATE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_match_predicate_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * MatchPredicateNode#value - */ - struct pm_node *value; - - /** - * MatchPredicateNode#pattern - */ - struct pm_node *pattern; - - /** - * MatchPredicateNode#operator_loc - */ - pm_location_t operator_loc; -} pm_match_predicate_node_t; - -/** - * MatchRequiredNode - * - * Represents the use of the `=>` operator. - * - * foo => bar - * ^^^^^^^^^^ - * - * Type: ::PM_MATCH_REQUIRED_NODE - * - * @extends pm_node_t - */ -typedef struct pm_match_required_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * MatchRequiredNode#value - */ - struct pm_node *value; - - /** - * MatchRequiredNode#pattern - */ - struct pm_node *pattern; - - /** - * MatchRequiredNode#operator_loc - */ - pm_location_t operator_loc; -} pm_match_required_node_t; - -/** - * MatchWriteNode - * - * Represents writing local variables using a regular expression match with named capture groups. - * - * /(?bar)/ =~ baz - * ^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_MATCH_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_match_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * MatchWriteNode#call - */ - struct pm_call_node *call; - - /** - * MatchWriteNode#targets - */ - struct pm_node_list targets; -} pm_match_write_node_t; - -/** - * MissingNode - * - * Represents a node that is missing from the source and results in a syntax error. - * - * Type: ::PM_MISSING_NODE - * - * @extends pm_node_t - */ -typedef struct pm_missing_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_missing_node_t; - -/** - * ModuleNode - * - * Represents a module declaration involving the `module` keyword. - * - * module Foo end - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_MODULE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_module_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ModuleNode#locals - */ - pm_constant_id_list_t locals; - - /** - * ModuleNode#module_keyword_loc - */ - pm_location_t module_keyword_loc; - - /** - * ModuleNode#constant_path - */ - struct pm_node *constant_path; - - /** - * ModuleNode#body - */ - struct pm_node *body; - - /** - * ModuleNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; - - /** - * ModuleNode#name - */ - pm_constant_id_t name; -} pm_module_node_t; - -/** - * MultiTargetNode - * - * Represents a multi-target expression. - * - * a, (b, c) = 1, 2, 3 - * ^^^^^^ - * - * This can be a part of `MultiWriteNode` as above, or the target of a `for` loop - * - * for a, b in [[1, 2], [3, 4]] - * ^^^^ - * - * Type: ::PM_MULTI_TARGET_NODE - * - * @extends pm_node_t - */ -typedef struct pm_multi_target_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * MultiTargetNode#lefts - * - * Represents the targets expressions before a splat node. - * - * a, (b, c, *) = 1, 2, 3, 4, 5 - * ^^^^ - * - * The splat node can be absent, in that case all target expressions are in the left field. - * - * a, (b, c) = 1, 2, 3, 4, 5 - * ^^^^ - */ - struct pm_node_list lefts; - - /** - * MultiTargetNode#rest - * - * Represents a splat node in the target expression. - * - * a, (b, *c) = 1, 2, 3, 4 - * ^^ - * - * The variable can be empty, this results in a `SplatNode` with a `nil` expression field. - * - * a, (b, *) = 1, 2, 3, 4 - * ^ - * - * If the `*` is omitted, this field will contain an `ImplicitRestNode` - * - * a, (b,) = 1, 2, 3, 4 - * ^ - */ - struct pm_node *rest; - - /** - * MultiTargetNode#rights - * - * Represents the targets expressions after a splat node. - * - * a, (*, b, c) = 1, 2, 3, 4, 5 - * ^^^^ - */ - struct pm_node_list rights; - - /** - * MultiTargetNode#lparen_loc - * - * The location of the opening parenthesis. - * - * a, (b, c) = 1, 2, 3 - * ^ - */ - pm_location_t lparen_loc; - - /** - * MultiTargetNode#rparen_loc - * - * The location of the closing parenthesis. - * - * a, (b, c) = 1, 2, 3 - * ^ - */ - pm_location_t rparen_loc; -} pm_multi_target_node_t; - -/** - * MultiWriteNode - * - * Represents a write to a multi-target expression. - * - * a, b, c = 1, 2, 3 - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_MULTI_WRITE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_multi_write_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * MultiWriteNode#lefts - * - * Represents the targets expressions before a splat node. - * - * a, b, * = 1, 2, 3, 4, 5 - * ^^^^ - * - * The splat node can be absent, in that case all target expressions are in the left field. - * - * a, b, c = 1, 2, 3, 4, 5 - * ^^^^^^^ - */ - struct pm_node_list lefts; - - /** - * MultiWriteNode#rest - * - * Represents a splat node in the target expression. - * - * a, b, *c = 1, 2, 3, 4 - * ^^ - * - * The variable can be empty, this results in a `SplatNode` with a `nil` expression field. - * - * a, b, * = 1, 2, 3, 4 - * ^ - * - * If the `*` is omitted, this field will contain an `ImplicitRestNode` - * - * a, b, = 1, 2, 3, 4 - * ^ - */ - struct pm_node *rest; - - /** - * MultiWriteNode#rights - * - * Represents the targets expressions after a splat node. - * - * a, *, b, c = 1, 2, 3, 4, 5 - * ^^^^ - */ - struct pm_node_list rights; - - /** - * MultiWriteNode#lparen_loc - * - * The location of the opening parenthesis. - * - * (a, b, c) = 1, 2, 3 - * ^ - */ - pm_location_t lparen_loc; - - /** - * MultiWriteNode#rparen_loc - * - * The location of the closing parenthesis. - * - * (a, b, c) = 1, 2, 3 - * ^ - */ - pm_location_t rparen_loc; - - /** - * MultiWriteNode#operator_loc - * - * The location of the operator. - * - * a, b, c = 1, 2, 3 - * ^ - */ - pm_location_t operator_loc; - - /** - * MultiWriteNode#value - * - * The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * a, b, c = 1, 2, 3 - * ^^^^^^^ - */ - struct pm_node *value; -} pm_multi_write_node_t; - -/** - * NextNode - * - * Represents the use of the `next` keyword. - * - * next 1 - * ^^^^^^ - * - * Type: ::PM_NEXT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_next_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * NextNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * NextNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_next_node_t; - -/** - * NilNode - * - * Represents the use of the `nil` keyword. - * - * nil - * ^^^ - * - * Type: ::PM_NIL_NODE - * - * @extends pm_node_t - */ -typedef struct pm_nil_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_nil_node_t; - -/** - * NoKeywordsParameterNode - * - * Represents the use of `**nil` inside method arguments. - * - * def a(**nil) - * ^^^^^ - * end - * - * Type: ::PM_NO_KEYWORDS_PARAMETER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_no_keywords_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * NoKeywordsParameterNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * NoKeywordsParameterNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_no_keywords_parameter_node_t; - -/** - * NumberedParametersNode - * - * Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. - * - * -> { _1 + _2 } - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_NUMBERED_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_numbered_parameters_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * NumberedParametersNode#maximum - */ - uint8_t maximum; -} pm_numbered_parameters_node_t; - -/** - * NumberedReferenceReadNode - * - * Represents reading a numbered reference to a capture in the previous match. - * - * $1 - * ^^ - * - * Type: ::PM_NUMBERED_REFERENCE_READ_NODE - * - * @extends pm_node_t - */ -typedef struct pm_numbered_reference_read_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * NumberedReferenceReadNode#number - * - * The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. - * - * $1 # number `1` - * - * $5432 # number `5432` - * - * $4294967296 # number `0` - */ - uint32_t number; -} pm_numbered_reference_read_node_t; - -/** - * OptionalKeywordParameterNode - * - * Represents an optional keyword parameter to a method, block, or lambda definition. - * - * def a(b: 1) - * ^^^^ - * end - * - * Type: ::PM_OPTIONAL_KEYWORD_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_optional_keyword_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * OptionalKeywordParameterNode#name - */ - pm_constant_id_t name; - - /** - * OptionalKeywordParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * OptionalKeywordParameterNode#value - */ - struct pm_node *value; -} pm_optional_keyword_parameter_node_t; - -/** - * OptionalParameterNode - * - * Represents an optional parameter to a method, block, or lambda definition. - * - * def a(b = 1) - * ^^^^^ - * end - * - * Type: ::PM_OPTIONAL_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_optional_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * OptionalParameterNode#name - */ - pm_constant_id_t name; - - /** - * OptionalParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * OptionalParameterNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * OptionalParameterNode#value - */ - struct pm_node *value; -} pm_optional_parameter_node_t; - -/** - * OrNode - * - * Represents the use of the `||` operator or the `or` keyword. - * - * left or right - * ^^^^^^^^^^^^^ - * - * Type: ::PM_OR_NODE - * - * @extends pm_node_t - */ -typedef struct pm_or_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * OrNode#left - * - * Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * left or right - * ^^^^ - * - * 1 || 2 - * ^ - */ - struct pm_node *left; - - /** - * OrNode#right - * - * Represents the right side of the expression. - * - * left || right - * ^^^^^ - * - * 1 or 2 - * ^ - */ - struct pm_node *right; - - /** - * OrNode#operator_loc - * - * The location of the `or` keyword or the `||` operator. - * - * left or right - * ^^ - */ - pm_location_t operator_loc; -} pm_or_node_t; - -/** - * ParametersNode - * - * Represents the list of parameters on a method, block, or lambda definition. - * - * def a(b, c, d) - * ^^^^^^^ - * end - * - * Type: ::PM_PARAMETERS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_parameters_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ParametersNode#requireds - */ - struct pm_node_list requireds; - - /** - * ParametersNode#optionals - */ - struct pm_node_list optionals; - - /** - * ParametersNode#rest - */ - struct pm_node *rest; - - /** - * ParametersNode#posts - */ - struct pm_node_list posts; - - /** - * ParametersNode#keywords - */ - struct pm_node_list keywords; - - /** - * ParametersNode#keyword_rest - */ - struct pm_node *keyword_rest; - - /** - * ParametersNode#block - */ - struct pm_block_parameter_node *block; -} pm_parameters_node_t; - -/** - * ParenthesesNode - * - * Represents a parenthesized expression - * - * (10 + 34) - * ^^^^^^^^^ - * - * Type: ::PM_PARENTHESES_NODE - * - * @extends pm_node_t - */ -typedef struct pm_parentheses_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ParenthesesNode#body - */ - struct pm_node *body; - - /** - * ParenthesesNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * ParenthesesNode#closing_loc - */ - pm_location_t closing_loc; -} pm_parentheses_node_t; - -/** - * PinnedExpressionNode - * - * Represents the use of the `^` operator for pinning an expression in a pattern matching expression. - * - * foo in ^(bar) - * ^^^^^^ - * - * Type: ::PM_PINNED_EXPRESSION_NODE - * - * @extends pm_node_t - */ -typedef struct pm_pinned_expression_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * PinnedExpressionNode#expression - */ - struct pm_node *expression; - - /** - * PinnedExpressionNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * PinnedExpressionNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * PinnedExpressionNode#rparen_loc - */ - pm_location_t rparen_loc; -} pm_pinned_expression_node_t; - -/** - * PinnedVariableNode - * - * Represents the use of the `^` operator for pinning a variable in a pattern matching expression. - * - * foo in ^bar - * ^^^^ - * - * Type: ::PM_PINNED_VARIABLE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_pinned_variable_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * PinnedVariableNode#variable - */ - struct pm_node *variable; - - /** - * PinnedVariableNode#operator_loc - */ - pm_location_t operator_loc; -} pm_pinned_variable_node_t; - -/** - * PostExecutionNode - * - * Represents the use of the `END` keyword. - * - * END { foo } - * ^^^^^^^^^^^ - * - * Type: ::PM_POST_EXECUTION_NODE - * - * @extends pm_node_t - */ -typedef struct pm_post_execution_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * PostExecutionNode#statements - */ - struct pm_statements_node *statements; - - /** - * PostExecutionNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * PostExecutionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * PostExecutionNode#closing_loc - */ - pm_location_t closing_loc; -} pm_post_execution_node_t; - -/** - * PreExecutionNode - * - * Represents the use of the `BEGIN` keyword. - * - * BEGIN { foo } - * ^^^^^^^^^^^^^ - * - * Type: ::PM_PRE_EXECUTION_NODE - * - * @extends pm_node_t - */ -typedef struct pm_pre_execution_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * PreExecutionNode#statements - */ - struct pm_statements_node *statements; - - /** - * PreExecutionNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * PreExecutionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * PreExecutionNode#closing_loc - */ - pm_location_t closing_loc; -} pm_pre_execution_node_t; - -/** - * ProgramNode - * - * The top level node of any parse tree. - * - * Type: ::PM_PROGRAM_NODE - * - * @extends pm_node_t - */ -typedef struct pm_program_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ProgramNode#locals - */ - pm_constant_id_list_t locals; - - /** - * ProgramNode#statements - */ - struct pm_statements_node *statements; -} pm_program_node_t; - -/** - * RangeNode - * - * Represents the use of the `..` or `...` operators. - * - * 1..2 - * ^^^^ - * - * c if a =~ /left/ ... b =~ /right/ - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_RANGE_NODE - - * Flags (#pm_range_flags): - * * ::PM_RANGE_FLAGS_EXCLUDE_END - * - * @extends pm_node_t - */ -typedef struct pm_range_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RangeNode#left - * - * The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * 1... - * ^ - * - * hello...goodbye - * ^^^^^ - */ - struct pm_node *left; - - /** - * RangeNode#right - * - * The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * ..5 - * ^ - * - * 1...foo - * ^^^ - * If neither right-hand or left-hand side was included, this will be a MissingNode. - */ - struct pm_node *right; - - /** - * RangeNode#operator_loc - * - * The location of the `..` or `...` operator. - */ - pm_location_t operator_loc; -} pm_range_node_t; - -/** - * RationalNode - * - * Represents a rational number literal. - * - * 1.0r - * ^^^^ - * - * Type: ::PM_RATIONAL_NODE - - * Flags (#pm_integer_base_flags): - * * ::PM_INTEGER_BASE_FLAGS_BINARY - * * ::PM_INTEGER_BASE_FLAGS_DECIMAL - * * ::PM_INTEGER_BASE_FLAGS_OCTAL - * * ::PM_INTEGER_BASE_FLAGS_HEXADECIMAL - * - * @extends pm_node_t - */ -typedef struct pm_rational_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RationalNode#numerator - * - * The numerator of the rational number. - * - * 1.5r # numerator 3 - */ - pm_integer_t numerator; - - /** - * RationalNode#denominator - * - * The denominator of the rational number. - * - * 1.5r # denominator 2 - */ - pm_integer_t denominator; -} pm_rational_node_t; - -/** - * RedoNode - * - * Represents the use of the `redo` keyword. - * - * redo - * ^^^^ - * - * Type: ::PM_REDO_NODE - * - * @extends pm_node_t - */ -typedef struct pm_redo_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_redo_node_t; - -/** - * RegularExpressionNode - * - * Represents a regular expression literal with no interpolation. - * - * /foo/i - * ^^^^^^ - * - * Type: ::PM_REGULAR_EXPRESSION_NODE - - * Flags (#pm_regular_expression_flags): - * * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED - * * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE - * * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE - * * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP - * * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT - * * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J - * * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8 - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_regular_expression_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RegularExpressionNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * RegularExpressionNode#content_loc - */ - pm_location_t content_loc; - - /** - * RegularExpressionNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * RegularExpressionNode#unescaped - */ - pm_string_t unescaped; -} pm_regular_expression_node_t; - -/** - * RequiredKeywordParameterNode - * - * Represents a required keyword parameter to a method, block, or lambda definition. - * - * def a(b: ) - * ^^ - * end - * - * Type: ::PM_REQUIRED_KEYWORD_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_required_keyword_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RequiredKeywordParameterNode#name - */ - pm_constant_id_t name; - - /** - * RequiredKeywordParameterNode#name_loc - */ - pm_location_t name_loc; -} pm_required_keyword_parameter_node_t; - -/** - * RequiredParameterNode - * - * Represents a required parameter to a method, block, or lambda definition. - * - * def a(b) - * ^ - * end - * - * Type: ::PM_REQUIRED_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_required_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RequiredParameterNode#name - */ - pm_constant_id_t name; -} pm_required_parameter_node_t; - -/** - * RescueModifierNode - * - * Represents an expression modified with a rescue. - * - * foo rescue nil - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_RESCUE_MODIFIER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_rescue_modifier_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RescueModifierNode#expression - */ - struct pm_node *expression; - - /** - * RescueModifierNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * RescueModifierNode#rescue_expression - */ - struct pm_node *rescue_expression; -} pm_rescue_modifier_node_t; - -/** - * RescueNode - * - * Represents a rescue statement. - * - * begin - * rescue Foo, *splat, Bar => ex - * foo - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * end - * - * `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field. - * - * Type: ::PM_RESCUE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_rescue_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RescueNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * RescueNode#exceptions - */ - struct pm_node_list exceptions; - - /** - * RescueNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * RescueNode#reference - */ - struct pm_node *reference; - - /** - * RescueNode#statements - */ - struct pm_statements_node *statements; - - /** - * RescueNode#subsequent - */ - struct pm_rescue_node *subsequent; -} pm_rescue_node_t; - -/** - * RestParameterNode - * - * Represents a rest parameter to a method, block, or lambda definition. - * - * def a(*b) - * ^^ - * end - * - * Type: ::PM_REST_PARAMETER_NODE - - * Flags (#pm_parameter_flags): - * * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER - * - * @extends pm_node_t - */ -typedef struct pm_rest_parameter_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * RestParameterNode#name - */ - pm_constant_id_t name; - - /** - * RestParameterNode#name_loc - */ - pm_location_t name_loc; - - /** - * RestParameterNode#operator_loc - */ - pm_location_t operator_loc; -} pm_rest_parameter_node_t; - -/** - * RetryNode - * - * Represents the use of the `retry` keyword. - * - * retry - * ^^^^^ - * - * Type: ::PM_RETRY_NODE - * - * @extends pm_node_t - */ -typedef struct pm_retry_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_retry_node_t; - -/** - * ReturnNode - * - * Represents the use of the `return` keyword. - * - * return 1 - * ^^^^^^^^ - * - * Type: ::PM_RETURN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_return_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ReturnNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * ReturnNode#arguments - */ - struct pm_arguments_node *arguments; -} pm_return_node_t; - -/** - * SelfNode - * - * Represents the `self` keyword. - * - * self - * ^^^^ - * - * Type: ::PM_SELF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_self_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_self_node_t; - -/** - * ShareableConstantNode - * - * This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified. - * - * # shareable_constant_value: literal - * C = { a: 1 } - * ^^^^^^^^^^^^ - * - * Type: ::PM_SHAREABLE_CONSTANT_NODE - - * Flags (#pm_shareable_constant_node_flags): - * * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL - * * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING - * * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY - * - * @extends pm_node_t - */ -typedef struct pm_shareable_constant_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * ShareableConstantNode#write - * - * The constant write that should be modified with the shareability state. - */ - struct pm_node *write; -} pm_shareable_constant_node_t; - -/** - * SingletonClassNode - * - * Represents a singleton class declaration involving the `class` keyword. - * - * class << self end - * ^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_SINGLETON_CLASS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_singleton_class_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * SingletonClassNode#locals - */ - pm_constant_id_list_t locals; - - /** - * SingletonClassNode#class_keyword_loc - */ - pm_location_t class_keyword_loc; - - /** - * SingletonClassNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * SingletonClassNode#expression - */ - struct pm_node *expression; - - /** - * SingletonClassNode#body - */ - struct pm_node *body; - - /** - * SingletonClassNode#end_keyword_loc - */ - pm_location_t end_keyword_loc; -} pm_singleton_class_node_t; - -/** - * SourceEncodingNode - * - * Represents the use of the `__ENCODING__` keyword. - * - * __ENCODING__ - * ^^^^^^^^^^^^ - * - * Type: ::PM_SOURCE_ENCODING_NODE - * - * @extends pm_node_t - */ -typedef struct pm_source_encoding_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_source_encoding_node_t; - -/** - * SourceFileNode - * - * Represents the use of the `__FILE__` keyword. - * - * __FILE__ - * ^^^^^^^^ - * - * Type: ::PM_SOURCE_FILE_NODE - - * Flags (#pm_string_flags): - * * ::PM_STRING_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_STRING_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_STRING_FLAGS_FROZEN - * * ::PM_STRING_FLAGS_MUTABLE - * - * @extends pm_node_t - */ -typedef struct pm_source_file_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * SourceFileNode#filepath - * - * Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs. - */ - pm_string_t filepath; -} pm_source_file_node_t; - -/** - * SourceLineNode - * - * Represents the use of the `__LINE__` keyword. - * - * __LINE__ - * ^^^^^^^^ - * - * Type: ::PM_SOURCE_LINE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_source_line_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_source_line_node_t; - -/** - * SplatNode - * - * Represents the use of the splat operator. - * - * [*a] - * ^^ - * - * Type: ::PM_SPLAT_NODE - * - * @extends pm_node_t - */ -typedef struct pm_splat_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * SplatNode#operator_loc - */ - pm_location_t operator_loc; - - /** - * SplatNode#expression - */ - struct pm_node *expression; -} pm_splat_node_t; - -/** - * StatementsNode - * - * Represents a set of statements contained within some scope. - * - * foo; bar; baz - * ^^^^^^^^^^^^^ - * - * Type: ::PM_STATEMENTS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_statements_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * StatementsNode#body - */ - struct pm_node_list body; -} pm_statements_node_t; - -/** - * StringNode - * - * Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string. - * - * "foo" - * ^^^^^ - * - * %w[foo] - * ^^^ - * - * "foo #{bar} baz" - * ^^^^ ^^^^ - * - * Type: ::PM_STRING_NODE - - * Flags (#pm_string_flags): - * * ::PM_STRING_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_STRING_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_STRING_FLAGS_FROZEN - * * ::PM_STRING_FLAGS_MUTABLE - * - * @extends pm_node_t - */ -typedef struct pm_string_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * StringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * StringNode#content_loc - */ - pm_location_t content_loc; - - /** - * StringNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * StringNode#unescaped - */ - pm_string_t unescaped; -} pm_string_node_t; - -/** - * SuperNode - * - * Represents the use of the `super` keyword with parentheses or arguments. - * - * super() - * ^^^^^^^ - * - * super foo, bar - * ^^^^^^^^^^^^^^ - * - * Type: ::PM_SUPER_NODE - * - * @extends pm_node_t - */ -typedef struct pm_super_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * SuperNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * SuperNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * SuperNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * SuperNode#rparen_loc - */ - pm_location_t rparen_loc; - - /** - * SuperNode#block - */ - struct pm_node *block; -} pm_super_node_t; - -/** - * SymbolNode - * - * Represents a symbol literal or a symbol contained within a `%i` list. - * - * :foo - * ^^^^ - * - * %i[foo] - * ^^^ - * - * Type: ::PM_SYMBOL_NODE - - * Flags (#pm_symbol_flags): - * * ::PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING - * * ::PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_symbol_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * SymbolNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * SymbolNode#value_loc - */ - pm_location_t value_loc; - - /** - * SymbolNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * SymbolNode#unescaped - */ - pm_string_t unescaped; -} pm_symbol_node_t; - -/** - * TrueNode - * - * Represents the use of the literal `true` keyword. - * - * true - * ^^^^ - * - * Type: ::PM_TRUE_NODE - * - * @extends pm_node_t - */ -typedef struct pm_true_node { - /** The embedded base node. */ - pm_node_t base; - -} pm_true_node_t; - -/** - * UndefNode - * - * Represents the use of the `undef` keyword. - * - * undef :foo, :bar, :baz - * ^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_UNDEF_NODE - * - * @extends pm_node_t - */ -typedef struct pm_undef_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * UndefNode#names - */ - struct pm_node_list names; - - /** - * UndefNode#keyword_loc - */ - pm_location_t keyword_loc; -} pm_undef_node_t; - -/** - * UnlessNode - * - * Represents the use of the `unless` keyword, either in the block form or the modifier form. - * - * bar unless foo - * ^^^^^^^^^^^^^^ - * - * unless foo then bar end - * ^^^^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_UNLESS_NODE - * - * @extends pm_node_t - */ -typedef struct pm_unless_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * UnlessNode#keyword_loc - * - * The location of the `unless` keyword. - * - * unless cond then bar end - * ^^^^^^ - * - * bar unless cond - * ^^^^^^ - */ - pm_location_t keyword_loc; - - /** - * UnlessNode#predicate - * - * The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - * - * unless cond then bar end - * ^^^^ - * - * bar unless cond - * ^^^^ - */ - struct pm_node *predicate; - - /** - * UnlessNode#then_keyword_loc - * - * The location of the `then` keyword, if present. - * - * unless cond then bar end - * ^^^^ - */ - pm_location_t then_keyword_loc; - - /** - * UnlessNode#statements - * - * The body of statements that will executed if the unless condition is - * falsey. Will be `nil` if no body is provided. - * - * unless cond then bar end - * ^^^ - */ - struct pm_statements_node *statements; - - /** - * UnlessNode#else_clause - * - * The else clause of the unless expression, if present. - * - * unless cond then bar else baz end - * ^^^^^^^^ - */ - struct pm_else_node *else_clause; - - /** - * UnlessNode#end_keyword_loc - * - * The location of the `end` keyword, if present. - * - * unless cond then bar end - * ^^^ - */ - pm_location_t end_keyword_loc; -} pm_unless_node_t; - -/** - * UntilNode - * - * Represents the use of the `until` keyword, either in the block form or the modifier form. - * - * bar until foo - * ^^^^^^^^^^^^^ - * - * until foo do bar end - * ^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_UNTIL_NODE - - * Flags (#pm_loop_flags): - * * ::PM_LOOP_FLAGS_BEGIN_MODIFIER - * - * @extends pm_node_t - */ -typedef struct pm_until_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * UntilNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * UntilNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * UntilNode#predicate - */ - struct pm_node *predicate; - - /** - * UntilNode#statements - */ - struct pm_statements_node *statements; -} pm_until_node_t; - -/** - * WhenNode - * - * Represents the use of the `when` keyword within a case statement. - * - * case true - * when true - * ^^^^^^^^^ - * end - * - * Type: ::PM_WHEN_NODE - * - * @extends pm_node_t - */ -typedef struct pm_when_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * WhenNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * WhenNode#conditions - */ - struct pm_node_list conditions; - - /** - * WhenNode#then_keyword_loc - */ - pm_location_t then_keyword_loc; - - /** - * WhenNode#statements - */ - struct pm_statements_node *statements; -} pm_when_node_t; - -/** - * WhileNode - * - * Represents the use of the `while` keyword, either in the block form or the modifier form. - * - * bar while foo - * ^^^^^^^^^^^^^ - * - * while foo do bar end - * ^^^^^^^^^^^^^^^^^^^^ - * - * Type: ::PM_WHILE_NODE - - * Flags (#pm_loop_flags): - * * ::PM_LOOP_FLAGS_BEGIN_MODIFIER - * - * @extends pm_node_t - */ -typedef struct pm_while_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * WhileNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * WhileNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * WhileNode#predicate - */ - struct pm_node *predicate; - - /** - * WhileNode#statements - */ - struct pm_statements_node *statements; -} pm_while_node_t; - -/** - * XStringNode - * - * Represents an xstring literal with no interpolation. - * - * `foo` - * ^^^^^ - * - * Type: ::PM_X_STRING_NODE - - * Flags (#pm_encoding_flags): - * * ::PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING - * * ::PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING - * - * @extends pm_node_t - */ -typedef struct pm_x_string_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * XStringNode#opening_loc - */ - pm_location_t opening_loc; - - /** - * XStringNode#content_loc - */ - pm_location_t content_loc; - - /** - * XStringNode#closing_loc - */ - pm_location_t closing_loc; - - /** - * XStringNode#unescaped - */ - pm_string_t unescaped; -} pm_x_string_node_t; - -/** - * YieldNode - * - * Represents the use of the `yield` keyword. - * - * yield 1 - * ^^^^^^^ - * - * Type: ::PM_YIELD_NODE - * - * @extends pm_node_t - */ -typedef struct pm_yield_node { - /** The embedded base node. */ - pm_node_t base; - - - /** - * YieldNode#keyword_loc - */ - pm_location_t keyword_loc; - - /** - * YieldNode#lparen_loc - */ - pm_location_t lparen_loc; - - /** - * YieldNode#arguments - */ - struct pm_arguments_node *arguments; - - /** - * YieldNode#rparen_loc - */ - pm_location_t rparen_loc; -} pm_yield_node_t; - -/** - * Flags for arguments nodes. - */ -typedef enum pm_arguments_node_flags { - /** if the arguments contain forwarding */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING = 4, - - /** if the arguments contain keywords */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS = 8, - - /** if the arguments contain a keyword splat */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT = 16, - - /** if the arguments contain a splat */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT = 32, - - /** if the arguments contain multiple splats */ - PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS = 64, -} pm_arguments_node_flags_t; - -/** - * Flags for array nodes. - */ -typedef enum pm_array_node_flags { - /** if array contains splat nodes */ - PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT = 4, -} pm_array_node_flags_t; - -/** - * Flags for call nodes. - */ -typedef enum pm_call_node_flags { - /** &. operator */ - PM_CALL_NODE_FLAGS_SAFE_NAVIGATION = 4, - - /** a call that could have been a local variable */ - PM_CALL_NODE_FLAGS_VARIABLE_CALL = 8, - - /** a call that is an attribute write, so the value being written should be returned */ - PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE = 16, - - /** a call that ignores method visibility */ - PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY = 32, -} pm_call_node_flags_t; - -/** - * Flags for nodes that have unescaped content. - */ -typedef enum pm_encoding_flags { - /** internal bytes forced the encoding to UTF-8 */ - PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING = 4, - - /** internal bytes forced the encoding to binary */ - PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING = 8, -} pm_encoding_flags_t; - -/** - * Flags for integer nodes that correspond to the base of the integer. - */ -typedef enum pm_integer_base_flags { - /** 0b prefix */ - PM_INTEGER_BASE_FLAGS_BINARY = 4, - - /** 0d or no prefix */ - PM_INTEGER_BASE_FLAGS_DECIMAL = 8, - - /** 0o or 0 prefix */ - PM_INTEGER_BASE_FLAGS_OCTAL = 16, - - /** 0x prefix */ - PM_INTEGER_BASE_FLAGS_HEXADECIMAL = 32, -} pm_integer_base_flags_t; - -/** - * Flags for interpolated string nodes that indicated mutability if they are also marked as literals. - */ -typedef enum pm_interpolated_string_node_flags { - /** frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` */ - PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN = 4, - - /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` */ - PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE = 8, -} pm_interpolated_string_node_flags_t; - -/** - * Flags for keyword hash nodes. - */ -typedef enum pm_keyword_hash_node_flags { - /** a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments */ - PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS = 4, -} pm_keyword_hash_node_flags_t; - -/** - * Flags for while and until loop nodes. - */ -typedef enum pm_loop_flags { - /** a loop after a begin statement, so the body is executed first before the condition */ - PM_LOOP_FLAGS_BEGIN_MODIFIER = 4, -} pm_loop_flags_t; - -/** - * Flags for parameter nodes. - */ -typedef enum pm_parameter_flags { - /** a parameter name that has been repeated in the method signature */ - PM_PARAMETER_FLAGS_REPEATED_PARAMETER = 4, -} pm_parameter_flags_t; - -/** - * Flags for range and flip-flop nodes. - */ -typedef enum pm_range_flags { - /** ... operator */ - PM_RANGE_FLAGS_EXCLUDE_END = 4, -} pm_range_flags_t; - -/** - * Flags for regular expression and match last line nodes. - */ -typedef enum pm_regular_expression_flags { - /** i - ignores the case of characters when matching */ - PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE = 4, - - /** x - ignores whitespace and allows comments in regular expressions */ - PM_REGULAR_EXPRESSION_FLAGS_EXTENDED = 8, - - /** m - allows $ to match the end of lines within strings */ - PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE = 16, - - /** o - only interpolates values into the regular expression once */ - PM_REGULAR_EXPRESSION_FLAGS_ONCE = 32, - - /** e - forces the EUC-JP encoding */ - PM_REGULAR_EXPRESSION_FLAGS_EUC_JP = 64, - - /** n - forces the ASCII-8BIT encoding */ - PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT = 128, - - /** s - forces the Windows-31J encoding */ - PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J = 256, - - /** u - forces the UTF-8 encoding */ - PM_REGULAR_EXPRESSION_FLAGS_UTF_8 = 512, - - /** internal bytes forced the encoding to UTF-8 */ - PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING = 1024, - - /** internal bytes forced the encoding to binary */ - PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING = 2048, - - /** internal bytes forced the encoding to US-ASCII */ - PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING = 4096, -} pm_regular_expression_flags_t; - -/** - * Flags for shareable constant nodes. - */ -typedef enum pm_shareable_constant_node_flags { - /** constant writes that should be modified with shareable constant value literal */ - PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL = 4, - - /** constant writes that should be modified with shareable constant value experimental everything */ - PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING = 8, - - /** constant writes that should be modified with shareable constant value experimental copy */ - PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY = 16, -} pm_shareable_constant_node_flags_t; - -/** - * Flags for string nodes. - */ -typedef enum pm_string_flags { - /** internal bytes forced the encoding to UTF-8 */ - PM_STRING_FLAGS_FORCED_UTF8_ENCODING = 4, - - /** internal bytes forced the encoding to binary */ - PM_STRING_FLAGS_FORCED_BINARY_ENCODING = 8, - - /** frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` */ - PM_STRING_FLAGS_FROZEN = 16, - - /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` */ - PM_STRING_FLAGS_MUTABLE = 32, -} pm_string_flags_t; - -/** - * Flags for symbol nodes. - */ -typedef enum pm_symbol_flags { - /** internal bytes forced the encoding to UTF-8 */ - PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING = 4, - - /** internal bytes forced the encoding to binary */ - PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING = 8, - - /** internal bytes forced the encoding to US-ASCII */ - PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING = 16, -} pm_symbol_flags_t; - -/** - * When we're serializing to Java, we want to skip serializing the location - * fields as they won't be used by JRuby or TruffleRuby. This boolean allows us - * to specify that through the environment. It will never be true except for in - * those build systems. - */ -#define PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS 0 - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h deleted file mode 100644 index e78c7dd..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @file defines.h - * - * Macro definitions used throughout the prism library. - * - * This file should be included first by any *.h or *.c in prism for consistency - * and to ensure that the macros are defined before they are used. - */ -#ifndef PRISM_DEFINES_H -#define PRISM_DEFINES_H - -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * We want to be able to use the PRI* macros for printing out integers, but on - * some platforms they aren't included unless this is already defined. - */ -#define __STDC_FORMAT_MACROS -#include - -/** - * When we are parsing using recursive descent, we want to protect against - * malicious payloads that could attempt to crash our parser. We do this by - * specifying a maximum depth to which we are allowed to recurse. - */ -#ifndef PRISM_DEPTH_MAXIMUM - #define PRISM_DEPTH_MAXIMUM 1000 -#endif - -/** - * By default, we compile with -fvisibility=hidden. When this is enabled, we - * need to mark certain functions as being publically-visible. This macro does - * that in a compiler-agnostic way. - */ -#ifndef PRISM_EXPORTED_FUNCTION -# ifdef PRISM_EXPORT_SYMBOLS -# ifdef _WIN32 -# define PRISM_EXPORTED_FUNCTION __declspec(dllexport) extern -# else -# define PRISM_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern -# endif -# else -# define PRISM_EXPORTED_FUNCTION -# endif -#endif - -/** - * Certain compilers support specifying that a function accepts variadic - * parameters that look like printf format strings to provide a better developer - * experience when someone is using the function. This macro does that in a - * compiler-agnostic way. - */ -#if defined(__GNUC__) -# if defined(__MINGW_PRINTF_FORMAT) -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index))) -# else -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index))) -# endif -#elif defined(__clang__) -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index))) -#else -# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) -#endif - -/** - * GCC will warn if you specify a function or parameter that is unused at - * runtime. This macro allows you to mark a function or parameter as unused in a - * compiler-agnostic way. - */ -#if defined(__GNUC__) -# define PRISM_ATTRIBUTE_UNUSED __attribute__((unused)) -#else -# define PRISM_ATTRIBUTE_UNUSED -#endif - -/** - * Old Visual Studio versions do not support the inline keyword, so we need to - * define it to be __inline. - */ -#if defined(_MSC_VER) && !defined(inline) -# define inline __inline -#endif - -/** - * Old Visual Studio versions before 2015 do not implement sprintf, but instead - * implement _snprintf. We standard that here. - */ -#if !defined(snprintf) && defined(_MSC_VER) && (_MSC_VER < 1900) -# define snprintf _snprintf -#endif - -/** - * A simple utility macro to concatenate two tokens together, necessary when one - * of the tokens is itself a macro. - */ -#define PM_CONCATENATE(left, right) left ## right - -/** - * We want to be able to use static assertions, but they weren't standardized - * until C11. As such, we polyfill it here by making a hacky typedef that will - * fail to compile due to a negative array size if the condition is false. - */ -#if defined(_Static_assert) -# define PM_STATIC_ASSERT(line, condition, message) _Static_assert(condition, message) -#else -# define PM_STATIC_ASSERT(line, condition, message) typedef char PM_CONCATENATE(static_assert_, line)[(condition) ? 1 : -1] -#endif - -/** - * In general, libc for embedded systems does not support memory-mapped files. - * If the target platform is POSIX or Windows, we can map a file in memory and - * read it in a more efficient manner. - */ -#ifdef _WIN32 -# define PRISM_HAS_MMAP -#else -# include -# ifdef _POSIX_MAPPED_FILES -# define PRISM_HAS_MMAP -# endif -#endif - -/** - * If PRISM_HAS_NO_FILESYSTEM is defined, then we want to exclude all filesystem - * related code from the library. All filesystem related code should be guarded - * by PRISM_HAS_FILESYSTEM. - */ -#ifndef PRISM_HAS_NO_FILESYSTEM -# define PRISM_HAS_FILESYSTEM -#endif - -/** - * isinf on Windows is defined as accepting a float, but on POSIX systems it - * accepts a float, a double, or a long double. We want to mirror this behavior - * on windows. - */ -#ifdef _WIN32 -# include -# undef isinf -# define isinf(x) (sizeof(x) == sizeof(float) ? !_finitef(x) : !_finite(x)) -#endif - -/** - * If you build prism with a custom allocator, configure it with - * "-D PRISM_XALLOCATOR" to use your own allocator that defines xmalloc, - * xrealloc, xcalloc, and xfree. - * - * For example, your `prism_xallocator.h` file could look like this: - * - * ``` - * #ifndef PRISM_XALLOCATOR_H - * #define PRISM_XALLOCATOR_H - * #define xmalloc my_malloc - * #define xrealloc my_realloc - * #define xcalloc my_calloc - * #define xfree my_free - * #endif - * ``` - */ -#ifdef PRISM_XALLOCATOR - #include "prism_xallocator.h" -#else - #ifndef xmalloc - /** - * The malloc function that should be used. This can be overridden with - * the PRISM_XALLOCATOR define. - */ - #define xmalloc malloc - #endif - - #ifndef xrealloc - /** - * The realloc function that should be used. This can be overridden with - * the PRISM_XALLOCATOR define. - */ - #define xrealloc realloc - #endif - - #ifndef xcalloc - /** - * The calloc function that should be used. This can be overridden with - * the PRISM_XALLOCATOR define. - */ - #define xcalloc calloc - #endif - - #ifndef xfree - /** - * The free function that should be used. This can be overridden with the - * PRISM_XALLOCATOR define. - */ - #define xfree free - #endif -#endif - -/** - * If PRISM_BUILD_MINIMAL is defined, then we're going to define every possible - * switch that will turn off certain features of prism. - */ -#ifdef PRISM_BUILD_MINIMAL - /** Exclude the serialization API. */ - #define PRISM_EXCLUDE_SERIALIZATION - - /** Exclude the JSON serialization API. */ - #define PRISM_EXCLUDE_JSON - - /** Exclude the Array#pack parser API. */ - #define PRISM_EXCLUDE_PACK - - /** Exclude the prettyprint API. */ - #define PRISM_EXCLUDE_PRETTYPRINT - - /** Exclude the full set of encodings, using the minimal only. */ - #define PRISM_ENCODING_EXCLUDE_FULL -#endif - -/** - * Support PRISM_LIKELY and PRISM_UNLIKELY to help the compiler optimize its - * branch predication. - */ -#if defined(__GNUC__) || defined(__clang__) - /** The compiler should predicate that this branch will be taken. */ - #define PRISM_LIKELY(x) __builtin_expect(!!(x), 1) - - /** The compiler should predicate that this branch will not be taken. */ - #define PRISM_UNLIKELY(x) __builtin_expect(!!(x), 0) -#else - /** Void because this platform does not support branch prediction hints. */ - #define PRISM_LIKELY(x) (x) - - /** Void because this platform does not support branch prediction hints. */ - #define PRISM_UNLIKELY(x) (x) -#endif - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h deleted file mode 100644 index 5e11412..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h +++ /dev/null @@ -1,450 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* This file is generated by the templates/template.rb script and should not */ -/* be modified manually. See */ -/* templates/include/prism/diagnostic.h.erb */ -/* if you are looking to modify the */ -/* template */ -/*----------------------------------------------------------------------------*/ - -/** - * @file diagnostic.h - * - * A list of diagnostics generated during parsing. - */ -#ifndef PRISM_DIAGNOSTIC_H -#define PRISM_DIAGNOSTIC_H - -#include "prism/ast.h" -#include "prism/defines.h" -#include "prism/util/pm_list.h" - -#include -#include -#include - -/** - * The diagnostic IDs of all of the diagnostics, used to communicate the types - * of errors between the parser and the user. - */ -typedef enum { - // These are the error diagnostics. - PM_ERR_ALIAS_ARGUMENT, - PM_ERR_ALIAS_ARGUMENT_NUMBERED_REFERENCE, - PM_ERR_AMPAMPEQ_MULTI_ASSIGN, - PM_ERR_ARGUMENT_AFTER_BLOCK, - PM_ERR_ARGUMENT_AFTER_FORWARDING_ELLIPSES, - PM_ERR_ARGUMENT_BARE_HASH, - PM_ERR_ARGUMENT_BLOCK_FORWARDING, - PM_ERR_ARGUMENT_BLOCK_MULTI, - PM_ERR_ARGUMENT_CONFLICT_AMPERSAND, - PM_ERR_ARGUMENT_CONFLICT_STAR, - PM_ERR_ARGUMENT_CONFLICT_STAR_STAR, - PM_ERR_ARGUMENT_FORMAL_CLASS, - PM_ERR_ARGUMENT_FORMAL_CONSTANT, - PM_ERR_ARGUMENT_FORMAL_GLOBAL, - PM_ERR_ARGUMENT_FORMAL_IVAR, - PM_ERR_ARGUMENT_FORWARDING_UNBOUND, - PM_ERR_ARGUMENT_NO_FORWARDING_AMPERSAND, - PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES, - PM_ERR_ARGUMENT_NO_FORWARDING_STAR, - PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR, - PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT, - PM_ERR_ARGUMENT_SPLAT_AFTER_SPLAT, - PM_ERR_ARGUMENT_TERM_PAREN, - PM_ERR_ARGUMENT_UNEXPECTED_BLOCK, - PM_ERR_ARRAY_ELEMENT, - PM_ERR_ARRAY_EXPRESSION, - PM_ERR_ARRAY_EXPRESSION_AFTER_STAR, - PM_ERR_ARRAY_SEPARATOR, - PM_ERR_ARRAY_TERM, - PM_ERR_BEGIN_LONELY_ELSE, - PM_ERR_BEGIN_TERM, - PM_ERR_BEGIN_UPCASE_BRACE, - PM_ERR_BEGIN_UPCASE_TERM, - PM_ERR_BEGIN_UPCASE_TOPLEVEL, - PM_ERR_BLOCK_PARAM_LOCAL_VARIABLE, - PM_ERR_BLOCK_PARAM_PIPE_TERM, - PM_ERR_BLOCK_TERM_BRACE, - PM_ERR_BLOCK_TERM_END, - PM_ERR_CANNOT_PARSE_EXPRESSION, - PM_ERR_CANNOT_PARSE_STRING_PART, - PM_ERR_CASE_EXPRESSION_AFTER_CASE, - PM_ERR_CASE_EXPRESSION_AFTER_WHEN, - PM_ERR_CASE_MATCH_MISSING_PREDICATE, - PM_ERR_CASE_MISSING_CONDITIONS, - PM_ERR_CASE_TERM, - PM_ERR_CLASS_IN_METHOD, - PM_ERR_CLASS_NAME, - PM_ERR_CLASS_SUPERCLASS, - PM_ERR_CLASS_TERM, - PM_ERR_CLASS_UNEXPECTED_END, - PM_ERR_CLASS_VARIABLE_BARE, - PM_ERR_CONDITIONAL_ELSIF_PREDICATE, - PM_ERR_CONDITIONAL_IF_PREDICATE, - PM_ERR_CONDITIONAL_PREDICATE_TERM, - PM_ERR_CONDITIONAL_TERM, - PM_ERR_CONDITIONAL_TERM_ELSE, - PM_ERR_CONDITIONAL_UNLESS_PREDICATE, - PM_ERR_CONDITIONAL_UNTIL_PREDICATE, - PM_ERR_CONDITIONAL_WHILE_PREDICATE, - PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT, - PM_ERR_DEF_ENDLESS, - PM_ERR_DEF_ENDLESS_SETTER, - PM_ERR_DEF_NAME, - PM_ERR_DEF_PARAMS_TERM, - PM_ERR_DEF_PARAMS_TERM_PAREN, - PM_ERR_DEF_RECEIVER, - PM_ERR_DEF_RECEIVER_TERM, - PM_ERR_DEF_TERM, - PM_ERR_DEFINED_EXPRESSION, - PM_ERR_EMBDOC_TERM, - PM_ERR_EMBEXPR_END, - PM_ERR_EMBVAR_INVALID, - PM_ERR_END_UPCASE_BRACE, - PM_ERR_END_UPCASE_TERM, - PM_ERR_ESCAPE_INVALID_CONTROL, - PM_ERR_ESCAPE_INVALID_CONTROL_REPEAT, - PM_ERR_ESCAPE_INVALID_HEXADECIMAL, - PM_ERR_ESCAPE_INVALID_META, - PM_ERR_ESCAPE_INVALID_META_REPEAT, - PM_ERR_ESCAPE_INVALID_UNICODE, - PM_ERR_ESCAPE_INVALID_UNICODE_CM_FLAGS, - PM_ERR_ESCAPE_INVALID_UNICODE_LIST, - PM_ERR_ESCAPE_INVALID_UNICODE_LITERAL, - PM_ERR_ESCAPE_INVALID_UNICODE_LONG, - PM_ERR_ESCAPE_INVALID_UNICODE_SHORT, - PM_ERR_ESCAPE_INVALID_UNICODE_TERM, - PM_ERR_EXPECT_ARGUMENT, - PM_ERR_EXPECT_EOL_AFTER_STATEMENT, - PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, - PM_ERR_EXPECT_EXPRESSION_AFTER_COMMA, - PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL, - PM_ERR_EXPECT_EXPRESSION_AFTER_LESS_LESS, - PM_ERR_EXPECT_EXPRESSION_AFTER_LPAREN, - PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, - PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, - PM_ERR_EXPECT_EXPRESSION_AFTER_QUESTION, - PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT, - PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT_HASH, - PM_ERR_EXPECT_EXPRESSION_AFTER_STAR, - PM_ERR_EXPECT_FOR_DELIMITER, - PM_ERR_EXPECT_IDENT_REQ_PARAMETER, - PM_ERR_EXPECT_IN_DELIMITER, - PM_ERR_EXPECT_LPAREN_REQ_PARAMETER, - PM_ERR_EXPECT_MESSAGE, - PM_ERR_EXPECT_RBRACKET, - PM_ERR_EXPECT_RPAREN, - PM_ERR_EXPECT_RPAREN_AFTER_MULTI, - PM_ERR_EXPECT_RPAREN_REQ_PARAMETER, - PM_ERR_EXPECT_SINGLETON_CLASS_DELIMITER, - PM_ERR_EXPECT_STRING_CONTENT, - PM_ERR_EXPECT_WHEN_DELIMITER, - PM_ERR_EXPRESSION_BARE_HASH, - PM_ERR_EXPRESSION_NOT_WRITABLE, - PM_ERR_EXPRESSION_NOT_WRITABLE_ENCODING, - PM_ERR_EXPRESSION_NOT_WRITABLE_FALSE, - PM_ERR_EXPRESSION_NOT_WRITABLE_FILE, - PM_ERR_EXPRESSION_NOT_WRITABLE_LINE, - PM_ERR_EXPRESSION_NOT_WRITABLE_NIL, - PM_ERR_EXPRESSION_NOT_WRITABLE_NUMBERED, - PM_ERR_EXPRESSION_NOT_WRITABLE_SELF, - PM_ERR_EXPRESSION_NOT_WRITABLE_TRUE, - PM_ERR_FLOAT_PARSE, - PM_ERR_FOR_COLLECTION, - PM_ERR_FOR_IN, - PM_ERR_FOR_INDEX, - PM_ERR_FOR_TERM, - PM_ERR_GLOBAL_VARIABLE_BARE, - PM_ERR_HASH_EXPRESSION_AFTER_LABEL, - PM_ERR_HASH_KEY, - PM_ERR_HASH_ROCKET, - PM_ERR_HASH_TERM, - PM_ERR_HASH_VALUE, - PM_ERR_HEREDOC_IDENTIFIER, - PM_ERR_HEREDOC_TERM, - PM_ERR_INCOMPLETE_QUESTION_MARK, - PM_ERR_INCOMPLETE_VARIABLE_CLASS, - PM_ERR_INCOMPLETE_VARIABLE_CLASS_3_3, - PM_ERR_INCOMPLETE_VARIABLE_INSTANCE, - PM_ERR_INCOMPLETE_VARIABLE_INSTANCE_3_3, - PM_ERR_INSTANCE_VARIABLE_BARE, - PM_ERR_INVALID_BLOCK_EXIT, - PM_ERR_INVALID_CHARACTER, - PM_ERR_INVALID_ENCODING_MAGIC_COMMENT, - PM_ERR_INVALID_ESCAPE_CHARACTER, - PM_ERR_INVALID_FLOAT_EXPONENT, - PM_ERR_INVALID_LOCAL_VARIABLE_READ, - PM_ERR_INVALID_LOCAL_VARIABLE_WRITE, - PM_ERR_INVALID_MULTIBYTE_CHAR, - PM_ERR_INVALID_MULTIBYTE_CHARACTER, - PM_ERR_INVALID_MULTIBYTE_ESCAPE, - PM_ERR_INVALID_NUMBER_BINARY, - PM_ERR_INVALID_NUMBER_DECIMAL, - PM_ERR_INVALID_NUMBER_FRACTION, - PM_ERR_INVALID_NUMBER_HEXADECIMAL, - PM_ERR_INVALID_NUMBER_OCTAL, - PM_ERR_INVALID_NUMBER_UNDERSCORE_INNER, - PM_ERR_INVALID_NUMBER_UNDERSCORE_TRAILING, - PM_ERR_INVALID_PERCENT, - PM_ERR_INVALID_PERCENT_EOF, - PM_ERR_INVALID_PRINTABLE_CHARACTER, - PM_ERR_INVALID_RETRY_AFTER_ELSE, - PM_ERR_INVALID_RETRY_AFTER_ENSURE, - PM_ERR_INVALID_RETRY_WITHOUT_RESCUE, - PM_ERR_INVALID_SYMBOL, - PM_ERR_INVALID_VARIABLE_GLOBAL, - PM_ERR_INVALID_VARIABLE_GLOBAL_3_3, - PM_ERR_INVALID_YIELD, - PM_ERR_IT_NOT_ALLOWED_NUMBERED, - PM_ERR_IT_NOT_ALLOWED_ORDINARY, - PM_ERR_LAMBDA_OPEN, - PM_ERR_LAMBDA_TERM_BRACE, - PM_ERR_LAMBDA_TERM_END, - PM_ERR_LIST_I_LOWER_ELEMENT, - PM_ERR_LIST_I_LOWER_TERM, - PM_ERR_LIST_I_UPPER_ELEMENT, - PM_ERR_LIST_I_UPPER_TERM, - PM_ERR_LIST_W_LOWER_ELEMENT, - PM_ERR_LIST_W_LOWER_TERM, - PM_ERR_LIST_W_UPPER_ELEMENT, - PM_ERR_LIST_W_UPPER_TERM, - PM_ERR_MALLOC_FAILED, - PM_ERR_MIXED_ENCODING, - PM_ERR_MODULE_IN_METHOD, - PM_ERR_MODULE_NAME, - PM_ERR_MODULE_TERM, - PM_ERR_MULTI_ASSIGN_MULTI_SPLATS, - PM_ERR_MULTI_ASSIGN_UNEXPECTED_REST, - PM_ERR_NESTING_TOO_DEEP, - PM_ERR_NO_LOCAL_VARIABLE, - PM_ERR_NON_ASSOCIATIVE_OPERATOR, - PM_ERR_NOT_EXPRESSION, - PM_ERR_NUMBER_LITERAL_UNDERSCORE, - PM_ERR_NUMBERED_PARAMETER_INNER_BLOCK, - PM_ERR_NUMBERED_PARAMETER_IT, - PM_ERR_NUMBERED_PARAMETER_ORDINARY, - PM_ERR_NUMBERED_PARAMETER_OUTER_BLOCK, - PM_ERR_OPERATOR_MULTI_ASSIGN, - PM_ERR_OPERATOR_WRITE_ARGUMENTS, - PM_ERR_OPERATOR_WRITE_BLOCK, - PM_ERR_PARAMETER_ASSOC_SPLAT_MULTI, - PM_ERR_PARAMETER_BLOCK_MULTI, - PM_ERR_PARAMETER_CIRCULAR, - PM_ERR_PARAMETER_FORWARDING_AFTER_REST, - PM_ERR_PARAMETER_METHOD_NAME, - PM_ERR_PARAMETER_NAME_DUPLICATED, - PM_ERR_PARAMETER_NO_DEFAULT, - PM_ERR_PARAMETER_NO_DEFAULT_KW, - PM_ERR_PARAMETER_NUMBERED_RESERVED, - PM_ERR_PARAMETER_ORDER, - PM_ERR_PARAMETER_SPLAT_MULTI, - PM_ERR_PARAMETER_STAR, - PM_ERR_PARAMETER_UNEXPECTED_FWD, - PM_ERR_PARAMETER_UNEXPECTED_NO_KW, - PM_ERR_PARAMETER_WILD_LOOSE_COMMA, - PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS, - PM_ERR_PATTERN_CAPTURE_DUPLICATE, - PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET, - PM_ERR_PATTERN_EXPRESSION_AFTER_COMMA, - PM_ERR_PATTERN_EXPRESSION_AFTER_HROCKET, - PM_ERR_PATTERN_EXPRESSION_AFTER_IN, - PM_ERR_PATTERN_EXPRESSION_AFTER_KEY, - PM_ERR_PATTERN_EXPRESSION_AFTER_PAREN, - PM_ERR_PATTERN_EXPRESSION_AFTER_PIN, - PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, - PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE, - PM_ERR_PATTERN_EXPRESSION_AFTER_REST, - PM_ERR_PATTERN_FIND_MISSING_INNER, - PM_ERR_PATTERN_HASH_IMPLICIT, - PM_ERR_PATTERN_HASH_KEY, - PM_ERR_PATTERN_HASH_KEY_DUPLICATE, - PM_ERR_PATTERN_HASH_KEY_INTERPOLATED, - PM_ERR_PATTERN_HASH_KEY_LABEL, - PM_ERR_PATTERN_HASH_KEY_LOCALS, - PM_ERR_PATTERN_IDENT_AFTER_HROCKET, - PM_ERR_PATTERN_LABEL_AFTER_COMMA, - PM_ERR_PATTERN_REST, - PM_ERR_PATTERN_TERM_BRACE, - PM_ERR_PATTERN_TERM_BRACKET, - PM_ERR_PATTERN_TERM_PAREN, - PM_ERR_PIPEPIPEEQ_MULTI_ASSIGN, - PM_ERR_REGEXP_ENCODING_OPTION_MISMATCH, - PM_ERR_REGEXP_INCOMPAT_CHAR_ENCODING, - PM_ERR_REGEXP_INVALID_UNICODE_RANGE, - PM_ERR_REGEXP_NON_ESCAPED_MBC, - PM_ERR_REGEXP_PARSE_ERROR, - PM_ERR_REGEXP_TERM, - PM_ERR_REGEXP_UNKNOWN_OPTIONS, - PM_ERR_REGEXP_UTF8_CHAR_NON_UTF8_REGEXP, - PM_ERR_RESCUE_EXPRESSION, - PM_ERR_RESCUE_MODIFIER_VALUE, - PM_ERR_RESCUE_TERM, - PM_ERR_RESCUE_VARIABLE, - PM_ERR_RETURN_INVALID, - PM_ERR_SCRIPT_NOT_FOUND, - PM_ERR_SINGLETON_FOR_LITERALS, - PM_ERR_STATEMENT_ALIAS, - PM_ERR_STATEMENT_POSTEXE_END, - PM_ERR_STATEMENT_PREEXE_BEGIN, - PM_ERR_STATEMENT_UNDEF, - PM_ERR_STRING_CONCATENATION, - PM_ERR_STRING_INTERPOLATED_TERM, - PM_ERR_STRING_LITERAL_EOF, - PM_ERR_STRING_LITERAL_TERM, - PM_ERR_SYMBOL_INVALID, - PM_ERR_SYMBOL_TERM_DYNAMIC, - PM_ERR_SYMBOL_TERM_INTERPOLATED, - PM_ERR_TERNARY_COLON, - PM_ERR_TERNARY_EXPRESSION_FALSE, - PM_ERR_TERNARY_EXPRESSION_TRUE, - PM_ERR_UNARY_DISALLOWED, - PM_ERR_UNARY_RECEIVER, - PM_ERR_UNDEF_ARGUMENT, - PM_ERR_UNEXPECTED_BLOCK_ARGUMENT, - PM_ERR_UNEXPECTED_INDEX_BLOCK, - PM_ERR_UNEXPECTED_INDEX_KEYWORDS, - PM_ERR_UNEXPECTED_LABEL, - PM_ERR_UNEXPECTED_MULTI_WRITE, - PM_ERR_UNEXPECTED_RANGE_OPERATOR, - PM_ERR_UNEXPECTED_SAFE_NAVIGATION, - PM_ERR_UNEXPECTED_TOKEN_CLOSE_CONTEXT, - PM_ERR_UNEXPECTED_TOKEN_IGNORE, - PM_ERR_UNTIL_TERM, - PM_ERR_VOID_EXPRESSION, - PM_ERR_WHILE_TERM, - PM_ERR_WRITE_TARGET_IN_METHOD, - PM_ERR_WRITE_TARGET_READONLY, - PM_ERR_WRITE_TARGET_UNEXPECTED, - PM_ERR_XSTRING_TERM, - - // These are the warning diagnostics. - PM_WARN_AMBIGUOUS_BINARY_OPERATOR, - PM_WARN_AMBIGUOUS_FIRST_ARGUMENT_MINUS, - PM_WARN_AMBIGUOUS_FIRST_ARGUMENT_PLUS, - PM_WARN_AMBIGUOUS_PREFIX_AMPERSAND, - PM_WARN_AMBIGUOUS_PREFIX_STAR, - PM_WARN_AMBIGUOUS_PREFIX_STAR_STAR, - PM_WARN_AMBIGUOUS_SLASH, - PM_WARN_COMPARISON_AFTER_COMPARISON, - PM_WARN_DOT_DOT_DOT_EOL, - PM_WARN_EQUAL_IN_CONDITIONAL, - PM_WARN_EQUAL_IN_CONDITIONAL_3_3, - PM_WARN_END_IN_METHOD, - PM_WARN_DUPLICATED_HASH_KEY, - PM_WARN_DUPLICATED_WHEN_CLAUSE, - PM_WARN_FLOAT_OUT_OF_RANGE, - PM_WARN_IGNORED_FROZEN_STRING_LITERAL, - PM_WARN_INDENTATION_MISMATCH, - PM_WARN_INTEGER_IN_FLIP_FLOP, - PM_WARN_INVALID_CHARACTER, - PM_WARN_INVALID_MAGIC_COMMENT_VALUE, - PM_WARN_INVALID_NUMBERED_REFERENCE, - PM_WARN_KEYWORD_EOL, - PM_WARN_LITERAL_IN_CONDITION_DEFAULT, - PM_WARN_LITERAL_IN_CONDITION_VERBOSE, - PM_WARN_SHAREABLE_CONSTANT_VALUE_LINE, - PM_WARN_SHEBANG_CARRIAGE_RETURN, - PM_WARN_UNEXPECTED_CARRIAGE_RETURN, - PM_WARN_UNREACHABLE_STATEMENT, - PM_WARN_UNUSED_LOCAL_VARIABLE, - PM_WARN_VOID_STATEMENT, -} pm_diagnostic_id_t; - -/** - * This struct represents a diagnostic generated during parsing. - * - * @extends pm_list_node_t - */ -typedef struct { - /** The embedded base node. */ - pm_list_node_t node; - - /** The location of the diagnostic in the source. */ - pm_location_t location; - - /** The ID of the diagnostic. */ - pm_diagnostic_id_t diag_id; - - /** The message associated with the diagnostic. */ - const char *message; - - /** - * Whether or not the memory related to the message of this diagnostic is - * owned by this diagnostic. If it is, it needs to be freed when the - * diagnostic is freed. - */ - bool owned; - - /** - * The level of the diagnostic, see `pm_error_level_t` and - * `pm_warning_level_t` for possible values. - */ - uint8_t level; -} pm_diagnostic_t; - -/** - * The levels of errors generated during parsing. - */ -typedef enum { - /** For errors that should raise a syntax error. */ - PM_ERROR_LEVEL_SYNTAX = 0, - - /** For errors that should raise an argument error. */ - PM_ERROR_LEVEL_ARGUMENT = 1, - - /** For errors that should raise a load error. */ - PM_ERROR_LEVEL_LOAD = 2 -} pm_error_level_t; - -/** - * The levels of warnings generated during parsing. - */ -typedef enum { - /** For warnings which should be emitted if $VERBOSE != nil. */ - PM_WARNING_LEVEL_DEFAULT = 0, - - /** For warnings which should be emitted if $VERBOSE == true. */ - PM_WARNING_LEVEL_VERBOSE = 1 -} pm_warning_level_t; - -/** - * Get the human-readable name of the given diagnostic ID. - * - * @param diag_id The diagnostic ID. - * @return The human-readable name of the diagnostic ID. - */ -const char * pm_diagnostic_id_human(pm_diagnostic_id_t diag_id); - -/** - * Append a diagnostic to the given list of diagnostics that is using shared - * memory for its message. - * - * @param list The list to append to. - * @param start The start of the diagnostic. - * @param end The end of the diagnostic. - * @param diag_id The diagnostic ID. - * @return Whether the diagnostic was successfully appended. - */ -bool pm_diagnostic_list_append(pm_list_t *list, const uint8_t *start, const uint8_t *end, pm_diagnostic_id_t diag_id); - -/** - * Append a diagnostic to the given list of diagnostics that is using a format - * string for its message. - * - * @param list The list to append to. - * @param start The start of the diagnostic. - * @param end The end of the diagnostic. - * @param diag_id The diagnostic ID. - * @param ... The arguments to the format string for the message. - * @return Whether the diagnostic was successfully appended. - */ -bool pm_diagnostic_list_append_format(pm_list_t *list, const uint8_t *start, const uint8_t *end, pm_diagnostic_id_t diag_id, ...); - -/** - * Deallocate the internal state of the given diagnostic list. - * - * @param list The list to deallocate. - */ -void pm_diagnostic_list_free(pm_list_t *list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h deleted file mode 100644 index 5f77248..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h +++ /dev/null @@ -1,283 +0,0 @@ -/** - * @file encoding.h - * - * The encoding interface and implementations used by the parser. - */ -#ifndef PRISM_ENCODING_H -#define PRISM_ENCODING_H - -#include "prism/defines.h" -#include "prism/util/pm_strncasecmp.h" - -#include -#include -#include -#include - -/** - * This struct defines the functions necessary to implement the encoding - * interface so we can determine how many bytes the subsequent character takes. - * Each callback should return the number of bytes, or 0 if the next bytes are - * invalid for the encoding and type. - */ -typedef struct { - /** - * Return the number of bytes that the next character takes if it is valid - * in the encoding. Does not read more than n bytes. It is assumed that n is - * at least 1. - */ - size_t (*char_width)(const uint8_t *b, ptrdiff_t n); - - /** - * Return the number of bytes that the next character takes if it is valid - * in the encoding and is alphabetical. Does not read more than n bytes. It - * is assumed that n is at least 1. - */ - size_t (*alpha_char)(const uint8_t *b, ptrdiff_t n); - - /** - * Return the number of bytes that the next character takes if it is valid - * in the encoding and is alphanumeric. Does not read more than n bytes. It - * is assumed that n is at least 1. - */ - size_t (*alnum_char)(const uint8_t *b, ptrdiff_t n); - - /** - * Return true if the next character is valid in the encoding and is an - * uppercase character. Does not read more than n bytes. It is assumed that - * n is at least 1. - */ - bool (*isupper_char)(const uint8_t *b, ptrdiff_t n); - - /** - * The name of the encoding. This should correspond to a value that can be - * passed to Encoding.find in Ruby. - */ - const char *name; - - /** - * Return true if the encoding is a multibyte encoding. - */ - bool multibyte; -} pm_encoding_t; - -/** - * All of the lookup tables use the first bit of each embedded byte to indicate - * whether the codepoint is alphabetical. - */ -#define PRISM_ENCODING_ALPHABETIC_BIT 1 << 0 - -/** - * All of the lookup tables use the second bit of each embedded byte to indicate - * whether the codepoint is alphanumeric. - */ -#define PRISM_ENCODING_ALPHANUMERIC_BIT 1 << 1 - -/** - * All of the lookup tables use the third bit of each embedded byte to indicate - * whether the codepoint is uppercase. - */ -#define PRISM_ENCODING_UPPERCASE_BIT 1 << 2 - -/** - * Return the size of the next character in the UTF-8 encoding. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_utf_8_char_width(const uint8_t *b, ptrdiff_t n); - -/** - * Return the size of the next character in the UTF-8 encoding if it is an - * alphabetical character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_utf_8_alpha_char(const uint8_t *b, ptrdiff_t n); - -/** - * Return the size of the next character in the UTF-8 encoding if it is an - * alphanumeric character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns The number of bytes that the next character takes if it is valid in - * the encoding, or 0 if it is not. - */ -size_t pm_encoding_utf_8_alnum_char(const uint8_t *b, ptrdiff_t n); - -/** - * Return true if the next character in the UTF-8 encoding if it is an uppercase - * character. - * - * @param b The bytes to read. - * @param n The number of bytes that can be read. - * @returns True if the next character is valid in the encoding and is an - * uppercase character, or false if it is not. - */ -bool pm_encoding_utf_8_isupper_char(const uint8_t *b, ptrdiff_t n); - -/** - * This lookup table is referenced in both the UTF-8 encoding file and the - * parser directly in order to speed up the default encoding processing. It is - * used to indicate whether a character is alphabetical, alphanumeric, or - * uppercase in unicode mappings. - */ -extern const uint8_t pm_encoding_unicode_table[256]; - -/** - * These are all of the encodings that prism supports. - */ -typedef enum { - PM_ENCODING_UTF_8 = 0, - PM_ENCODING_US_ASCII, - PM_ENCODING_ASCII_8BIT, - PM_ENCODING_EUC_JP, - PM_ENCODING_WINDOWS_31J, - -// We optionally support excluding the full set of encodings to only support the -// minimum necessary to process Ruby code without encoding comments. -#ifndef PRISM_ENCODING_EXCLUDE_FULL - PM_ENCODING_BIG5, - PM_ENCODING_BIG5_HKSCS, - PM_ENCODING_BIG5_UAO, - PM_ENCODING_CESU_8, - PM_ENCODING_CP51932, - PM_ENCODING_CP850, - PM_ENCODING_CP852, - PM_ENCODING_CP855, - PM_ENCODING_CP949, - PM_ENCODING_CP950, - PM_ENCODING_CP951, - PM_ENCODING_EMACS_MULE, - PM_ENCODING_EUC_JP_MS, - PM_ENCODING_EUC_JIS_2004, - PM_ENCODING_EUC_KR, - PM_ENCODING_EUC_TW, - PM_ENCODING_GB12345, - PM_ENCODING_GB18030, - PM_ENCODING_GB1988, - PM_ENCODING_GB2312, - PM_ENCODING_GBK, - PM_ENCODING_IBM437, - PM_ENCODING_IBM720, - PM_ENCODING_IBM737, - PM_ENCODING_IBM775, - PM_ENCODING_IBM852, - PM_ENCODING_IBM855, - PM_ENCODING_IBM857, - PM_ENCODING_IBM860, - PM_ENCODING_IBM861, - PM_ENCODING_IBM862, - PM_ENCODING_IBM863, - PM_ENCODING_IBM864, - PM_ENCODING_IBM865, - PM_ENCODING_IBM866, - PM_ENCODING_IBM869, - PM_ENCODING_ISO_8859_1, - PM_ENCODING_ISO_8859_2, - PM_ENCODING_ISO_8859_3, - PM_ENCODING_ISO_8859_4, - PM_ENCODING_ISO_8859_5, - PM_ENCODING_ISO_8859_6, - PM_ENCODING_ISO_8859_7, - PM_ENCODING_ISO_8859_8, - PM_ENCODING_ISO_8859_9, - PM_ENCODING_ISO_8859_10, - PM_ENCODING_ISO_8859_11, - PM_ENCODING_ISO_8859_13, - PM_ENCODING_ISO_8859_14, - PM_ENCODING_ISO_8859_15, - PM_ENCODING_ISO_8859_16, - PM_ENCODING_KOI8_R, - PM_ENCODING_KOI8_U, - PM_ENCODING_MAC_CENT_EURO, - PM_ENCODING_MAC_CROATIAN, - PM_ENCODING_MAC_CYRILLIC, - PM_ENCODING_MAC_GREEK, - PM_ENCODING_MAC_ICELAND, - PM_ENCODING_MAC_JAPANESE, - PM_ENCODING_MAC_ROMAN, - PM_ENCODING_MAC_ROMANIA, - PM_ENCODING_MAC_THAI, - PM_ENCODING_MAC_TURKISH, - PM_ENCODING_MAC_UKRAINE, - PM_ENCODING_SHIFT_JIS, - PM_ENCODING_SJIS_DOCOMO, - PM_ENCODING_SJIS_KDDI, - PM_ENCODING_SJIS_SOFTBANK, - PM_ENCODING_STATELESS_ISO_2022_JP, - PM_ENCODING_STATELESS_ISO_2022_JP_KDDI, - PM_ENCODING_TIS_620, - PM_ENCODING_UTF8_MAC, - PM_ENCODING_UTF8_DOCOMO, - PM_ENCODING_UTF8_KDDI, - PM_ENCODING_UTF8_SOFTBANK, - PM_ENCODING_WINDOWS_1250, - PM_ENCODING_WINDOWS_1251, - PM_ENCODING_WINDOWS_1252, - PM_ENCODING_WINDOWS_1253, - PM_ENCODING_WINDOWS_1254, - PM_ENCODING_WINDOWS_1255, - PM_ENCODING_WINDOWS_1256, - PM_ENCODING_WINDOWS_1257, - PM_ENCODING_WINDOWS_1258, - PM_ENCODING_WINDOWS_874, -#endif - - PM_ENCODING_MAXIMUM -} pm_encoding_type_t; - -/** - * This is the table of all of the encodings that prism supports. - */ -extern const pm_encoding_t pm_encodings[PM_ENCODING_MAXIMUM]; - -/** - * This is the default UTF-8 encoding. We need a reference to it to quickly - * create parsers. - */ -#define PM_ENCODING_UTF_8_ENTRY (&pm_encodings[PM_ENCODING_UTF_8]) - -/** - * This is the US-ASCII encoding. We need a reference to it to be able to - * compare against it when a string is being created because it could possibly - * need to fall back to ASCII-8BIT. - */ -#define PM_ENCODING_US_ASCII_ENTRY (&pm_encodings[PM_ENCODING_US_ASCII]) - -/** - * This is the ASCII-8BIT encoding. We need a reference to it so that pm_strpbrk - * can compare against it because invalid multibyte characters are not a thing - * in this encoding. It is also needed for handling Regexp encoding flags. - */ -#define PM_ENCODING_ASCII_8BIT_ENTRY (&pm_encodings[PM_ENCODING_ASCII_8BIT]) - -/** - * This is the EUC-JP encoding. We need a reference to it to quickly process - * regular expression modifiers. - */ -#define PM_ENCODING_EUC_JP_ENTRY (&pm_encodings[PM_ENCODING_EUC_JP]) - -/** - * This is the Windows-31J encoding. We need a reference to it to quickly - * process regular expression modifiers. - */ -#define PM_ENCODING_WINDOWS_31J_ENTRY (&pm_encodings[PM_ENCODING_WINDOWS_31J]) - -/** - * Parse the given name of an encoding and return a pointer to the corresponding - * encoding struct if one can be found, otherwise return NULL. - * - * @param start A pointer to the first byte of the name. - * @param end A pointer to the last byte of the name. - * @returns A pointer to the encoding struct if one is found, otherwise NULL. - */ -const pm_encoding_t * pm_encoding_find(const uint8_t *start, const uint8_t *end); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/extension.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/extension.h deleted file mode 100644 index d7ee0b7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/extension.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef PRISM_EXT_NODE_H -#define PRISM_EXT_NODE_H - -#define EXPECTED_PRISM_VERSION "1.0.0" - -#include -#include -#include "prism.h" - -VALUE pm_source_new(const pm_parser_t *parser, rb_encoding *encoding); -VALUE pm_token_new(const pm_parser_t *parser, const pm_token_t *token, rb_encoding *encoding, VALUE source); -VALUE pm_ast_new(const pm_parser_t *parser, const pm_node_t *node, rb_encoding *encoding, VALUE source); -VALUE pm_integer_new(const pm_integer_t *integer); - -void Init_prism_api_node(void); -void Init_prism_pack(void); -RUBY_FUNC_EXPORTED void Init_prism(void); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/node.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/node.h deleted file mode 100644 index e8686a3..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/node.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @file node.h - * - * Functions related to nodes in the AST. - */ -#ifndef PRISM_NODE_H -#define PRISM_NODE_H - -#include "prism/defines.h" -#include "prism/parser.h" -#include "prism/util/pm_buffer.h" - -/** - * Loop through each node in the node list, writing each node to the given - * pm_node_t pointer. - */ -#define PM_NODE_LIST_FOREACH(list, index, node) \ - for (size_t index = 0; index < (list)->size && ((node) = (list)->nodes[index]); index++) - -/** - * Append a new node onto the end of the node list. - * - * @param list The list to append to. - * @param node The node to append. - */ -void pm_node_list_append(pm_node_list_t *list, pm_node_t *node); - -/** - * Prepend a new node onto the beginning of the node list. - * - * @param list The list to prepend to. - * @param node The node to prepend. - */ -void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node); - -/** - * Concatenate the given node list onto the end of the other node list. - * - * @param list The list to concatenate onto. - * @param other The list to concatenate. - */ -void pm_node_list_concat(pm_node_list_t *list, pm_node_list_t *other); - -/** - * Free the internal memory associated with the given node list. - * - * @param list The list to free. - */ -void pm_node_list_free(pm_node_list_t *list); - -/** - * Deallocate a node and all of its children. - * - * @param parser The parser that owns the node. - * @param node The node to deallocate. - */ -PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node); - -/** - * Returns a string representation of the given node type. - * - * @param node_type The node type to convert to a string. - * @return A string representation of the given node type. - */ -PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_type); - -/** - * Visit each of the nodes in this subtree using the given visitor callback. The - * callback function will be called for each node in the subtree. If it returns - * false, then that node's children will not be visited. If it returns true, - * then the children will be visited. The data parameter is treated as an opaque - * pointer and is passed to the visitor callback for consumers to use as they - * see fit. - * - * As an example: - * - * ```c - * #include "prism.h" - * - * bool visit(const pm_node_t *node, void *data) { - * size_t *indent = (size_t *) data; - * for (size_t i = 0; i < *indent * 2; i++) putc(' ', stdout); - * printf("%s\n", pm_node_type_to_str(node->type)); - * - * size_t next_indent = *indent + 1; - * size_t *next_data = &next_indent; - * pm_visit_child_nodes(node, visit, next_data); - * - * return false; - * } - * - * int main(void) { - * const char *source = "1 + 2; 3 + 4"; - * size_t size = strlen(source); - * - * pm_parser_t parser; - * pm_options_t options = { 0 }; - * pm_parser_init(&parser, (const uint8_t *) source, size, &options); - * - * size_t indent = 0; - * pm_node_t *node = pm_parse(&parser); - * - * size_t *data = &indent; - * pm_visit_node(node, visit, data); - * - * pm_node_destroy(&parser, node); - * pm_parser_free(&parser); - * return EXIT_SUCCESS; - * } - * ``` - * - * @param node The root node to start visiting from. - * @param visitor The callback to call for each node in the subtree. - * @param data An opaque pointer that is passed to the visitor callback. - */ -PRISM_EXPORTED_FUNCTION void pm_visit_node(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data); - -/** - * Visit the children of the given node with the given callback. This is the - * default behavior for walking the tree that is called from pm_visit_node if - * the callback returns true. - * - * @param node The node to visit the children of. - * @param visitor The callback to call for each child node. - * @param data An opaque pointer that is passed to the visitor callback. - */ -PRISM_EXPORTED_FUNCTION void pm_visit_child_nodes(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/options.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/options.h deleted file mode 100644 index c96fa68..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/options.h +++ /dev/null @@ -1,396 +0,0 @@ -/** - * @file options.h - * - * The options that can be passed to parsing. - */ -#ifndef PRISM_OPTIONS_H -#define PRISM_OPTIONS_H - -#include "prism/defines.h" -#include "prism/util/pm_char.h" -#include "prism/util/pm_string.h" - -#include -#include -#include - -/** - * String literals should be made frozen. - */ -#define PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED ((int8_t) -1) - -/** - * String literals may be frozen or mutable depending on the implementation - * default. - */ -#define PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET ((int8_t) 0) - -/** - * String literals should be made mutable. - */ -#define PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED ((int8_t) 1) - -/** - * A scope of locals surrounding the code that is being parsed. - */ -typedef struct pm_options_scope { - /** The number of locals in the scope. */ - size_t locals_count; - - /** The names of the locals in the scope. */ - pm_string_t *locals; -} pm_options_scope_t; - -// Forward declaration needed by the callback typedef. -struct pm_options; - -/** - * The callback called when additional switches are found in a shebang comment - * that need to be processed by the runtime. - * - * @param options The options struct that may be updated by this callback. - * Certain fields will be checked for changes, specifically encoding, - * command_line, and frozen_string_literal. - * @param source The source of the shebang comment. - * @param length The length of the source. - * @param shebang_callback_data Any additional data that should be passed along - * to the callback. - */ -typedef void (*pm_options_shebang_callback_t)(struct pm_options *options, const uint8_t *source, size_t length, void *shebang_callback_data); - -/** - * The version of Ruby syntax that we should be parsing with. This is used to - * allow consumers to specify which behavior they want in case they need to - * parse in the same way as a specific version of CRuby would have. - */ -typedef enum { - /** The current version of prism. */ - PM_OPTIONS_VERSION_LATEST = 0, - - /** The vendored version of prism in CRuby 3.3.x. */ - PM_OPTIONS_VERSION_CRUBY_3_3 = 1 -} pm_options_version_t; - -/** - * The options that can be passed to the parser. - */ -typedef struct pm_options { - /** - * The callback to call when additional switches are found in a shebang - * comment. - */ - pm_options_shebang_callback_t shebang_callback; - - /** - * Any additional data that should be passed along to the shebang callback - * if one was set. - */ - void *shebang_callback_data; - - /** The name of the file that is currently being parsed. */ - pm_string_t filepath; - - /** - * The line within the file that the parse starts on. This value is - * 1-indexed. - */ - int32_t line; - - /** - * The name of the encoding that the source file is in. Note that this must - * correspond to a name that can be found with Encoding.find in Ruby. - */ - pm_string_t encoding; - - /** - * The number of scopes surrounding the code that is being parsed. - */ - size_t scopes_count; - - /** - * The scopes surrounding the code that is being parsed. For most parses - * this will be NULL, but for evals it will be the locals that are in scope - * surrounding the eval. Scopes are ordered from the outermost scope to the - * innermost one. - */ - pm_options_scope_t *scopes; - - /** - * The version of prism that we should be parsing with. This is used to - * allow consumers to specify which behavior they want in case they need to - * parse exactly as a specific version of CRuby. - */ - pm_options_version_t version; - - /** A bitset of the various options that were set on the command line. */ - uint8_t command_line; - - /** - * Whether or not the frozen string literal option has been set. - * May be: - * - PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET - */ - int8_t frozen_string_literal; - - /** - * Whether or not the encoding magic comments should be respected. This is a - * niche use-case where you want to parse a file with a specific encoding - * but ignore any encoding magic comments at the top of the file. - */ - bool encoding_locked; - - /** - * When the file being parsed is the main script, the shebang will be - * considered for command-line flags (or for implicit -x). The caller needs - * to pass this information to the parser so that it can behave correctly. - */ - bool main_script; - - /** - * When the file being parsed is considered a "partial" script, jumps will - * not be marked as errors if they are not contained within loops/blocks. - * This is used in the case that you're parsing a script that you know will - * be embedded inside another script later, but you do not have that context - * yet. For example, when parsing an ERB template that will be evaluated - * inside another script. - */ - bool partial_script; -} pm_options_t; - -/** - * A bit representing whether or not the command line -a option was set. -a - * splits the input line $_ into $F. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_A = 0x1; - -/** - * A bit representing whether or not the command line -e option was set. -e - * allow the user to specify a script to be executed. This is necessary for - * prism to know because certain warnings are not generated when -e is used. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_E = 0x2; - -/** - * A bit representing whether or not the command line -l option was set. -l - * chomps the input line by default. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_L = 0x4; - -/** - * A bit representing whether or not the command line -n option was set. -n - * wraps the script in a while gets loop. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_N = 0x8; - -/** - * A bit representing whether or not the command line -p option was set. -p - * prints the value of $_ at the end of each loop. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_P = 0x10; - -/** - * A bit representing whether or not the command line -x option was set. -x - * searches the input file for a shebang that matches the current Ruby engine. - */ -static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20; - -/** - * Set the shebang callback option on the given options struct. - * - * @param options The options struct to set the shebang callback on. - * @param shebang_callback The shebang callback to set. - * @param shebang_callback_data Any additional data that should be passed along - * to the callback. - */ -PRISM_EXPORTED_FUNCTION void pm_options_shebang_callback_set(pm_options_t *options, pm_options_shebang_callback_t shebang_callback, void *shebang_callback_data); - -/** - * Set the filepath option on the given options struct. - * - * @param options The options struct to set the filepath on. - * @param filepath The filepath to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, const char *filepath); - -/** - * Set the line option on the given options struct. - * - * @param options The options struct to set the line on. - * @param line The line to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t line); - -/** - * Set the encoding option on the given options struct. - * - * @param options The options struct to set the encoding on. - * @param encoding The encoding to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, const char *encoding); - -/** - * Set the encoding_locked option on the given options struct. - * - * @param options The options struct to set the encoding_locked value on. - * @param encoding_locked The encoding_locked value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_encoding_locked_set(pm_options_t *options, bool encoding_locked); - -/** - * Set the frozen string literal option on the given options struct. - * - * @param options The options struct to set the frozen string literal value on. - * @param frozen_string_literal The frozen string literal value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_literal); - -/** - * Sets the command line option on the given options struct. - * - * @param options The options struct to set the command line option on. - * @param command_line The command_line value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, uint8_t command_line); - -/** - * Set the version option on the given options struct by parsing the given - * string. If the string contains an invalid option, this returns false. - * Otherwise, it returns true. - * - * @param options The options struct to set the version on. - * @param version The version to set. - * @param length The length of the version string. - * @return Whether or not the version was parsed successfully. - */ -PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const char *version, size_t length); - -/** - * Set the main script option on the given options struct. - * - * @param options The options struct to set the main script value on. - * @param main_script The main script value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_main_script_set(pm_options_t *options, bool main_script); - -/** - * Set the partial script option on the given options struct. - * - * @param options The options struct to set the partial script value on. - * @param partial_script The partial script value to set. - */ -PRISM_EXPORTED_FUNCTION void pm_options_partial_script_set(pm_options_t *options, bool partial_script); - -/** - * Allocate and zero out the scopes array on the given options struct. - * - * @param options The options struct to initialize the scopes array on. - * @param scopes_count The number of scopes to allocate. - * @return Whether or not the scopes array was initialized successfully. - */ -PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_t scopes_count); - -/** - * Return a pointer to the scope at the given index within the given options. - * - * @param options The options struct to get the scope from. - * @param index The index of the scope to get. - * @return A pointer to the scope at the given index. - */ -PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm_options_t *options, size_t index); - -/** - * Create a new options scope struct. This will hold a set of locals that are in - * scope surrounding the code that is being parsed. - * - * @param scope The scope struct to initialize. - * @param locals_count The number of locals to allocate. - * @return Whether or not the scope was initialized successfully. - */ -PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, size_t locals_count); - -/** - * Return a pointer to the local at the given index within the given scope. - * - * @param scope The scope struct to get the local from. - * @param index The index of the local to get. - * @return A pointer to the local at the given index. - */ -PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_options_scope_t *scope, size_t index); - -/** - * Free the internal memory associated with the options. - * - * @param options The options struct whose internal memory should be freed. - */ -PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options); - -/** - * Deserialize an options struct from the given binary string. This is used to - * pass options to the parser from an FFI call so that consumers of the library - * from an FFI perspective don't have to worry about the structure of our - * options structs. Since the source of these calls will be from Ruby - * implementation internals we assume it is from a trusted source. - * - * `data` is assumed to be a valid pointer pointing to well-formed data. The - * layout of this data should be the same every time, and is described below: - * - * | # bytes | field | - * | ------- | -------------------------- | - * | `4` | the length of the filepath | - * | ... | the filepath bytes | - * | `4` | the line number | - * | `4` | the length the encoding | - * | ... | the encoding bytes | - * | `1` | frozen string literal | - * | `1` | -p command line option | - * | `1` | -n command line option | - * | `1` | -l command line option | - * | `1` | -a command line option | - * | `1` | the version | - * | `1` | encoding locked | - * | `1` | main script | - * | `1` | partial script | - * | `4` | the number of scopes | - * | ... | the scopes | - * - * The version field is an enum, so it should be one of the following values: - * - * | value | version | - * | ----- | ------------------------- | - * | `0` | use the latest version of prism | - * | `1` | use the version of prism that is vendored in CRuby 3.3.0 | - * - * Each scope is laid out as follows: - * - * | # bytes | field | - * | ------- | -------------------------- | - * | `4` | the number of locals | - * | ... | the locals | - * - * Each local is laid out as follows: - * - * | # bytes | field | - * | ------- | -------------------------- | - * | `4` | the length of the local | - * | ... | the local bytes | - * - * Some additional things to note about this layout: - * - * * The filepath can have a length of 0, in which case we'll consider it an - * empty string. - * * The line number should be 0-indexed. - * * The encoding can have a length of 0, in which case we'll use the default - * encoding (UTF-8). If it's not 0, it should correspond to a name of an - * encoding that can be passed to `Encoding.find` in Ruby. - * * The frozen string literal, encoding locked, main script, and partial script - * fields are booleans, so their values should be either 0 or 1. - * * The number of scopes can be 0. - * - * @param options The options struct to deserialize into. - * @param data The binary string to deserialize from. - */ -void pm_options_read(pm_options_t *options, const char *data); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h deleted file mode 100644 index 0b0b4b1..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @file pack.h - * - * A pack template string parser. - */ -#ifndef PRISM_PACK_H -#define PRISM_PACK_H - -#include "prism/defines.h" - -// We optionally support parsing String#pack templates. For systems that don't -// want or need this functionality, it can be turned off with the -// PRISM_EXCLUDE_PACK define. -#ifdef PRISM_EXCLUDE_PACK - -void pm_pack_parse(void); - -#else - -#include -#include - -/** The version of the pack template language that we are parsing. */ -typedef enum pm_pack_version { - PM_PACK_VERSION_3_2_0 -} pm_pack_version; - -/** The type of pack template we are parsing. */ -typedef enum pm_pack_variant { - PM_PACK_VARIANT_PACK, - PM_PACK_VARIANT_UNPACK -} pm_pack_variant; - -/** A directive within the pack template. */ -typedef enum pm_pack_type { - PM_PACK_SPACE, - PM_PACK_COMMENT, - PM_PACK_INTEGER, - PM_PACK_UTF8, - PM_PACK_BER, - PM_PACK_FLOAT, - PM_PACK_STRING_SPACE_PADDED, - PM_PACK_STRING_NULL_PADDED, - PM_PACK_STRING_NULL_TERMINATED, - PM_PACK_STRING_MSB, - PM_PACK_STRING_LSB, - PM_PACK_STRING_HEX_HIGH, - PM_PACK_STRING_HEX_LOW, - PM_PACK_STRING_UU, - PM_PACK_STRING_MIME, - PM_PACK_STRING_BASE64, - PM_PACK_STRING_FIXED, - PM_PACK_STRING_POINTER, - PM_PACK_MOVE, - PM_PACK_BACK, - PM_PACK_NULL, - PM_PACK_END -} pm_pack_type; - -/** The signness of a pack directive. */ -typedef enum pm_pack_signed { - PM_PACK_UNSIGNED, - PM_PACK_SIGNED, - PM_PACK_SIGNED_NA -} pm_pack_signed; - -/** The endianness of a pack directive. */ -typedef enum pm_pack_endian { - PM_PACK_AGNOSTIC_ENDIAN, - PM_PACK_LITTLE_ENDIAN, // aka 'VAX', or 'V' - PM_PACK_BIG_ENDIAN, // aka 'network', or 'N' - PM_PACK_NATIVE_ENDIAN, - PM_PACK_ENDIAN_NA -} pm_pack_endian; - -/** The size of an integer pack directive. */ -typedef enum pm_pack_size { - PM_PACK_SIZE_SHORT, - PM_PACK_SIZE_INT, - PM_PACK_SIZE_LONG, - PM_PACK_SIZE_LONG_LONG, - PM_PACK_SIZE_8, - PM_PACK_SIZE_16, - PM_PACK_SIZE_32, - PM_PACK_SIZE_64, - PM_PACK_SIZE_P, - PM_PACK_SIZE_NA -} pm_pack_size; - -/** The type of length of a pack directive. */ -typedef enum pm_pack_length_type { - PM_PACK_LENGTH_FIXED, - PM_PACK_LENGTH_MAX, - PM_PACK_LENGTH_RELATIVE, // special case for unpack @* - PM_PACK_LENGTH_NA -} pm_pack_length_type; - -/** The type of encoding for a pack template string. */ -typedef enum pm_pack_encoding { - PM_PACK_ENCODING_START, - PM_PACK_ENCODING_ASCII_8BIT, - PM_PACK_ENCODING_US_ASCII, - PM_PACK_ENCODING_UTF_8 -} pm_pack_encoding; - -/** The result of parsing a pack template. */ -typedef enum pm_pack_result { - PM_PACK_OK, - PM_PACK_ERROR_UNSUPPORTED_DIRECTIVE, - PM_PACK_ERROR_UNKNOWN_DIRECTIVE, - PM_PACK_ERROR_LENGTH_TOO_BIG, - PM_PACK_ERROR_BANG_NOT_ALLOWED, - PM_PACK_ERROR_DOUBLE_ENDIAN -} pm_pack_result; - -/** - * Parse a single directive from a pack or unpack format string. - * - * @param variant (in) pack or unpack - * @param format (in, out) the start of the next directive to parse on calling, - * and advanced beyond the parsed directive on return, or as much of it as - * was consumed until an error was encountered - * @param format_end (in) the end of the format string - * @param type (out) the type of the directive - * @param signed_type (out) whether the value is signed - * @param endian (out) the endianness of the value - * @param size (out) the size of the value - * @param length_type (out) what kind of length is specified - * @param length (out) the length of the directive - * @param encoding (in, out) takes the current encoding of the string which - * would result from parsing the whole format string, and returns a possibly - * changed directive - the encoding should be `PM_PACK_ENCODING_START` when - * pm_pack_parse is called for the first directive in a format string - * - * @return `PM_PACK_OK` on success or `PM_PACK_ERROR_*` on error - * @note Consult Ruby documentation for the meaning of directives. - */ -PRISM_EXPORTED_FUNCTION pm_pack_result -pm_pack_parse( - pm_pack_variant variant, - const char **format, - const char *format_end, - pm_pack_type *type, - pm_pack_signed *signed_type, - pm_pack_endian *endian, - pm_pack_size *size, - pm_pack_length_type *length_type, - uint64_t *length, - pm_pack_encoding *encoding -); - -/** - * Prism abstracts sizes away from the native system - this converts an abstract - * size to a native size. - * - * @param size The abstract size to convert. - * @return The native size. - */ -PRISM_EXPORTED_FUNCTION size_t pm_size_to_native(pm_pack_size size); - -#endif - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/parser.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/parser.h deleted file mode 100644 index 992729d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/parser.h +++ /dev/null @@ -1,933 +0,0 @@ -/** - * @file parser.h - * - * The parser used to parse Ruby source. - */ -#ifndef PRISM_PARSER_H -#define PRISM_PARSER_H - -#include "prism/defines.h" -#include "prism/ast.h" -#include "prism/encoding.h" -#include "prism/options.h" -#include "prism/static_literals.h" -#include "prism/util/pm_constant_pool.h" -#include "prism/util/pm_list.h" -#include "prism/util/pm_newline_list.h" -#include "prism/util/pm_string.h" - -#include - -/** - * This enum provides various bits that represent different kinds of states that - * the lexer can track. This is used to determine which kind of token to return - * based on the context of the parser. - */ -typedef enum { - PM_LEX_STATE_BIT_BEG, - PM_LEX_STATE_BIT_END, - PM_LEX_STATE_BIT_ENDARG, - PM_LEX_STATE_BIT_ENDFN, - PM_LEX_STATE_BIT_ARG, - PM_LEX_STATE_BIT_CMDARG, - PM_LEX_STATE_BIT_MID, - PM_LEX_STATE_BIT_FNAME, - PM_LEX_STATE_BIT_DOT, - PM_LEX_STATE_BIT_CLASS, - PM_LEX_STATE_BIT_LABEL, - PM_LEX_STATE_BIT_LABELED, - PM_LEX_STATE_BIT_FITEM -} pm_lex_state_bit_t; - -/** - * This enum combines the various bits from the above enum into individual - * values that represent the various states of the lexer. - */ -typedef enum { - PM_LEX_STATE_NONE = 0, - PM_LEX_STATE_BEG = (1 << PM_LEX_STATE_BIT_BEG), - PM_LEX_STATE_END = (1 << PM_LEX_STATE_BIT_END), - PM_LEX_STATE_ENDARG = (1 << PM_LEX_STATE_BIT_ENDARG), - PM_LEX_STATE_ENDFN = (1 << PM_LEX_STATE_BIT_ENDFN), - PM_LEX_STATE_ARG = (1 << PM_LEX_STATE_BIT_ARG), - PM_LEX_STATE_CMDARG = (1 << PM_LEX_STATE_BIT_CMDARG), - PM_LEX_STATE_MID = (1 << PM_LEX_STATE_BIT_MID), - PM_LEX_STATE_FNAME = (1 << PM_LEX_STATE_BIT_FNAME), - PM_LEX_STATE_DOT = (1 << PM_LEX_STATE_BIT_DOT), - PM_LEX_STATE_CLASS = (1 << PM_LEX_STATE_BIT_CLASS), - PM_LEX_STATE_LABEL = (1 << PM_LEX_STATE_BIT_LABEL), - PM_LEX_STATE_LABELED = (1 << PM_LEX_STATE_BIT_LABELED), - PM_LEX_STATE_FITEM = (1 << PM_LEX_STATE_BIT_FITEM), - PM_LEX_STATE_BEG_ANY = PM_LEX_STATE_BEG | PM_LEX_STATE_MID | PM_LEX_STATE_CLASS, - PM_LEX_STATE_ARG_ANY = PM_LEX_STATE_ARG | PM_LEX_STATE_CMDARG, - PM_LEX_STATE_END_ANY = PM_LEX_STATE_END | PM_LEX_STATE_ENDARG | PM_LEX_STATE_ENDFN -} pm_lex_state_t; - -/** - * The type of quote that a heredoc uses. - */ -typedef enum { - PM_HEREDOC_QUOTE_NONE, - PM_HEREDOC_QUOTE_SINGLE = '\'', - PM_HEREDOC_QUOTE_DOUBLE = '"', - PM_HEREDOC_QUOTE_BACKTICK = '`', -} pm_heredoc_quote_t; - -/** - * The type of indentation that a heredoc uses. - */ -typedef enum { - PM_HEREDOC_INDENT_NONE, - PM_HEREDOC_INDENT_DASH, - PM_HEREDOC_INDENT_TILDE, -} pm_heredoc_indent_t; - -/** - * All of the information necessary to store to lexing a heredoc. - */ -typedef struct { - /** A pointer to the start of the heredoc identifier. */ - const uint8_t *ident_start; - - /** The length of the heredoc identifier. */ - size_t ident_length; - - /** The type of quote that the heredoc uses. */ - pm_heredoc_quote_t quote; - - /** The type of indentation that the heredoc uses. */ - pm_heredoc_indent_t indent; -} pm_heredoc_lex_mode_t; - -/** - * When lexing Ruby source, the lexer has a small amount of state to tell which - * kind of token it is currently lexing. For example, when we find the start of - * a string, the first token that we return is a TOKEN_STRING_BEGIN token. After - * that the lexer is now in the PM_LEX_STRING mode, and will return tokens that - * are found as part of a string. - */ -typedef struct pm_lex_mode { - /** The type of this lex mode. */ - enum { - /** This state is used when any given token is being lexed. */ - PM_LEX_DEFAULT, - - /** - * This state is used when we're lexing as normal but inside an embedded - * expression of a string. - */ - PM_LEX_EMBEXPR, - - /** - * This state is used when we're lexing a variable that is embedded - * directly inside of a string with the # shorthand. - */ - PM_LEX_EMBVAR, - - /** This state is used when you are inside the content of a heredoc. */ - PM_LEX_HEREDOC, - - /** - * This state is used when we are lexing a list of tokens, as in a %w - * word list literal or a %i symbol list literal. - */ - PM_LEX_LIST, - - /** - * This state is used when a regular expression has been begun and we - * are looking for the terminator. - */ - PM_LEX_REGEXP, - - /** - * This state is used when we are lexing a string or a string-like - * token, as in string content with either quote or an xstring. - */ - PM_LEX_STRING - } mode; - - /** The data associated with this type of lex mode. */ - union { - struct { - /** This keeps track of the nesting level of the list. */ - size_t nesting; - - /** Whether or not interpolation is allowed in this list. */ - bool interpolation; - - /** - * When lexing a list, it takes into account balancing the - * terminator if the terminator is one of (), [], {}, or <>. - */ - uint8_t incrementor; - - /** This is the terminator of the list literal. */ - uint8_t terminator; - - /** - * This is the character set that should be used to delimit the - * tokens within the list. - */ - uint8_t breakpoints[11]; - } list; - - struct { - /** - * This keeps track of the nesting level of the regular expression. - */ - size_t nesting; - - /** - * When lexing a regular expression, it takes into account balancing - * the terminator if the terminator is one of (), [], {}, or <>. - */ - uint8_t incrementor; - - /** This is the terminator of the regular expression. */ - uint8_t terminator; - - /** - * This is the character set that should be used to delimit the - * tokens within the regular expression. - */ - uint8_t breakpoints[7]; - } regexp; - - struct { - /** This keeps track of the nesting level of the string. */ - size_t nesting; - - /** Whether or not interpolation is allowed in this string. */ - bool interpolation; - - /** - * Whether or not at the end of the string we should allow a :, - * which would indicate this was a dynamic symbol instead of a - * string. - */ - bool label_allowed; - - /** - * When lexing a string, it takes into account balancing the - * terminator if the terminator is one of (), [], {}, or <>. - */ - uint8_t incrementor; - - /** - * This is the terminator of the string. It is typically either a - * single or double quote. - */ - uint8_t terminator; - - /** - * This is the character set that should be used to delimit the - * tokens within the string. - */ - uint8_t breakpoints[7]; - } string; - - struct { - /** - * All of the data necessary to lex a heredoc. - */ - pm_heredoc_lex_mode_t base; - - /** - * This is the pointer to the character where lexing should resume - * once the heredoc has been completely processed. - */ - const uint8_t *next_start; - - /** - * This is used to track the amount of common whitespace on each - * line so that we know how much to dedent each line in the case of - * a tilde heredoc. - */ - size_t *common_whitespace; - - /** True if the previous token ended with a line continuation. */ - bool line_continuation; - } heredoc; - } as; - - /** The previous lex state so that it knows how to pop. */ - struct pm_lex_mode *prev; -} pm_lex_mode_t; - -/** - * We pre-allocate a certain number of lex states in order to avoid having to - * call malloc too many times while parsing. You really shouldn't need more than - * this because you only really nest deeply when doing string interpolation. - */ -#define PM_LEX_STACK_SIZE 4 - -/** - * The parser used to parse Ruby source. - */ -typedef struct pm_parser pm_parser_t; - -/** - * While parsing, we keep track of a stack of contexts. This is helpful for - * error recovery so that we can pop back to a previous context when we hit a - * token that is understood by a parent context but not by the current context. - */ -typedef enum { - /** a null context, used for returning a value from a function */ - PM_CONTEXT_NONE = 0, - - /** a begin statement */ - PM_CONTEXT_BEGIN, - - /** an ensure statement with an explicit begin */ - PM_CONTEXT_BEGIN_ENSURE, - - /** a rescue else statement with an explicit begin */ - PM_CONTEXT_BEGIN_ELSE, - - /** a rescue statement with an explicit begin */ - PM_CONTEXT_BEGIN_RESCUE, - - /** expressions in block arguments using braces */ - PM_CONTEXT_BLOCK_BRACES, - - /** expressions in block arguments using do..end */ - PM_CONTEXT_BLOCK_KEYWORDS, - - /** an ensure statement within a do..end block */ - PM_CONTEXT_BLOCK_ENSURE, - - /** a rescue else statement within a do..end block */ - PM_CONTEXT_BLOCK_ELSE, - - /** a rescue statement within a do..end block */ - PM_CONTEXT_BLOCK_RESCUE, - - /** a case when statements */ - PM_CONTEXT_CASE_WHEN, - - /** a case in statements */ - PM_CONTEXT_CASE_IN, - - /** a class declaration */ - PM_CONTEXT_CLASS, - - /** an ensure statement within a class statement */ - PM_CONTEXT_CLASS_ENSURE, - - /** a rescue else statement within a class statement */ - PM_CONTEXT_CLASS_ELSE, - - /** a rescue statement within a class statement */ - PM_CONTEXT_CLASS_RESCUE, - - /** a method definition */ - PM_CONTEXT_DEF, - - /** an ensure statement within a method definition */ - PM_CONTEXT_DEF_ENSURE, - - /** a rescue else statement within a method definition */ - PM_CONTEXT_DEF_ELSE, - - /** a rescue statement within a method definition */ - PM_CONTEXT_DEF_RESCUE, - - /** a method definition's parameters */ - PM_CONTEXT_DEF_PARAMS, - - /** a defined? expression */ - PM_CONTEXT_DEFINED, - - /** a method definition's default parameter */ - PM_CONTEXT_DEFAULT_PARAMS, - - /** an else clause */ - PM_CONTEXT_ELSE, - - /** an elsif clause */ - PM_CONTEXT_ELSIF, - - /** an interpolated expression */ - PM_CONTEXT_EMBEXPR, - - /** a for loop */ - PM_CONTEXT_FOR, - - /** a for loop's index */ - PM_CONTEXT_FOR_INDEX, - - /** an if statement */ - PM_CONTEXT_IF, - - /** a lambda expression with braces */ - PM_CONTEXT_LAMBDA_BRACES, - - /** a lambda expression with do..end */ - PM_CONTEXT_LAMBDA_DO_END, - - /** an ensure statement within a lambda expression */ - PM_CONTEXT_LAMBDA_ENSURE, - - /** a rescue else statement within a lambda expression */ - PM_CONTEXT_LAMBDA_ELSE, - - /** a rescue statement within a lambda expression */ - PM_CONTEXT_LAMBDA_RESCUE, - - /** the predicate clause of a loop statement */ - PM_CONTEXT_LOOP_PREDICATE, - - /** the top level context */ - PM_CONTEXT_MAIN, - - /** a module declaration */ - PM_CONTEXT_MODULE, - - /** an ensure statement within a module statement */ - PM_CONTEXT_MODULE_ENSURE, - - /** a rescue else statement within a module statement */ - PM_CONTEXT_MODULE_ELSE, - - /** a rescue statement within a module statement */ - PM_CONTEXT_MODULE_RESCUE, - - /** a multiple target expression */ - PM_CONTEXT_MULTI_TARGET, - - /** a parenthesized expression */ - PM_CONTEXT_PARENS, - - /** an END block */ - PM_CONTEXT_POSTEXE, - - /** a predicate inside an if/elsif/unless statement */ - PM_CONTEXT_PREDICATE, - - /** a BEGIN block */ - PM_CONTEXT_PREEXE, - - /** a modifier rescue clause */ - PM_CONTEXT_RESCUE_MODIFIER, - - /** a singleton class definition */ - PM_CONTEXT_SCLASS, - - /** an ensure statement with a singleton class */ - PM_CONTEXT_SCLASS_ENSURE, - - /** a rescue else statement with a singleton class */ - PM_CONTEXT_SCLASS_ELSE, - - /** a rescue statement with a singleton class */ - PM_CONTEXT_SCLASS_RESCUE, - - /** a ternary expression */ - PM_CONTEXT_TERNARY, - - /** an unless statement */ - PM_CONTEXT_UNLESS, - - /** an until statement */ - PM_CONTEXT_UNTIL, - - /** a while statement */ - PM_CONTEXT_WHILE, -} pm_context_t; - -/** This is a node in a linked list of contexts. */ -typedef struct pm_context_node { - /** The context that this node represents. */ - pm_context_t context; - - /** A pointer to the previous context in the linked list. */ - struct pm_context_node *prev; -} pm_context_node_t; - -/** This is the type of a comment that we've found while parsing. */ -typedef enum { - PM_COMMENT_INLINE, - PM_COMMENT_EMBDOC -} pm_comment_type_t; - -/** - * This is a node in the linked list of comments that we've found while parsing. - * - * @extends pm_list_node_t - */ -typedef struct pm_comment { - /** The embedded base node. */ - pm_list_node_t node; - - /** The location of the comment in the source. */ - pm_location_t location; - - /** The type of comment that we've found. */ - pm_comment_type_t type; -} pm_comment_t; - -/** - * This is a node in the linked list of magic comments that we've found while - * parsing. - * - * @extends pm_list_node_t - */ -typedef struct { - /** The embedded base node. */ - pm_list_node_t node; - - /** A pointer to the start of the key in the source. */ - const uint8_t *key_start; - - /** A pointer to the start of the value in the source. */ - const uint8_t *value_start; - - /** The length of the key in the source. */ - uint32_t key_length; - - /** The length of the value in the source. */ - uint32_t value_length; -} pm_magic_comment_t; - -/** - * When the encoding that is being used to parse the source is changed by prism, - * we provide the ability here to call out to a user-defined function. - */ -typedef void (*pm_encoding_changed_callback_t)(pm_parser_t *parser); - -/** - * When you are lexing through a file, the lexer needs all of the information - * that the parser additionally provides (for example, the local table). So if - * you want to properly lex Ruby, you need to actually lex it in the context of - * the parser. In order to provide this functionality, we optionally allow a - * struct to be attached to the parser that calls back out to a user-provided - * callback when each token is lexed. - */ -typedef struct { - /** - * This opaque pointer is used to provide whatever information the user - * deemed necessary to the callback. In our case we use it to pass the array - * that the tokens get appended into. - */ - void *data; - - /** - * This is the callback that is called when a token is lexed. It is passed - * the opaque data pointer, the parser, and the token that was lexed. - */ - void (*callback)(void *data, pm_parser_t *parser, pm_token_t *token); -} pm_lex_callback_t; - -/** The type of shareable constant value that can be set. */ -typedef uint8_t pm_shareable_constant_value_t; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_NONE = 0x0; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_LITERAL = PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_EVERYTHING = PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING; -static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_COPY = PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY; - -/** - * This tracks an individual local variable in a certain lexical context, as - * well as the number of times is it read. - */ -typedef struct { - /** The name of the local variable. */ - pm_constant_id_t name; - - /** The location of the local variable in the source. */ - pm_location_t location; - - /** The index of the local variable in the local table. */ - uint32_t index; - - /** The number of times the local variable is read. */ - uint32_t reads; - - /** The hash of the local variable. */ - uint32_t hash; -} pm_local_t; - -/** - * This is a set of local variables in a certain lexical context (method, class, - * module, etc.). We need to track how many times these variables are read in - * order to warn if they only get written. - */ -typedef struct pm_locals { - /** The number of local variables in the set. */ - uint32_t size; - - /** The capacity of the local variables set. */ - uint32_t capacity; - - /** The nullable allocated memory for the local variables in the set. */ - pm_local_t *locals; -} pm_locals_t; - -/** The flags about scope parameters that can be set. */ -typedef uint8_t pm_scope_parameters_t; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_NONE = 0x0; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS = 0x1; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_KEYWORDS = 0x2; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_BLOCK = 0x4; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_ALL = 0x8; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_IMPLICIT_DISALLOWED = 0x10; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_NUMBERED_INNER = 0x20; -static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_NUMBERED_FOUND = 0x40; - -/** - * This struct represents a node in a linked list of scopes. Some scopes can see - * into their parent scopes, while others cannot. - */ -typedef struct pm_scope { - /** A pointer to the previous scope in the linked list. */ - struct pm_scope *previous; - - /** The IDs of the locals in the given scope. */ - pm_locals_t locals; - - /** - * This is a list of the implicit parameters contained within the block. - * These will be processed after the block is parsed to determine the kind - * of parameters node that should be used and to check if any errors need to - * be added. - */ - pm_node_list_t implicit_parameters; - - /** - * This is a bitfield that indicates the parameters that are being used in - * this scope. It is a combination of the PM_SCOPE_PARAMETERS_* constants. - * There are three different kinds of parameters that can be used in a - * scope: - * - * - Ordinary parameters (e.g., def foo(bar); end) - * - Numbered parameters (e.g., def foo; _1; end) - * - The it parameter (e.g., def foo; it; end) - * - * If ordinary parameters are being used, then certain parameters can be - * forwarded to another method/structure. Those are indicated by four - * additional bits in the params field. For example, some combinations of: - * - * - def foo(*); end - * - def foo(**); end - * - def foo(&); end - * - def foo(...); end - */ - pm_scope_parameters_t parameters; - - /** - * The current state of constant shareability for this scope. This is - * changed by magic shareable_constant_value comments. - */ - pm_shareable_constant_value_t shareable_constant; - - /** - * A boolean indicating whether or not this scope can see into its parent. - * If closed is true, then the scope cannot see into its parent. - */ - bool closed; -} pm_scope_t; - -/** - * A struct that represents a stack of boolean values. - */ -typedef uint32_t pm_state_stack_t; - -/** - * This struct represents the overall parser. It contains a reference to the - * source file, as well as pointers that indicate where in the source it's - * currently parsing. It also contains the most recent and current token that - * it's considering. - */ -struct pm_parser { - /** - * The next node identifier that will be assigned. This is a unique - * identifier used to track nodes such that the syntax tree can be dropped - * but the node can be found through another parse. - */ - uint32_t node_id; - - /** The current state of the lexer. */ - pm_lex_state_t lex_state; - - /** Tracks the current nesting of (), [], and {}. */ - int enclosure_nesting; - - /** - * Used to temporarily track the nesting of enclosures to determine if a { - * is the beginning of a lambda following the parameters of a lambda. - */ - int lambda_enclosure_nesting; - - /** - * Used to track the nesting of braces to ensure we get the correct value - * when we are interpolating blocks with braces. - */ - int brace_nesting; - - /** - * The stack used to determine if a do keyword belongs to the predicate of a - * while, until, or for loop. - */ - pm_state_stack_t do_loop_stack; - - /** - * The stack used to determine if a do keyword belongs to the beginning of a - * block. - */ - pm_state_stack_t accepts_block_stack; - - /** A stack of lex modes. */ - struct { - /** The current mode of the lexer. */ - pm_lex_mode_t *current; - - /** The stack of lexer modes. */ - pm_lex_mode_t stack[PM_LEX_STACK_SIZE]; - - /** The current index into the lexer mode stack. */ - size_t index; - } lex_modes; - - /** The pointer to the start of the source. */ - const uint8_t *start; - - /** The pointer to the end of the source. */ - const uint8_t *end; - - /** The previous token we were considering. */ - pm_token_t previous; - - /** The current token we're considering. */ - pm_token_t current; - - /** - * This is a special field set on the parser when we need the parser to jump - * to a specific location when lexing the next token, as opposed to just - * using the end of the previous token. Normally this is NULL. - */ - const uint8_t *next_start; - - /** - * This field indicates the end of a heredoc whose identifier was found on - * the current line. If another heredoc is found on the same line, then this - * will be moved forward to the end of that heredoc. If no heredocs are - * found on a line then this is NULL. - */ - const uint8_t *heredoc_end; - - /** The list of comments that have been found while parsing. */ - pm_list_t comment_list; - - /** The list of magic comments that have been found while parsing. */ - pm_list_t magic_comment_list; - - /** - * An optional location that represents the location of the __END__ marker - * and the rest of the content of the file. This content is loaded into the - * DATA constant when the file being parsed is the main file being executed. - */ - pm_location_t data_loc; - - /** The list of warnings that have been found while parsing. */ - pm_list_t warning_list; - - /** The list of errors that have been found while parsing. */ - pm_list_t error_list; - - /** The current local scope. */ - pm_scope_t *current_scope; - - /** The current parsing context. */ - pm_context_node_t *current_context; - - /** - * The hash keys for the hash that is currently being parsed. This is not - * usually necessary because it can pass it down the various call chains, - * but in the event that you're parsing a hash that is being directly - * pushed into another hash with **, we need to share the hash keys so that - * we can warn for the nested hash as well. - */ - pm_static_literals_t *current_hash_keys; - - /** - * The encoding functions for the current file is attached to the parser as - * it's parsing so that it can change with a magic comment. - */ - const pm_encoding_t *encoding; - - /** - * When the encoding that is being used to parse the source is changed by - * prism, we provide the ability here to call out to a user-defined - * function. - */ - pm_encoding_changed_callback_t encoding_changed_callback; - - /** - * This pointer indicates where a comment must start if it is to be - * considered an encoding comment. - */ - const uint8_t *encoding_comment_start; - - /** - * This is an optional callback that can be attached to the parser that will - * be called whenever a new token is lexed by the parser. - */ - pm_lex_callback_t *lex_callback; - - /** - * This is the path of the file being parsed. We use the filepath when - * constructing SourceFileNodes. - */ - pm_string_t filepath; - - /** - * This constant pool keeps all of the constants defined throughout the file - * so that we can reference them later. - */ - pm_constant_pool_t constant_pool; - - /** This is the list of newline offsets in the source file. */ - pm_newline_list_t newline_list; - - /** - * We want to add a flag to integer nodes that indicates their base. We only - * want to parse these once, but we don't have space on the token itself to - * communicate this information. So we store it here and pass it through - * when we find tokens that we need it for. - */ - pm_node_flags_t integer_base; - - /** - * This string is used to pass information from the lexer to the parser. It - * is particularly necessary because of escape sequences. - */ - pm_string_t current_string; - - /** - * The line number at the start of the parse. This will be used to offset - * the line numbers of all of the locations. - */ - int32_t start_line; - - /** - * When a string-like expression is being lexed, any byte or escape sequence - * that resolves to a value whose top bit is set (i.e., >= 0x80) will - * explicitly set the encoding to the same encoding as the source. - * Alternatively, if a unicode escape sequence is used (e.g., \\u{80}) that - * resolves to a value whose top bit is set, then the encoding will be - * explicitly set to UTF-8. - * - * The _next_ time this happens, if the encoding that is about to become the - * explicitly set encoding does not match the previously set explicit - * encoding, a mixed encoding error will be emitted. - * - * When the expression is finished being lexed, the explicit encoding - * controls the encoding of the expression. For the most part this means - * that the expression will either be encoded in the source encoding or - * UTF-8. This holds for all encodings except US-ASCII. If the source is - * US-ASCII and an explicit encoding was set that was _not_ UTF-8, then the - * expression will be encoded as ASCII-8BIT. - * - * Note that if the expression is a list, different elements within the same - * list can have different encodings, so this will get reset between each - * element. Furthermore all of this only applies to lists that support - * interpolation, because otherwise escapes that could change the encoding - * are ignored. - * - * At first glance, it may make more sense for this to live on the lexer - * mode, but we need it here to communicate back to the parser for character - * literals that do not push a new lexer mode. - */ - const pm_encoding_t *explicit_encoding; - - /** - * When parsing block exits (e.g., break, next, redo), we need to validate - * that they are in correct contexts. For the most part we can do this by - * looking at our parent contexts. However, modifier while and until - * expressions can change that context to make block exits valid. In these - * cases, we need to keep track of the block exits and then validate them - * after the expression has been parsed. - * - * We use a pointer here because we don't want to keep a whole list attached - * since this will only be used in the context of begin/end expressions. - */ - pm_node_list_t *current_block_exits; - - /** The version of prism that we should use to parse. */ - pm_options_version_t version; - - /** The command line flags given from the options. */ - uint8_t command_line; - - /** - * Whether or not we have found a frozen_string_literal magic comment with - * a true or false value. - * May be: - * - PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED - * - PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET - */ - int8_t frozen_string_literal; - - /** - * Whether or not we are parsing an eval string. This impacts whether or not - * we should evaluate if block exits/yields are valid. - */ - bool parsing_eval; - - /** - * Whether or not we are parsing a "partial" script, which is a script that - * will be evaluated in the context of another script, so we should not - * check jumps (next/break/etc.) for validity. - */ - bool partial_script; - - /** Whether or not we're at the beginning of a command. */ - bool command_start; - - /** Whether or not we're currently recovering from a syntax error. */ - bool recovering; - - /** - * This is very specialized behavior for when you want to parse in a context - * that does not respect encoding comments. Its main use case is translating - * into the whitequark/parser AST which re-encodes source files in UTF-8 - * before they are parsed and ignores encoding comments. - */ - bool encoding_locked; - - /** - * Whether or not the encoding has been changed by a magic comment. We use - * this to provide a fast path for the lexer instead of going through the - * function pointer. - */ - bool encoding_changed; - - /** - * This flag indicates that we are currently parsing a pattern matching - * expression and impacts that calculation of newlines. - */ - bool pattern_matching_newlines; - - /** This flag indicates that we are currently parsing a keyword argument. */ - bool in_keyword_arg; - - /** - * Whether or not the parser has seen a token that has semantic meaning - * (i.e., a token that is not a comment or whitespace). - */ - bool semantic_token_seen; - - /** - * True if the current regular expression being lexed contains only ASCII - * characters. - */ - bool current_regular_expression_ascii_only; - - /** - * By default, Ruby always warns about mismatched indentation. This can be - * toggled with a magic comment. - */ - bool warn_mismatched_indentation; -}; - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h deleted file mode 100644 index 5a52b2b..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file prettyprint.h - * - * An AST node pretty-printer. - */ -#ifndef PRISM_PRETTYPRINT_H -#define PRISM_PRETTYPRINT_H - -#include "prism/defines.h" - -#ifdef PRISM_EXCLUDE_PRETTYPRINT - -void pm_prettyprint(void); - -#else - -#include - -#include "prism/ast.h" -#include "prism/parser.h" -#include "prism/util/pm_buffer.h" - -/** - * Pretty-prints the AST represented by the given node to the given buffer. - * - * @param output_buffer The buffer to write the pretty-printed AST to. - * @param parser The parser that parsed the AST. - * @param node The root node of the AST to pretty-print. - */ -PRISM_EXPORTED_FUNCTION void pm_prettyprint(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_node_t *node); - -#endif - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h deleted file mode 100644 index 755c38f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h +++ /dev/null @@ -1,336 +0,0 @@ -/** - * @file prism.h - * - * The main header file for the prism parser. - */ -#ifndef PRISM_H -#define PRISM_H - -#include "prism/defines.h" -#include "prism/util/pm_buffer.h" -#include "prism/util/pm_char.h" -#include "prism/util/pm_integer.h" -#include "prism/util/pm_memchr.h" -#include "prism/util/pm_strncasecmp.h" -#include "prism/util/pm_strpbrk.h" -#include "prism/ast.h" -#include "prism/diagnostic.h" -#include "prism/node.h" -#include "prism/options.h" -#include "prism/pack.h" -#include "prism/parser.h" -#include "prism/prettyprint.h" -#include "prism/regexp.h" -#include "prism/static_literals.h" -#include "prism/version.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef _WIN32 -#include -#endif - -/** - * The prism version and the serialization format. - * - * @returns The prism version as a constant string. - */ -PRISM_EXPORTED_FUNCTION const char * pm_version(void); - -/** - * Initialize a parser with the given start and end pointers. - * - * @param parser The parser to initialize. - * @param source The source to parse. - * @param size The size of the source. - * @param options The optional options to use when parsing. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options); - -/** - * Register a callback that will be called whenever prism changes the encoding - * it is using to parse based on the magic comment. - * - * @param parser The parser to register the callback with. - * @param callback The callback to register. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback); - -/** - * Free any memory associated with the given parser. - * - * @param parser The parser to free. - */ -PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); - -/** - * Initiate the parser with the given parser. - * - * @param parser The parser to use. - * @return The AST representing the source. - */ -PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser); - -/** - * This function is used in pm_parse_stream to retrieve a line of input from a - * stream. It closely mirrors that of fgets so that fgets can be used as the - * default implementation. - */ -typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream); - -/** - * Parse a stream of Ruby source and return the tree. - * - * @param parser The parser to use. - * @param buffer The buffer to use. - * @param stream The stream to parse. - * @param fgets The function to use to read from the stream. - * @param options The optional options to use when parsing. - * @return The AST representing the source. - */ -PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const pm_options_t *options); - -// We optionally support serializing to a binary string. For systems that don't -// want or need this functionality, it can be turned off with the -// PRISM_EXCLUDE_SERIALIZATION define. -#ifndef PRISM_EXCLUDE_SERIALIZATION - -/** - * Parse and serialize the AST represented by the source that is read out of the - * given stream into to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param stream The stream to parse. - * @param fgets The function to use to read from the stream. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const char *data); - -/** - * Serialize the given list of comments to the given buffer. - * - * @param parser The parser to serialize. - * @param list The list of comments to serialize. - * @param buffer The buffer to serialize to. - */ -void pm_serialize_comment_list(pm_parser_t *parser, pm_list_t *list, pm_buffer_t *buffer); - -/** - * Serialize the name of the encoding to the buffer. - * - * @param encoding The encoding to serialize. - * @param buffer The buffer to serialize to. - */ -void pm_serialize_encoding(const pm_encoding_t *encoding, pm_buffer_t *buffer); - -/** - * Serialize the encoding, metadata, nodes, and constant pool. - * - * @param parser The parser to serialize. - * @param node The node to serialize. - * @param buffer The buffer to serialize to. - */ -void pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer); - -/** - * Serialize the AST represented by the given node to the given buffer. - * - * @param parser The parser to serialize. - * @param node The node to serialize. - * @param buffer The buffer to serialize to. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer); - -/** - * Parse the given source to the AST and dump the AST to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -/** - * Parse and serialize the comments in the given source to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -/** - * Lex the given source and serialize to the given buffer. - * - * @param source The source to lex. - * @param size The size of the source. - * @param buffer The buffer to serialize to. - * @param data The optional data to pass to the lexer. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -/** - * Parse and serialize both the AST and the tokens represented by the given - * source to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); - -#endif - -/** - * Parse the source and return true if it parses without errors or warnings. - * - * @param source The source to parse. - * @param size The size of the source. - * @param data The optional data to pass to the parser. - * @return True if the source parses without errors or warnings. - */ -PRISM_EXPORTED_FUNCTION bool pm_parse_success_p(const uint8_t *source, size_t size, const char *data); - -/** - * Returns a string representation of the given token type. - * - * @param token_type The token type to convert to a string. - * @return A string representation of the given token type. - */ -PRISM_EXPORTED_FUNCTION const char * pm_token_type_name(pm_token_type_t token_type); - -/** - * Returns the human name of the given token type. - * - * @param token_type The token type to convert to a human name. - * @return The human name of the given token type. - */ -const char * pm_token_type_human(pm_token_type_t token_type); - -// We optionally support dumping to JSON. For systems that don't want or need -// this functionality, it can be turned off with the PRISM_EXCLUDE_JSON define. -#ifndef PRISM_EXCLUDE_JSON - -/** - * Dump JSON to the given buffer. - * - * @param buffer The buffer to serialize to. - * @param parser The parser that parsed the node. - * @param node The node to serialize. - */ -PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node); - -#endif - -/** - * @mainpage - * - * Prism is a parser for the Ruby programming language. It is designed to be - * portable, error tolerant, and maintainable. It is written in C99 and has no - * dependencies. It is currently being integrated into - * [CRuby](https://github.com/ruby/ruby), - * [JRuby](https://github.com/jruby/jruby), - * [TruffleRuby](https://github.com/oracle/truffleruby), - * [Sorbet](https://github.com/sorbet/sorbet), and - * [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree). - * - * @section getting-started Getting started - * - * If you're vendoring this project and compiling it statically then as long as - * you have a C99 compiler you will be fine. If you're linking against it as - * shared library, then you should compile with `-fvisibility=hidden` and - * `-DPRISM_EXPORT_SYMBOLS` to tell prism to make only its public interface - * visible. - * - * @section parsing Parsing - * - * In order to parse Ruby code, the structures and functions that you're going - * to want to use and be aware of are: - * - * * `pm_parser_t` - the main parser structure - * * `pm_parser_init` - initialize a parser - * * `pm_parse` - parse and return the root node - * * `pm_node_destroy` - deallocate the root node returned by `pm_parse` - * * `pm_parser_free` - free the internal memory of the parser - * - * Putting all of this together would look something like: - * - * ```c - * void parse(const uint8_t *source, size_t length) { - * pm_parser_t parser; - * pm_parser_init(&parser, source, length, NULL); - * - * pm_node_t *root = pm_parse(&parser); - * printf("PARSED!\n"); - * - * pm_node_destroy(&parser, root); - * pm_parser_free(&parser); - * } - * ``` - * - * All of the nodes "inherit" from `pm_node_t` by embedding those structures as - * their first member. This means you can downcast and upcast any node in the - * tree to a `pm_node_t`. - * - * @section serializing Serializing - * - * Prism provides the ability to serialize the AST and its related metadata into - * a binary format. This format is designed to be portable to different - * languages and runtimes so that you only need to make one FFI call in order to - * parse Ruby code. The structures and functions that you're going to want to - * use and be aware of are: - * - * * `pm_buffer_t` - a small buffer object that will hold the serialized AST - * * `pm_buffer_free` - free the memory associated with the buffer - * * `pm_serialize` - serialize the AST into a buffer - * * `pm_serialize_parse` - parse and serialize the AST into a buffer - * - * Putting all of this together would look something like: - * - * ```c - * void serialize(const uint8_t *source, size_t length) { - * pm_buffer_t buffer = { 0 }; - * - * pm_serialize_parse(&buffer, source, length, NULL); - * printf("SERIALIZED!\n"); - * - * pm_buffer_free(&buffer); - * } - * ``` - * - * @section inspecting Inspecting - * - * Prism provides the ability to inspect the AST by pretty-printing nodes. You - * can do this with the `pm_prettyprint` function, which you would use like: - * - * ```c - * void prettyprint(const uint8_t *source, size_t length) { - * pm_parser_t parser; - * pm_parser_init(&parser, source, length, NULL); - * - * pm_node_t *root = pm_parse(&parser); - * pm_buffer_t buffer = { 0 }; - * - * pm_prettyprint(&buffer, &parser, root); - * printf("%*.s\n", (int) buffer.length, buffer.value); - * - * pm_buffer_free(&buffer); - * pm_node_destroy(&parser, root); - * pm_parser_free(&parser); - * } - * ``` - */ - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/regexp.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/regexp.h deleted file mode 100644 index c0b3163..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/regexp.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file regexp.h - * - * A regular expression parser. - */ -#ifndef PRISM_REGEXP_H -#define PRISM_REGEXP_H - -#include "prism/defines.h" -#include "prism/parser.h" -#include "prism/encoding.h" -#include "prism/util/pm_memchr.h" -#include "prism/util/pm_string.h" - -#include -#include -#include - -/** - * This callback is called when a named capture group is found. - */ -typedef void (*pm_regexp_name_callback_t)(const pm_string_t *name, void *data); - -/** - * This callback is called when a parse error is found. - */ -typedef void (*pm_regexp_error_callback_t)(const uint8_t *start, const uint8_t *end, const char *message, void *data); - -/** - * Parse a regular expression. - * - * @param parser The parser that is currently being used. - * @param source The source code to parse. - * @param size The size of the source code. - * @param extended_mode Whether to parse the regular expression in extended mode. - * @param name_callback The optional callback to call when a named capture group is found. - * @param name_data The optional data to pass to the name callback. - * @param error_callback The callback to call when a parse error is found. - * @param error_data The data to pass to the error callback. - */ -PRISM_EXPORTED_FUNCTION void pm_regexp_parse(pm_parser_t *parser, const uint8_t *source, size_t size, bool extended_mode, pm_regexp_name_callback_t name_callback, void *name_data, pm_regexp_error_callback_t error_callback, void *error_data); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/static_literals.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/static_literals.h deleted file mode 100644 index bd29761..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/static_literals.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @file static_literals.h - * - * A set of static literal nodes that can be checked for duplicates. - */ -#ifndef PRISM_STATIC_LITERALS_H -#define PRISM_STATIC_LITERALS_H - -#include "prism/defines.h" -#include "prism/ast.h" -#include "prism/util/pm_newline_list.h" - -#include -#include - -/** - * An internal hash table for a set of nodes. - */ -typedef struct { - /** The array of nodes in the hash table. */ - pm_node_t **nodes; - - /** The size of the hash table. */ - uint32_t size; - - /** The space that has been allocated in the hash table. */ - uint32_t capacity; -} pm_node_hash_t; - -/** - * Certain sets of nodes (hash keys and when clauses) check for duplicate nodes - * to alert the user of potential issues. To do this, we keep a set of the nodes - * that have been seen so far, and compare whenever we find a new node. - * - * We bucket the nodes based on their type to minimize the number of comparisons - * that need to be performed. - */ -typedef struct { - /** - * This is the set of IntegerNode and SourceLineNode instances. - */ - pm_node_hash_t integer_nodes; - - /** - * This is the set of FloatNode instances. - */ - pm_node_hash_t float_nodes; - - /** - * This is the set of RationalNode and ImaginaryNode instances. - */ - pm_node_hash_t number_nodes; - - /** - * This is the set of StringNode and SourceFileNode instances. - */ - pm_node_hash_t string_nodes; - - /** - * This is the set of RegularExpressionNode instances. - */ - pm_node_hash_t regexp_nodes; - - /** - * This is the set of SymbolNode instances. - */ - pm_node_hash_t symbol_nodes; - - /** - * A pointer to the last TrueNode instance that was inserted, or NULL. - */ - pm_node_t *true_node; - - /** - * A pointer to the last FalseNode instance that was inserted, or NULL. - */ - pm_node_t *false_node; - - /** - * A pointer to the last NilNode instance that was inserted, or NULL. - */ - pm_node_t *nil_node; - - /** - * A pointer to the last SourceEncodingNode instance that was inserted, or - * NULL. - */ - pm_node_t *source_encoding_node; -} pm_static_literals_t; - -/** - * Add a node to the set of static literals. - * - * @param newline_list The list of newline offsets to use to calculate lines. - * @param start_line The line number that the parser starts on. - * @param literals The set of static literals to add the node to. - * @param node The node to add to the set. - * @param replace Whether to replace the previous node if one already exists. - * @return A pointer to the node that is being overwritten, if there is one. - */ -pm_node_t * pm_static_literals_add(const pm_newline_list_t *newline_list, int32_t start_line, pm_static_literals_t *literals, pm_node_t *node, bool replace); - -/** - * Free the internal memory associated with the given static literals set. - * - * @param literals The set of static literals to free. - */ -void pm_static_literals_free(pm_static_literals_t *literals); - -/** - * Create a string-based representation of the given static literal. - * - * @param buffer The buffer to write the string to. - * @param newline_list The list of newline offsets to use to calculate lines. - * @param start_line The line number that the parser starts on. - * @param encoding_name The name of the encoding of the source being parsed. - * @param node The node to create a string representation of. - */ -void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_newline_list_t *newline_list, int32_t start_line, const char *encoding_name, const pm_node_t *node); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h deleted file mode 100644 index 58f7b50..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h +++ /dev/null @@ -1,218 +0,0 @@ -/** - * @file pm_buffer.h - * - * A wrapper around a contiguous block of allocated memory. - */ -#ifndef PRISM_BUFFER_H -#define PRISM_BUFFER_H - -#include "prism/defines.h" -#include "prism/util/pm_char.h" - -#include -#include -#include -#include -#include - -/** - * A pm_buffer_t is a simple memory buffer that stores data in a contiguous - * block of memory. - */ -typedef struct { - /** The length of the buffer in bytes. */ - size_t length; - - /** The capacity of the buffer in bytes that has been allocated. */ - size_t capacity; - - /** A pointer to the start of the buffer. */ - char *value; -} pm_buffer_t; - -/** - * Return the size of the pm_buffer_t struct. - * - * @returns The size of the pm_buffer_t struct. - */ -PRISM_EXPORTED_FUNCTION size_t pm_buffer_sizeof(void); - -/** - * Initialize a pm_buffer_t with the given capacity. - * - * @param buffer The buffer to initialize. - * @param capacity The capacity of the buffer. - * @returns True if the buffer was initialized successfully, false otherwise. - */ -bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity); - -/** - * Initialize a pm_buffer_t with its default values. - * - * @param buffer The buffer to initialize. - * @returns True if the buffer was initialized successfully, false otherwise. - */ -PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer); - -/** - * Return the value of the buffer. - * - * @param buffer The buffer to get the value of. - * @returns The value of the buffer. - */ -PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer); - -/** - * Return the length of the buffer. - * - * @param buffer The buffer to get the length of. - * @returns The length of the buffer. - */ -PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer); - -/** - * Append the given amount of space as zeroes to the buffer. - * - * @param buffer The buffer to append to. - * @param length The amount of space to append and zero. - */ -void pm_buffer_append_zeroes(pm_buffer_t *buffer, size_t length); - -/** - * Append a formatted string to the buffer. - * - * @param buffer The buffer to append to. - * @param format The format string to append. - * @param ... The arguments to the format string. - */ -void pm_buffer_append_format(pm_buffer_t *buffer, const char *format, ...) PRISM_ATTRIBUTE_FORMAT(2, 3); - -/** - * Append a string to the buffer. - * - * @param buffer The buffer to append to. - * @param value The string to append. - * @param length The length of the string to append. - */ -void pm_buffer_append_string(pm_buffer_t *buffer, const char *value, size_t length); - -/** - * Append a list of bytes to the buffer. - * - * @param buffer The buffer to append to. - * @param value The bytes to append. - * @param length The length of the bytes to append. - */ -void pm_buffer_append_bytes(pm_buffer_t *buffer, const uint8_t *value, size_t length); - -/** - * Append a single byte to the buffer. - * - * @param buffer The buffer to append to. - * @param value The byte to append. - */ -void pm_buffer_append_byte(pm_buffer_t *buffer, uint8_t value); - -/** - * Append a 32-bit unsigned integer to the buffer as a variable-length integer. - * - * @param buffer The buffer to append to. - * @param value The integer to append. - */ -void pm_buffer_append_varuint(pm_buffer_t *buffer, uint32_t value); - -/** - * Append a 32-bit signed integer to the buffer as a variable-length integer. - * - * @param buffer The buffer to append to. - * @param value The integer to append. - */ -void pm_buffer_append_varsint(pm_buffer_t *buffer, int32_t value); - -/** - * Append a double to the buffer. - * - * @param buffer The buffer to append to. - * @param value The double to append. - */ -void pm_buffer_append_double(pm_buffer_t *buffer, double value); - -/** - * The different types of escaping that can be performed by the buffer when - * appending a slice of Ruby source code. - */ -typedef enum { - PM_BUFFER_ESCAPING_RUBY, - PM_BUFFER_ESCAPING_JSON -} pm_buffer_escaping_t; - -/** - * Append a slice of source code to the buffer. - * - * @param buffer The buffer to append to. - * @param source The source code to append. - * @param length The length of the source code to append. - * @param escaping The type of escaping to perform. - */ -void pm_buffer_append_source(pm_buffer_t *buffer, const uint8_t *source, size_t length, pm_buffer_escaping_t escaping); - -/** - * Prepend the given string to the buffer. - * - * @param buffer The buffer to prepend to. - * @param value The string to prepend. - * @param length The length of the string to prepend. - */ -void pm_buffer_prepend_string(pm_buffer_t *buffer, const char *value, size_t length); - -/** - * Concatenate one buffer onto another. - * - * @param destination The buffer to concatenate onto. - * @param source The buffer to concatenate. - */ -void pm_buffer_concat(pm_buffer_t *destination, const pm_buffer_t *source); - -/** - * Clear the buffer by reducing its size to 0. This does not free the allocated - * memory, but it does allow the buffer to be reused. - * - * @param buffer The buffer to clear. - */ -void pm_buffer_clear(pm_buffer_t *buffer); - -/** - * Strip the whitespace from the end of the buffer. - * - * @param buffer The buffer to strip. - */ -void pm_buffer_rstrip(pm_buffer_t *buffer); - -/** - * Checks if the buffer includes the given value. - * - * @param buffer The buffer to check. - * @param value The value to check for. - * @returns The index of the first occurrence of the value in the buffer, or - * SIZE_MAX if the value is not found. - */ -size_t pm_buffer_index(const pm_buffer_t *buffer, char value); - -/** - * Insert the given string into the buffer at the given index. - * - * @param buffer The buffer to insert into. - * @param index The index to insert at. - * @param value The string to insert. - * @param length The length of the string to insert. - */ -void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size_t length); - -/** - * Free the memory associated with the buffer. - * - * @param buffer The buffer to free. - */ -PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_char.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_char.h deleted file mode 100644 index deeafd6..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_char.h +++ /dev/null @@ -1,204 +0,0 @@ -/** - * @file pm_char.h - * - * Functions for working with characters and strings. - */ -#ifndef PRISM_CHAR_H -#define PRISM_CHAR_H - -#include "prism/defines.h" -#include "prism/util/pm_newline_list.h" - -#include -#include - -/** - * Returns the number of characters at the start of the string that are - * whitespace. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are - * whitespace. - */ -size_t pm_strspn_whitespace(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are - * whitespace while also tracking the location of each newline. Disallows - * searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param newline_list The list of newlines to populate. - * @return The number of characters at the start of the string that are - * whitespace. - */ -size_t pm_strspn_whitespace_newlines(const uint8_t *string, ptrdiff_t length, pm_newline_list_t *newline_list); - -/** - * Returns the number of characters at the start of the string that are inline - * whitespace. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are inline - * whitespace. - */ -size_t pm_strspn_inline_whitespace(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are decimal - * digits. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are decimal - * digits. - */ -size_t pm_strspn_decimal_digit(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are - * hexadecimal digits. Disallows searching past the given maximum number of - * characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are - * hexadecimal digits. - */ -size_t pm_strspn_hexadecimal_digit(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are octal - * digits or underscores. Disallows searching past the given maximum number of - * characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are octal - * digits or underscores. - */ -size_t pm_strspn_octal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns the number of characters at the start of the string that are decimal - * digits or underscores. Disallows searching past the given maximum number of - * characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are decimal - * digits or underscores. - */ -size_t pm_strspn_decimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns the number of characters at the start of the string that are - * hexadecimal digits or underscores. Disallows searching past the given maximum - * number of characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are - * hexadecimal digits or underscores. - */ -size_t pm_strspn_hexadecimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns the number of characters at the start of the string that are regexp - * options. Disallows searching past the given maximum number of characters. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @return The number of characters at the start of the string that are regexp - * options. - */ -size_t pm_strspn_regexp_option(const uint8_t *string, ptrdiff_t length); - -/** - * Returns the number of characters at the start of the string that are binary - * digits or underscores. Disallows searching past the given maximum number of - * characters. - * - * If multiple underscores are found in a row or if an underscore is - * found at the end of the number, then the invalid pointer is set to the index - * of the first invalid underscore. - * - * @param string The string to search. - * @param length The maximum number of characters to search. - * @param invalid The pointer to set to the index of the first invalid - * underscore. - * @return The number of characters at the start of the string that are binary - * digits or underscores. - */ -size_t pm_strspn_binary_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid); - -/** - * Returns true if the given character is a whitespace character. - * - * @param b The character to check. - * @return True if the given character is a whitespace character. - */ -bool pm_char_is_whitespace(const uint8_t b); - -/** - * Returns true if the given character is an inline whitespace character. - * - * @param b The character to check. - * @return True if the given character is an inline whitespace character. - */ -bool pm_char_is_inline_whitespace(const uint8_t b); - -/** - * Returns true if the given character is a binary digit. - * - * @param b The character to check. - * @return True if the given character is a binary digit. - */ -bool pm_char_is_binary_digit(const uint8_t b); - -/** - * Returns true if the given character is an octal digit. - * - * @param b The character to check. - * @return True if the given character is an octal digit. - */ -bool pm_char_is_octal_digit(const uint8_t b); - -/** - * Returns true if the given character is a decimal digit. - * - * @param b The character to check. - * @return True if the given character is a decimal digit. - */ -bool pm_char_is_decimal_digit(const uint8_t b); - -/** - * Returns true if the given character is a hexadecimal digit. - * - * @param b The character to check. - * @return True if the given character is a hexadecimal digit. - */ -bool pm_char_is_hexadecimal_digit(const uint8_t b); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_constant_pool.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_constant_pool.h deleted file mode 100644 index 6df23f8..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_constant_pool.h +++ /dev/null @@ -1,218 +0,0 @@ -/** - * @file pm_constant_pool.h - * - * A data structure that stores a set of strings. - * - * Each string is assigned a unique id, which can be used to compare strings for - * equality. This comparison ends up being much faster than strcmp, since it - * only requires a single integer comparison. - */ -#ifndef PRISM_CONSTANT_POOL_H -#define PRISM_CONSTANT_POOL_H - -#include "prism/defines.h" - -#include -#include -#include -#include -#include - -/** - * When we allocate constants into the pool, we reserve 0 to mean that the slot - * is not yet filled. This constant is reused in other places to indicate the - * lack of a constant id. - */ -#define PM_CONSTANT_ID_UNSET 0 - -/** - * A constant id is a unique identifier for a constant in the constant pool. - */ -typedef uint32_t pm_constant_id_t; - -/** - * A list of constant IDs. Usually used to represent a set of locals. - */ -typedef struct { - /** The number of constant ids in the list. */ - size_t size; - - /** The number of constant ids that have been allocated in the list. */ - size_t capacity; - - /** The constant ids in the list. */ - pm_constant_id_t *ids; -} pm_constant_id_list_t; - -/** - * Initialize a list of constant ids. - * - * @param list The list to initialize. - */ -void pm_constant_id_list_init(pm_constant_id_list_t *list); - -/** - * Initialize a list of constant ids with a given capacity. - * - * @param list The list to initialize. - * @param capacity The initial capacity of the list. - */ -void pm_constant_id_list_init_capacity(pm_constant_id_list_t *list, size_t capacity); - -/** - * Append a constant id to a list of constant ids. Returns false if any - * potential reallocations fail. - * - * @param list The list to append to. - * @param id The id to append. - * @return Whether the append succeeded. - */ -bool pm_constant_id_list_append(pm_constant_id_list_t *list, pm_constant_id_t id); - -/** - * Insert a constant id into a list of constant ids at the specified index. - * - * @param list The list to insert into. - * @param index The index at which to insert. - * @param id The id to insert. - */ -void pm_constant_id_list_insert(pm_constant_id_list_t *list, size_t index, pm_constant_id_t id); - -/** - * Checks if the current constant id list includes the given constant id. - * - * @param list The list to check. - * @param id The id to check for. - * @return Whether the list includes the given id. - */ -bool pm_constant_id_list_includes(pm_constant_id_list_t *list, pm_constant_id_t id); - -/** - * Free the memory associated with a list of constant ids. - * - * @param list The list to free. - */ -void pm_constant_id_list_free(pm_constant_id_list_t *list); - -/** - * The type of bucket in the constant pool hash map. This determines how the - * bucket should be freed. - */ -typedef unsigned int pm_constant_pool_bucket_type_t; - -/** By default, each constant is a slice of the source. */ -static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_DEFAULT = 0; - -/** An owned constant is one for which memory has been allocated. */ -static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_OWNED = 1; - -/** A constant constant is known at compile time. */ -static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_CONSTANT = 2; - -/** A bucket in the hash map. */ -typedef struct { - /** The incremental ID used for indexing back into the pool. */ - unsigned int id: 30; - - /** The type of the bucket, which determines how to free it. */ - pm_constant_pool_bucket_type_t type: 2; - - /** The hash of the bucket. */ - uint32_t hash; -} pm_constant_pool_bucket_t; - -/** A constant in the pool which effectively stores a string. */ -typedef struct { - /** A pointer to the start of the string. */ - const uint8_t *start; - - /** The length of the string. */ - size_t length; -} pm_constant_t; - -/** The overall constant pool, which stores constants found while parsing. */ -typedef struct { - /** The buckets in the hash map. */ - pm_constant_pool_bucket_t *buckets; - - /** The constants that are stored in the buckets. */ - pm_constant_t *constants; - - /** The number of buckets in the hash map. */ - uint32_t size; - - /** The number of buckets that have been allocated in the hash map. */ - uint32_t capacity; -} pm_constant_pool_t; - -/** - * Initialize a new constant pool with a given capacity. - * - * @param pool The pool to initialize. - * @param capacity The initial capacity of the pool. - * @return Whether the initialization succeeded. - */ -bool pm_constant_pool_init(pm_constant_pool_t *pool, uint32_t capacity); - -/** - * Return a pointer to the constant indicated by the given constant id. - * - * @param pool The pool to get the constant from. - * @param constant_id The id of the constant to get. - * @return A pointer to the constant. - */ -pm_constant_t * pm_constant_pool_id_to_constant(const pm_constant_pool_t *pool, pm_constant_id_t constant_id); - -/** - * Find a constant in a constant pool. Returns the id of the constant, or 0 if - * the constant is not found. - * - * @param pool The pool to find the constant in. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_find(const pm_constant_pool_t *pool, const uint8_t *start, size_t length); - -/** - * Insert a constant into a constant pool that is a slice of a source string. - * Returns the id of the constant, or 0 if any potential calls to resize fail. - * - * @param pool The pool to insert the constant into. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_insert_shared(pm_constant_pool_t *pool, const uint8_t *start, size_t length); - -/** - * Insert a constant into a constant pool from memory that is now owned by the - * constant pool. Returns the id of the constant, or 0 if any potential calls to - * resize fail. - * - * @param pool The pool to insert the constant into. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_insert_owned(pm_constant_pool_t *pool, uint8_t *start, size_t length); - -/** - * Insert a constant into a constant pool from memory that is constant. Returns - * the id of the constant, or 0 if any potential calls to resize fail. - * - * @param pool The pool to insert the constant into. - * @param start A pointer to the start of the constant. - * @param length The length of the constant. - * @return The id of the constant. - */ -pm_constant_id_t pm_constant_pool_insert_constant(pm_constant_pool_t *pool, const uint8_t *start, size_t length); - -/** - * Free the memory associated with a constant pool. - * - * @param pool The pool to free. - */ -void pm_constant_pool_free(pm_constant_pool_t *pool); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_integer.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_integer.h deleted file mode 100644 index a9e2966..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_integer.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @file pm_integer.h - * - * This module provides functions for working with arbitrary-sized integers. - */ -#ifndef PRISM_NUMBER_H -#define PRISM_NUMBER_H - -#include "prism/defines.h" -#include "prism/util/pm_buffer.h" - -#include -#include -#include -#include - -/** - * A structure represents an arbitrary-sized integer. - */ -typedef struct { - /** - * The number of allocated values. length is set to 0 if the integer fits - * into uint32_t. - */ - size_t length; - - /** - * List of 32-bit integers. Set to NULL if the integer fits into uint32_t. - */ - uint32_t *values; - - /** - * Embedded value for small integer. This value is set to 0 if the value - * does not fit into uint32_t. - */ - uint32_t value; - - /** - * Whether or not the integer is negative. It is stored this way so that a - * zeroed pm_integer_t is always positive zero. - */ - bool negative; -} pm_integer_t; - -/** - * An enum controlling the base of an integer. It is expected that the base is - * already known before parsing the integer, even though it could be derived - * from the string itself. - */ -typedef enum { - /** The default decimal base, with no prefix. Leading 0s will be ignored. */ - PM_INTEGER_BASE_DEFAULT, - - /** The binary base, indicated by a 0b or 0B prefix. */ - PM_INTEGER_BASE_BINARY, - - /** The octal base, indicated by a 0, 0o, or 0O prefix. */ - PM_INTEGER_BASE_OCTAL, - - /** The decimal base, indicated by a 0d, 0D, or empty prefix. */ - PM_INTEGER_BASE_DECIMAL, - - /** The hexadecimal base, indicated by a 0x or 0X prefix. */ - PM_INTEGER_BASE_HEXADECIMAL, - - /** - * An unknown base, in which case pm_integer_parse will derive it based on - * the content of the string. This is less efficient and does more - * comparisons, so if callers know the base ahead of time, they should use - * that instead. - */ - PM_INTEGER_BASE_UNKNOWN -} pm_integer_base_t; - -/** - * Parse an integer from a string. This assumes that the format of the integer - * has already been validated, as internal validation checks are not performed - * here. - * - * @param integer The integer to parse into. - * @param base The base of the integer. - * @param start The start of the string. - * @param end The end of the string. - */ -void pm_integer_parse(pm_integer_t *integer, pm_integer_base_t base, const uint8_t *start, const uint8_t *end); - -/** - * Compare two integers. This function returns -1 if the left integer is less - * than the right integer, 0 if they are equal, and 1 if the left integer is - * greater than the right integer. - * - * @param left The left integer to compare. - * @param right The right integer to compare. - * @return The result of the comparison. - */ -int pm_integer_compare(const pm_integer_t *left, const pm_integer_t *right); - -/** - * Reduce a ratio of integers to its simplest form. - * - * If either the numerator or denominator do not fit into a 32-bit integer, then - * this function is a no-op. In the future, we may consider reducing even the - * larger numbers, but for now we're going to keep it simple. - * - * @param numerator The numerator of the ratio. - * @param denominator The denominator of the ratio. - */ -void pm_integers_reduce(pm_integer_t *numerator, pm_integer_t *denominator); - -/** - * Convert an integer to a decimal string. - * - * @param buffer The buffer to append the string to. - * @param integer The integer to convert to a string. - */ -PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer); - -/** - * Free the internal memory of an integer. This memory will only be allocated if - * the integer exceeds the size of a single node in the linked list. - * - * @param integer The integer to free. - */ -PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h deleted file mode 100644 index 3512dee..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file pm_list.h - * - * An abstract linked list. - */ -#ifndef PRISM_LIST_H -#define PRISM_LIST_H - -#include "prism/defines.h" - -#include -#include -#include -#include - -/** - * This struct represents an abstract linked list that provides common - * functionality. It is meant to be used any time a linked list is necessary to - * store data. - * - * The linked list itself operates off a set of pointers. Because the pointers - * are not necessarily sequential, they can be of any size. We use this fact to - * allow the consumer of this linked list to extend the node struct to include - * any data they want. This is done by using the pm_list_node_t as the first - * member of the struct. - * - * For example, if we want to store a list of integers, we can do the following: - * - * ```c - * typedef struct { - * pm_list_node_t node; - * int value; - * } pm_int_node_t; - * - * pm_list_t list = { 0 }; - * pm_int_node_t *node = xmalloc(sizeof(pm_int_node_t)); - * node->value = 5; - * - * pm_list_append(&list, &node->node); - * ``` - * - * The pm_list_t struct is used to represent the overall linked list. It - * contains a pointer to the head and tail of the list. This allows for easy - * iteration and appending of new nodes. - */ -typedef struct pm_list_node { - /** A pointer to the next node in the list. */ - struct pm_list_node *next; -} pm_list_node_t; - -/** - * This represents the overall linked list. It keeps a pointer to the head and - * tail so that iteration is easy and pushing new nodes is easy. - */ -typedef struct { - /** The size of the list. */ - size_t size; - - /** A pointer to the head of the list. */ - pm_list_node_t *head; - - /** A pointer to the tail of the list. */ - pm_list_node_t *tail; -} pm_list_t; - -/** - * Returns true if the given list is empty. - * - * @param list The list to check. - * @return True if the given list is empty, otherwise false. - */ -PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list); - -/** - * Returns the size of the list. - * - * @param list The list to check. - * @return The size of the list. - */ -PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list); - -/** - * Append a node to the given list. - * - * @param list The list to append to. - * @param node The node to append. - */ -void pm_list_append(pm_list_t *list, pm_list_node_t *node); - -/** - * Deallocate the internal state of the given list. - * - * @param list The list to free. - */ -PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h deleted file mode 100644 index e0671ea..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file pm_memchr.h - * - * A custom memchr implementation. - */ -#ifndef PRISM_MEMCHR_H -#define PRISM_MEMCHR_H - -#include "prism/defines.h" -#include "prism/encoding.h" - -#include - -/** - * We need to roll our own memchr to handle cases where the encoding changes and - * we need to search for a character in a buffer that could be the trailing byte - * of a multibyte character. - * - * @param source The source string. - * @param character The character to search for. - * @param number The maximum number of bytes to search. - * @param encoding_changed Whether the encoding changed. - * @param encoding A pointer to the encoding. - * @return A pointer to the first occurrence of the character in the source - * string, or NULL if no such character exists. - */ -void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_newline_list.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_newline_list.h deleted file mode 100644 index 406abe8..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_newline_list.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @file pm_newline_list.h - * - * A list of byte offsets of newlines in a string. - * - * When compiling the syntax tree, it's necessary to know the line and column - * of many nodes. This is necessary to support things like error messages, - * tracepoints, etc. - * - * It's possible that we could store the start line, start column, end line, and - * end column on every node in addition to the offsets that we already store, - * but that would be quite a lot of memory overhead. - */ -#ifndef PRISM_NEWLINE_LIST_H -#define PRISM_NEWLINE_LIST_H - -#include "prism/defines.h" - -#include -#include -#include -#include - -/** - * A list of offsets of newlines in a string. The offsets are assumed to be - * sorted/inserted in ascending order. - */ -typedef struct { - /** A pointer to the start of the source string. */ - const uint8_t *start; - - /** The number of offsets in the list. */ - size_t size; - - /** The capacity of the list that has been allocated. */ - size_t capacity; - - /** The list of offsets. */ - size_t *offsets; -} pm_newline_list_t; - -/** - * A line and column in a string. - */ -typedef struct { - /** The line number. */ - int32_t line; - - /** The column number. */ - uint32_t column; -} pm_line_column_t; - -/** - * Initialize a new newline list with the given capacity. Returns true if the - * allocation of the offsets succeeds, otherwise returns false. - * - * @param list The list to initialize. - * @param start A pointer to the start of the source string. - * @param capacity The initial capacity of the list. - * @return True if the allocation of the offsets succeeds, otherwise false. - */ -bool pm_newline_list_init(pm_newline_list_t *list, const uint8_t *start, size_t capacity); - -/** - * Clear out the newlines that have been appended to the list. - * - * @param list The list to clear. - */ -void -pm_newline_list_clear(pm_newline_list_t *list); - -/** - * Append a new offset to the newline list. Returns true if the reallocation of - * the offsets succeeds (if one was necessary), otherwise returns false. - * - * @param list The list to append to. - * @param cursor A pointer to the offset to append. - * @return True if the reallocation of the offsets succeeds (if one was - * necessary), otherwise false. - */ -bool pm_newline_list_append(pm_newline_list_t *list, const uint8_t *cursor); - -/** - * Returns the line of the given offset. If the offset is not in the list, the - * line of the closest offset less than the given offset is returned. - * - * @param list The list to search. - * @param cursor A pointer to the offset to search for. - * @param start_line The line to start counting from. - * @return The line of the given offset. - */ -int32_t pm_newline_list_line(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line); - -/** - * Returns the line and column of the given offset. If the offset is not in the - * list, the line and column of the closest offset less than the given offset - * are returned. - * - * @param list The list to search. - * @param cursor A pointer to the offset to search for. - * @param start_line The line to start counting from. - * @return The line and column of the given offset. - */ -pm_line_column_t pm_newline_list_line_column(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line); - -/** - * Free the internal memory allocated for the newline list. - * - * @param list The list to free. - */ -void pm_newline_list_free(pm_newline_list_t *list); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_string.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_string.h deleted file mode 100644 index f99f1ab..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_string.h +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @file pm_string.h - * - * A generic string type that can have various ownership semantics. - */ -#ifndef PRISM_STRING_H -#define PRISM_STRING_H - -#include "prism/defines.h" - -#include -#include -#include -#include -#include -#include - -// The following headers are necessary to read files using demand paging. -#ifdef _WIN32 -#include -#elif defined(_POSIX_MAPPED_FILES) -#include -#include -#include -#elif defined(PRISM_HAS_FILESYSTEM) -#include -#include -#endif - -/** - * A generic string type that can have various ownership semantics. - */ -typedef struct { - /** A pointer to the start of the string. */ - const uint8_t *source; - - /** The length of the string in bytes of memory. */ - size_t length; - - /** The type of the string. This field determines how the string should be freed. */ - enum { - /** This string is a constant string, and should not be freed. */ - PM_STRING_CONSTANT, - - /** This is a slice of another string, and should not be freed. */ - PM_STRING_SHARED, - - /** This string owns its memory, and should be freed using `pm_string_free`. */ - PM_STRING_OWNED, - -#ifdef PRISM_HAS_MMAP - /** This string is a memory-mapped file, and should be freed using `pm_string_free`. */ - PM_STRING_MAPPED -#endif - } type; -} pm_string_t; - -/** - * Returns the size of the pm_string_t struct. This is necessary to allocate the - * correct amount of memory in the FFI backend. - * - * @return The size of the pm_string_t struct. - */ -PRISM_EXPORTED_FUNCTION size_t pm_string_sizeof(void); - -/** - * Defines an empty string. This is useful for initializing a string that will - * be filled in later. - */ -#define PM_STRING_EMPTY ((pm_string_t) { .type = PM_STRING_CONSTANT, .source = NULL, .length = 0 }) - -/** - * Initialize a shared string that is based on initial input. - * - * @param string The string to initialize. - * @param start The start of the string. - * @param end The end of the string. - */ -void pm_string_shared_init(pm_string_t *string, const uint8_t *start, const uint8_t *end); - -/** - * Initialize an owned string that is responsible for freeing allocated memory. - * - * @param string The string to initialize. - * @param source The source of the string. - * @param length The length of the string. - */ -void pm_string_owned_init(pm_string_t *string, uint8_t *source, size_t length); - -/** - * Initialize a constant string that doesn't own its memory source. - * - * @param string The string to initialize. - * @param source The source of the string. - * @param length The length of the string. - */ -void pm_string_constant_init(pm_string_t *string, const char *source, size_t length); - -/** - * Represents the result of calling pm_string_mapped_init or - * pm_string_file_init. We need this additional information because there is - * not a platform-agnostic way to indicate that the file that was attempted to - * be opened was a directory. - */ -typedef enum { - /** Indicates that the string was successfully initialized. */ - PM_STRING_INIT_SUCCESS = 0, - /** - * Indicates a generic error from a string_*_init function, where the type - * of error should be read from `errno` or `GetLastError()`. - */ - PM_STRING_INIT_ERROR_GENERIC = 1, - /** - * Indicates that the file that was attempted to be opened was a directory. - */ - PM_STRING_INIT_ERROR_DIRECTORY = 2 -} pm_string_init_result_t; - -/** - * Read the file indicated by the filepath parameter into source and load its - * contents and size into the given `pm_string_t`. The given `pm_string_t` - * should be freed using `pm_string_free` when it is no longer used. - * - * We want to use demand paging as much as possible in order to avoid having to - * read the entire file into memory (which could be detrimental to performance - * for large files). This means that if we're on windows we'll use - * `MapViewOfFile`, on POSIX systems that have access to `mmap` we'll use - * `mmap`, and on other POSIX systems we'll use `read`. - * - * @param string The string to initialize. - * @param filepath The filepath to read. - * @return The success of the read, indicated by the value of the enum. - */ -PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_mapped_init(pm_string_t *string, const char *filepath); - -/** - * Read the file indicated by the filepath parameter into source and load its - * contents and size into the given `pm_string_t`. The given `pm_string_t` - * should be freed using `pm_string_free` when it is no longer used. - * - * @param string The string to initialize. - * @param filepath The filepath to read. - * @return The success of the read, indicated by the value of the enum. - */ -PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_file_init(pm_string_t *string, const char *filepath); - -/** - * Ensure the string is owned. If it is not, then reinitialize it as owned and - * copy over the previous source. - * - * @param string The string to ensure is owned. - */ -void pm_string_ensure_owned(pm_string_t *string); - -/** - * Compare the underlying lengths and bytes of two strings. Returns 0 if the - * strings are equal, a negative number if the left string is less than the - * right string, and a positive number if the left string is greater than the - * right string. - * - * @param left The left string to compare. - * @param right The right string to compare. - * @return The comparison result. - */ -int pm_string_compare(const pm_string_t *left, const pm_string_t *right); - -/** - * Returns the length associated with the string. - * - * @param string The string to get the length of. - * @return The length of the string. - */ -PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string); - -/** - * Returns the start pointer associated with the string. - * - * @param string The string to get the start pointer of. - * @return The start pointer of the string. - */ -PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *string); - -/** - * Free the associated memory of the given string. - * - * @param string The string to free. - */ -PRISM_EXPORTED_FUNCTION void pm_string_free(pm_string_t *string); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h deleted file mode 100644 index 5cb88cb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file pm_strncasecmp.h - * - * A custom strncasecmp implementation. - */ -#ifndef PRISM_STRNCASECMP_H -#define PRISM_STRNCASECMP_H - -#include "prism/defines.h" - -#include -#include -#include - -/** - * Compare two strings, ignoring case, up to the given length. Returns 0 if the - * strings are equal, a negative number if string1 is less than string2, or a - * positive number if string1 is greater than string2. - * - * Note that this is effectively our own implementation of strncasecmp, but it's - * not available on all of the platforms we want to support so we're rolling it - * here. - * - * @param string1 The first string to compare. - * @param string2 The second string to compare - * @param length The maximum number of characters to compare. - * @return 0 if the strings are equal, a negative number if string1 is less than - * string2, or a positive number if string1 is greater than string2. - */ -int pm_strncasecmp(const uint8_t *string1, const uint8_t *string2, size_t length); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h deleted file mode 100644 index f387bd5..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file pm_strpbrk.h - * - * A custom strpbrk implementation. - */ -#ifndef PRISM_STRPBRK_H -#define PRISM_STRPBRK_H - -#include "prism/defines.h" -#include "prism/diagnostic.h" -#include "prism/parser.h" - -#include -#include - -/** - * Here we have rolled our own version of strpbrk. The standard library strpbrk - * has undefined behavior when the source string is not null-terminated. We want - * to support strings that are not null-terminated because pm_parse does not - * have the contract that the string is null-terminated. (This is desirable - * because it means the extension can call pm_parse with the result of a call to - * mmap). - * - * The standard library strpbrk also does not support passing a maximum length - * to search. We want to support this for the reason mentioned above, but we - * also don't want it to stop on null bytes. Ruby actually allows null bytes - * within strings, comments, regular expressions, etc. So we need to be able to - * skip past them. - * - * Finally, we want to support encodings wherein the charset could contain - * characters that are trailing bytes of multi-byte characters. For example, in - * Shift-JIS, the backslash character can be a trailing byte. In that case we - * need to take a slower path and iterate one multi-byte character at a time. - * - * @param parser The parser. - * @param source The source to search. - * @param charset The charset to search for. - * @param length The maximum number of bytes to search. - * @param validate Whether to validate that the source string is valid in the - * current encoding of the parser. - * @return A pointer to the first character in the source string that is in the - * charset, or NULL if no such character exists. - */ -const uint8_t * pm_strpbrk(pm_parser_t *parser, const uint8_t *source, const uint8_t *charset, ptrdiff_t length, bool validate); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/version.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/version.h deleted file mode 100644 index 3cca648..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/version.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file version.h - * - * The version of the Prism library. - */ -#ifndef PRISM_VERSION_H -#define PRISM_VERSION_H - -/** - * The major version of the Prism library as an int. - */ -#define PRISM_VERSION_MAJOR 1 - -/** - * The minor version of the Prism library as an int. - */ -#define PRISM_VERSION_MINOR 0 - -/** - * The patch version of the Prism library as an int. - */ -#define PRISM_VERSION_PATCH 0 - -/** - * The version of the Prism library as a constant string. - */ -#define PRISM_VERSION "1.0.0" - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h deleted file mode 100644 index 4015091..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h +++ /dev/null @@ -1,99 +0,0 @@ -#include "prism/prism.h" -#include "ruby/encoding.h" - -/** - * the getlocal and setlocal instructions require two parameters. level is how - * many hops up the iseq stack one needs to go before finding the correct local - * table. The index is the index in that table where our variable is. - * - * Because these are always calculated and used together, we'll bind them - * together as a tuple. - */ -typedef struct pm_local_index_struct { - int index, level; -} pm_local_index_t; - -// A declaration for the struct that lives in compile.c. -struct iseq_link_anchor; - -// ScopeNodes are helper nodes, and will never be part of the AST. We manually -// declare them here to avoid generating them. -typedef struct pm_scope_node { - pm_node_t base; - struct pm_scope_node *previous; - pm_node_t *ast_node; - pm_node_t *parameters; - pm_node_t *body; - pm_constant_id_list_t locals; - - const pm_parser_t *parser; - rb_encoding *encoding; - - /** - * This is a pointer to the list of script lines for the ISEQs that will be - * associated with this scope node. It is only set if - * RubyVM.keep_script_lines is true. If it is set, it will be set to a - * pointer to an array that is always stack allocated (so no GC marking is - * needed by this struct). If it is not set, it will be NULL. It is - * inherited by all child scopes. - */ - VALUE *script_lines; - - /** - * This is the encoding of the actual filepath object that will be used when - * a __FILE__ node is compiled or when the path has to be set on a syntax - * error. - */ - rb_encoding *filepath_encoding; - - // The size of the local table on the iseq which includes locals and hidden - // variables. - int local_table_for_iseq_size; - - ID *constants; - st_table *index_lookup_table; - - // The current coverage setting, passed down through the various scopes. - int coverage_enabled; - - /** - * This will only be set on the top-level scope node. It will contain all of - * the instructions pertaining to BEGIN{} nodes. - */ - struct iseq_link_anchor *pre_execution_anchor; -} pm_scope_node_t; - -void pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_t *previous); -void pm_scope_node_destroy(pm_scope_node_t *scope_node); - -typedef struct { - /** The parser that will do the actual parsing. */ - pm_parser_t parser; - - /** The options that will be passed to the parser. */ - pm_options_t options; - - /** The input that represents the source to be parsed. */ - pm_string_t input; - - /** The resulting scope node that will hold the generated AST. */ - pm_scope_node_t node; - - /** Whether or not this parse result has performed its parsing yet. */ - bool parsed; -} pm_parse_result_t; - -VALUE pm_load_file(pm_parse_result_t *result, VALUE filepath, bool load_error); -VALUE pm_parse_file(pm_parse_result_t *result, VALUE filepath, VALUE *script_lines); -VALUE pm_load_parse_file(pm_parse_result_t *result, VALUE filepath, VALUE *script_lines); -VALUE pm_parse_string(pm_parse_result_t *result, VALUE source, VALUE filepath, VALUE *script_lines); -VALUE pm_parse_stdin(pm_parse_result_t *result); -void pm_parse_result_free(pm_parse_result_t *result); - -rb_iseq_t *pm_iseq_new(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type); -rb_iseq_t *pm_iseq_new_top(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent); -rb_iseq_t *pm_iseq_new_main(pm_scope_node_t *node, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt); -rb_iseq_t *pm_iseq_new_eval(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth); -rb_iseq_t *pm_iseq_new_with_opt(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth, enum rb_iseq_type, const rb_compile_option_t*); - -VALUE pm_iseq_compile_node(rb_iseq_t *iseq, pm_scope_node_t *node); diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h deleted file mode 100644 index 16d81b9..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef RUBY_PROBES_HELPER_H -#define RUBY_PROBES_HELPER_H - -#include "ruby/ruby.h" - -struct ruby_dtrace_method_hook_args { - const char *classname; - const char *methodname; - const char *filename; - int line_no; - volatile VALUE klass; - volatile VALUE name; -}; - -NOINLINE(int rb_dtrace_setup(rb_execution_context_t *, VALUE, ID, struct ruby_dtrace_method_hook_args *)); - -#define RUBY_DTRACE_METHOD_HOOK(name, ec, klazz, id) \ -do { \ - if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \ - struct ruby_dtrace_method_hook_args args; \ - if (rb_dtrace_setup(ec, klazz, id, &args)) { \ - RUBY_DTRACE_##name(args.classname, \ - args.methodname, \ - args.filename, \ - args.line_no); \ - } \ - } \ -} while (0) - -#define RUBY_DTRACE_METHOD_ENTRY_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(METHOD_ENTRY, ec, klass, id) - -#define RUBY_DTRACE_METHOD_RETURN_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(METHOD_RETURN, ec, klass, id) - -#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(CMETHOD_ENTRY, ec, klass, id) - -#define RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec, klass, id) \ - RUBY_DTRACE_METHOD_HOOK(CMETHOD_RETURN, ec, klass, id) - -#endif /* RUBY_PROBES_HELPER_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h deleted file mode 100644 index fd3cba3..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h +++ /dev/null @@ -1,382 +0,0 @@ -#include "internal/gc.h" -#include "ruby/ruby.h" -#include "ruby/ractor.h" -#include "vm_core.h" -#include "id_table.h" -#include "vm_debug.h" - -#ifndef RACTOR_CHECK_MODE -#define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE) -#endif - -enum rb_ractor_basket_type { - // basket is empty - basket_type_none, - - // value is available - basket_type_ref, - basket_type_copy, - basket_type_move, - basket_type_will, - - // basket should be deleted - basket_type_deleted, - - // basket is reserved - basket_type_reserved, - - // take_basket is available - basket_type_take_basket, - - // basket is keeping by yielding ractor - basket_type_yielding, -}; - -// per ractor taking configuration -struct rb_ractor_selector_take_config { - bool closed; - bool oneshot; -}; - -struct rb_ractor_basket { - union { - enum rb_ractor_basket_type e; - rb_atomic_t atomic; - } type; - VALUE sender; - - union { - struct { - VALUE v; - bool exception; - } send; - - struct { - struct rb_ractor_basket *basket; - struct rb_ractor_selector_take_config *config; - } take; - } p; // payload -}; - -static inline bool -basket_type_p(struct rb_ractor_basket *b, enum rb_ractor_basket_type type) -{ - return b->type.e == type; -} - -static inline bool -basket_none_p(struct rb_ractor_basket *b) -{ - return basket_type_p(b, basket_type_none); -} - -struct rb_ractor_queue { - struct rb_ractor_basket *baskets; - int start; - int cnt; - int size; - unsigned int serial; - unsigned int reserved_cnt; -}; - -enum rb_ractor_wait_status { - wait_none = 0x00, - wait_receiving = 0x01, - wait_taking = 0x02, - wait_yielding = 0x04, - wait_moving = 0x08, -}; - -enum rb_ractor_wakeup_status { - wakeup_none, - wakeup_by_send, - wakeup_by_yield, - wakeup_by_take, - wakeup_by_close, - wakeup_by_interrupt, - wakeup_by_retry, -}; - -struct rb_ractor_sync { - // ractor lock - rb_nativethread_lock_t lock; -#if RACTOR_CHECK_MODE > 0 - VALUE locked_by; -#endif - - bool incoming_port_closed; - bool outgoing_port_closed; - - // All sent messages will be pushed into recv_queue - struct rb_ractor_queue recv_queue; - - // The following ractors waiting for the yielding by this ractor - struct rb_ractor_queue takers_queue; - - // Enabled if the ractor already terminated and not taken yet. - struct rb_ractor_basket will_basket; - - struct ractor_wait { - enum rb_ractor_wait_status status; - enum rb_ractor_wakeup_status wakeup_status; - rb_thread_t *waiting_thread; - } wait; - -#ifndef RUBY_THREAD_PTHREAD_H - rb_nativethread_cond_t cond; -#endif -}; - -// created -// | ready to run -// ====================== inserted to vm->ractor -// v -// blocking <---+ all threads are blocking -// | | -// v | -// running -----+ -// | all threads are terminated. -// ====================== removed from vm->ractor -// v -// terminated -// -// status is protected by VM lock (global state) -enum ractor_status { - ractor_created, - ractor_running, - ractor_blocking, - ractor_terminated, -}; - -struct rb_ractor_struct { - struct rb_ractor_pub pub; - - struct rb_ractor_sync sync; - VALUE receiving_mutex; - - // vm wide barrier synchronization - rb_nativethread_cond_t barrier_wait_cond; - - // thread management - struct { - struct ccan_list_head set; - unsigned int cnt; - unsigned int blocking_cnt; - unsigned int sleeper; - struct rb_thread_sched sched; - rb_execution_context_t *running_ec; - rb_thread_t *main; - } threads; - VALUE thgroup_default; - - VALUE name; - VALUE loc; - - enum ractor_status status_; - - struct ccan_list_node vmlr_node; - - // ractor local data - - st_table *local_storage; - struct rb_id_table *idkey_local_storage; - - VALUE r_stdin; - VALUE r_stdout; - VALUE r_stderr; - VALUE verbose; - VALUE debug; - - void *newobj_cache; -}; // rb_ractor_t is defined in vm_core.h - - -static inline VALUE -rb_ractor_self(const rb_ractor_t *r) -{ - return r->pub.self; -} - -rb_ractor_t *rb_ractor_main_alloc(void); -void rb_ractor_main_setup(rb_vm_t *vm, rb_ractor_t *main_ractor, rb_thread_t *main_thread); -void rb_ractor_atexit(rb_execution_context_t *ec, VALUE result); -void rb_ractor_atexit_exception(rb_execution_context_t *ec); -void rb_ractor_teardown(rb_execution_context_t *ec); -void rb_ractor_receive_parameters(rb_execution_context_t *ec, rb_ractor_t *g, int len, VALUE *ptr); -void rb_ractor_send_parameters(rb_execution_context_t *ec, rb_ractor_t *g, VALUE args); - -VALUE rb_thread_create_ractor(rb_ractor_t *g, VALUE args, VALUE proc); // defined in thread.c - -int rb_ractor_living_thread_num(const rb_ractor_t *); -VALUE rb_ractor_thread_list(void); -bool rb_ractor_p(VALUE rv); - -void rb_ractor_living_threads_init(rb_ractor_t *r); -void rb_ractor_living_threads_insert(rb_ractor_t *r, rb_thread_t *th); -void rb_ractor_living_threads_remove(rb_ractor_t *r, rb_thread_t *th); -void rb_ractor_blocking_threads_inc(rb_ractor_t *r, const char *file, int line); // TODO: file, line only for RUBY_DEBUG_LOG -void rb_ractor_blocking_threads_dec(rb_ractor_t *r, const char *file, int line); // TODO: file, line only for RUBY_DEBUG_LOG - -void rb_ractor_vm_barrier_interrupt_running_thread(rb_ractor_t *r); -void rb_ractor_terminate_interrupt_main_thread(rb_ractor_t *r); -void rb_ractor_terminate_all(void); -bool rb_ractor_main_p_(void); -void rb_ractor_atfork(rb_vm_t *vm, rb_thread_t *th); - -VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name); - -RUBY_SYMBOL_EXPORT_BEGIN -void rb_ractor_finish_marking(void); - -bool rb_ractor_shareable_p_continue(VALUE obj); - -// THIS FUNCTION SHOULD NOT CALL WHILE INCREMENTAL MARKING!! -// This function is for T_DATA::free_func -void rb_ractor_local_storage_delkey(rb_ractor_local_key_t key); - -RUBY_SYMBOL_EXPORT_END - -static inline bool -rb_ractor_main_p(void) -{ - if (ruby_single_main_ractor) { - return true; - } - else { - return rb_ractor_main_p_(); - } -} - -static inline bool -rb_ractor_status_p(rb_ractor_t *r, enum ractor_status status) -{ - return r->status_ == status; -} - -static inline void -rb_ractor_sleeper_threads_inc(rb_ractor_t *r) -{ - r->threads.sleeper++; -} - -static inline void -rb_ractor_sleeper_threads_dec(rb_ractor_t *r) -{ - r->threads.sleeper--; -} - -static inline void -rb_ractor_sleeper_threads_clear(rb_ractor_t *r) -{ - r->threads.sleeper = 0; -} - -static inline int -rb_ractor_sleeper_thread_num(rb_ractor_t *r) -{ - return r->threads.sleeper; -} - -static inline void -rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th) -{ - RUBY_DEBUG_LOG("th:%d->%u%s", - cr->threads.running_ec ? (int)rb_th_serial(cr->threads.running_ec->thread_ptr) : -1, - rb_th_serial(th), cr->threads.running_ec == th->ec ? " (same)" : ""); - - if (cr->threads.running_ec != th->ec) { - if (0) { - ruby_debug_printf("rb_ractor_thread_switch ec:%p->%p\n", - (void *)cr->threads.running_ec, (void *)th->ec); - } - } - else { - return; - } - - if (cr->threads.running_ec != th->ec) { - th->running_time_us = 0; - } - - cr->threads.running_ec = th->ec; - - VM_ASSERT(cr == GET_RACTOR()); -} - -#define rb_ractor_set_current_ec(cr, ec) rb_ractor_set_current_ec_(cr, ec, __FILE__, __LINE__) - -static inline void -rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line) -{ -#ifdef RB_THREAD_LOCAL_SPECIFIER - -# ifdef __APPLE__ - rb_current_ec_set(ec); -# else - ruby_current_ec = ec; -# endif - -#else - native_tls_set(ruby_current_ec_key, ec); -#endif - RUBY_DEBUG_LOG2(file, line, "ec:%p->%p", (void *)cr->threads.running_ec, (void *)ec); - VM_ASSERT(ec == NULL || cr->threads.running_ec != ec); - cr->threads.running_ec = ec; -} - -void rb_vm_ractor_blocking_cnt_inc(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line); -void rb_vm_ractor_blocking_cnt_dec(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line); - -static inline uint32_t -rb_ractor_id(const rb_ractor_t *r) -{ - return r->pub.id; -} - -#if RACTOR_CHECK_MODE > 0 -# define RACTOR_BELONGING_ID(obj) (*(uint32_t *)(((uintptr_t)(obj)) + rb_gc_obj_slot_size(obj))) - -uint32_t rb_ractor_current_id(void); - -static inline void -rb_ractor_setup_belonging_to(VALUE obj, uint32_t rid) -{ - RACTOR_BELONGING_ID(obj) = rid; -} - -static inline uint32_t -rb_ractor_belonging(VALUE obj) -{ - if (SPECIAL_CONST_P(obj) || RB_OBJ_SHAREABLE_P(obj)) { - return 0; - } - else { - return RACTOR_BELONGING_ID(obj); - } -} - -static inline VALUE -rb_ractor_confirm_belonging(VALUE obj) -{ - uint32_t id = rb_ractor_belonging(obj); - - if (id == 0) { - if (UNLIKELY(!rb_ractor_shareable_p(obj))) { - rp(obj); - rb_bug("id == 0 but not shareable"); - } - } - else if (UNLIKELY(id != rb_ractor_current_id())) { - if (rb_ractor_shareable_p(obj)) { - // ok - } - else { - rp(obj); - rb_bug("rb_ractor_confirm_belonging object-ractor id:%u, current-ractor id:%u", id, rb_ractor_current_id()); - } - } - return obj; -} -#else -#define rb_ractor_confirm_belonging(obj) obj -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regenc.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regenc.h deleted file mode 100644 index 352a8d7..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regenc.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef ONIGMO_REGENC_H -#define ONIGMO_REGENC_H -/********************************************************************** - regenc.h - Onigmo (Oniguruma-mod) (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2008 K.Kosako - * Copyright (c) 2011-2016 K.Takata - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if !defined(RUBY) && (defined(RUBY_EXPORT) || defined(ONIG_ENC_REGISTER)) -# define RUBY -#endif -#ifdef RUBY -# ifndef ONIGMO_REGINT_H -# ifndef RUBY_EXTERN -# include "ruby/config.h" -# include "ruby/defines.h" -# endif -# endif -# include "ruby.h" -#else /* RUBY */ -# ifndef PACKAGE -/* PACKAGE is defined in config.h */ -# include "config.h" -# endif -#endif /* RUBY */ - -#ifdef ONIG_ESCAPE_UCHAR_COLLISION -# undef ONIG_ESCAPE_UCHAR_COLLISION -#endif - -#ifdef RUBY -# include "ruby/onigmo.h" -#else -# include "onigmo.h" -#endif - -RUBY_SYMBOL_EXPORT_BEGIN - -typedef struct { - OnigCodePoint from; - OnigCodePoint to; -} OnigPairCaseFoldCodes; - - -#ifndef NULL -# define NULL ((void* )0) -#endif - -#ifndef TRUE -# define TRUE 1 -#endif - -#ifndef FALSE -# define FALSE 0 -#endif - -#ifndef ARG_UNUSED -# if defined(__GNUC__) -# define ARG_UNUSED __attribute__ ((unused)) -# else -# define ARG_UNUSED -# endif -#endif - -#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0) -#define ONIG_IS_NOT_NULL(p) (((void*)(p)) != (void*)0) -#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL -#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val) - -#define enclen(enc,p,e) ((enc->max_enc_len == enc->min_enc_len) ? (p < e ? enc->min_enc_len : 0) : ONIGENC_MBC_ENC_LEN(enc,p,e)) - -/* character types bit flag */ -#define BIT_CTYPE_NEWLINE (1<< ONIGENC_CTYPE_NEWLINE) -#define BIT_CTYPE_ALPHA (1<< ONIGENC_CTYPE_ALPHA) -#define BIT_CTYPE_BLANK (1<< ONIGENC_CTYPE_BLANK) -#define BIT_CTYPE_CNTRL (1<< ONIGENC_CTYPE_CNTRL) -#define BIT_CTYPE_DIGIT (1<< ONIGENC_CTYPE_DIGIT) -#define BIT_CTYPE_GRAPH (1<< ONIGENC_CTYPE_GRAPH) -#define BIT_CTYPE_LOWER (1<< ONIGENC_CTYPE_LOWER) -#define BIT_CTYPE_PRINT (1<< ONIGENC_CTYPE_PRINT) -#define BIT_CTYPE_PUNCT (1<< ONIGENC_CTYPE_PUNCT) -#define BIT_CTYPE_SPACE (1<< ONIGENC_CTYPE_SPACE) -#define BIT_CTYPE_UPPER (1<< ONIGENC_CTYPE_UPPER) -#define BIT_CTYPE_XDIGIT (1<< ONIGENC_CTYPE_XDIGIT) -#define BIT_CTYPE_WORD (1<< ONIGENC_CTYPE_WORD) -#define BIT_CTYPE_ALNUM (1<< ONIGENC_CTYPE_ALNUM) -#define BIT_CTYPE_ASCII (1<< ONIGENC_CTYPE_ASCII) - -#define CTYPE_TO_BIT(ctype) (1<<(ctype)) -#define CTYPE_IS_WORD_GRAPH_PRINT(ctype) \ - ((ctype) == ONIGENC_CTYPE_WORD || (ctype) == ONIGENC_CTYPE_GRAPH ||\ - (ctype) == ONIGENC_CTYPE_PRINT) - - -typedef struct { - short int len; - const UChar name[6]; - int ctype; -} PosixBracketEntryType; - -#define POSIX_BRACKET_ENTRY_INIT(name, ctype) \ - {(short int )(sizeof(name) - 1), name, (ctype)} - -#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) -#define roomof(x, y) (((x) + (y) - 1) / (y)) -#define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) - -#define USE_CRNL_AS_LINE_TERMINATOR -#define USE_UNICODE_PROPERTIES -#define USE_UNICODE_AGE_PROPERTIES -/* #define USE_UNICODE_CASE_FOLD_TURKISH_AZERI */ -/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTS #18 */ - - -#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII - -/* for encoding system implementation (internal) */ -ONIG_EXTERN int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc); -ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc); -ONIG_EXTERN int onigenc_apply_all_case_fold_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg); -ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]); -ONIG_EXTERN int onigenc_not_support_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc); -ONIG_EXTERN int onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc); - - -/* methods for single byte encoding */ -ONIG_EXTERN int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc); -ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_code_to_mbclen(OnigCodePoint code, OnigEncoding enc); -ONIG_EXTERN int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc); -ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc); -ONIG_EXTERN int onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc); - -/* methods for multi byte encoding */ -ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end); -ONIG_EXTERN int onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower); -ONIG_EXTERN int onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc); -ONIG_EXTERN int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf); -ONIG_EXTERN int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end); -ONIG_EXTERN int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end); -ONIG_EXTERN int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype); -ONIG_EXTERN int onigenc_mb4_code_to_mbclen(OnigCodePoint code, OnigEncoding enc); -ONIG_EXTERN int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf); -ONIG_EXTERN int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype); - -ONIG_EXTERN int onigenc_unicode_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc); - - -/* in enc/unicode.c */ -ONIG_EXTERN int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc); -ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc); -ONIG_EXTERN int onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]); -ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]); -ONIG_EXTERN int onigenc_unicode_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold); -ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc); - - -#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8) -#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc) -#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8) -#define UNICODE_VALID_CODEPOINT_P(c) ( \ - ((c) <= 0x10ffff) && \ - !((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8))) - -#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \ - OnigEncISO_8859_1_ToLowerCaseTable[c] -#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \ - OnigEncISO_8859_1_ToUpperCaseTable[c] - -ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[]; -ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[]; - -ONIG_EXTERN int -onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n); -ONIG_EXTERN int -onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n); -ONIG_EXTERN UChar* -onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n); - -/* defined in regexec.c, but used in enc/xxx.c */ -extern int onig_is_in_code_range(const UChar* p, OnigCodePoint code); - -ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding; -ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[]; -ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[]; -ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[]; - -#define ONIGENC_IS_ASCII_CODE(code) ((code) < 0x80) -#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c] -#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c] -#define ONIGENC_IS_ASCII_CODE_CTYPE(code,ctype) \ - ((OnigEncAsciiCtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) -#define ONIGENC_IS_ASCII_CODE_CASE_AMBIG(code) \ - (ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_UPPER) ||\ - ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER)) - -/* Check if the code is in the range. (from <= code && code <= to) */ -#define ONIGENC_IS_IN_RANGE(code, from, to) \ - ((OnigCodePoint )((code) - (from)) <= (OnigCodePoint )((to) - (from))) - - -#ifdef ONIG_ENC_REGISTER -extern int ONIG_ENC_REGISTER(const char *, OnigEncoding); -# define OnigEncodingName(n) encoding_##n -# define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n) -# define OnigEncodingDefine(f,n) \ - OnigEncodingDeclare(n); \ - void Init_##f(void) { \ - ONIG_ENC_REGISTER(OnigEncodingName(n).name, \ - &OnigEncodingName(n)); \ - } \ - OnigEncodingDeclare(n) -#else -# define OnigEncodingName(n) OnigEncoding##n -# define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n) -# define OnigEncodingDefine(f,n) OnigEncodingDeclare(n) -#endif - -/* macros for define replica encoding and encoding alias */ -#define ENC_REPLICATE(name, orig) -#define ENC_ALIAS(name, orig) -#define ENC_DUMMY(name) - -RUBY_SYMBOL_EXPORT_END - -#endif /* ONIGMO_REGENC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regint.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regint.h deleted file mode 100644 index 75abfba..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regint.h +++ /dev/null @@ -1,1006 +0,0 @@ -#ifndef ONIGMO_REGINT_H -#define ONIGMO_REGINT_H -/********************************************************************** - regint.h - Onigmo (Oniguruma-mod) (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2013 K.Kosako - * Copyright (c) 2011-2016 K.Takata - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* for debug */ -/* #define ONIG_DEBUG_PARSE_TREE */ -/* #define ONIG_DEBUG_COMPILE */ -/* #define ONIG_DEBUG_SEARCH */ -/* #define ONIG_DEBUG_MATCH */ -/* #define ONIG_DEBUG_MATCH_CACHE */ -/* #define ONIG_DEBUG_MEMLEAK */ -/* #define ONIG_DONT_OPTIMIZE */ - -/* for byte-code statistical data. */ -/* #define ONIG_DEBUG_STATISTICS */ - -/* enable the match optimization by using a cache. */ -#define USE_MATCH_CACHE - -#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \ - defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \ - defined(ONIG_DEBUG_STATISTICS) || defined(ONIG_DEBUG_MEMLEAK) -# ifndef ONIG_DEBUG -# define ONIG_DEBUG -# endif -#endif - -/* __POWERPC__ added to accommodate Darwin case. */ -#ifndef UNALIGNED_WORD_ACCESS -# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ - defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \ - defined(__powerpc64__) || defined(__POWERPC__) || defined(__aarch64__) || \ - defined(__mc68020__) -# define UNALIGNED_WORD_ACCESS 1 -# else -# define UNALIGNED_WORD_ACCESS 0 -# endif -#endif - -#if UNALIGNED_WORD_ACCESS -# define PLATFORM_UNALIGNED_WORD_ACCESS -#endif - -/* config */ -/* spec. config */ -#define USE_NAMED_GROUP -#define USE_SUBEXP_CALL -#define USE_PERL_SUBEXP_CALL -#define USE_CAPITAL_P_NAMED_GROUP -#define USE_BACKREF_WITH_LEVEL /* \k, \k */ -#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */ -#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */ -#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR -/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */ -#define USE_NO_INVALID_QUANTIFIER - -/* internal config */ -/* #define USE_OP_PUSH_OR_JUMP_EXACT */ -#define USE_QTFR_PEEK_NEXT -#define USE_ST_LIBRARY -#define USE_SUNDAY_QUICK_SEARCH - -#define INIT_MATCH_STACK_SIZE 160 -#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */ -#define DEFAULT_PARSE_DEPTH_LIMIT 4096 - -#define OPT_EXACT_MAXLEN 24 - -/* check config */ -#if defined(USE_PERL_SUBEXP_CALL) || defined(USE_CAPITAL_P_NAMED_GROUP) -# if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL) -# error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined. -# endif -#endif - -#if defined(__GNUC__) -# define ARG_UNUSED __attribute__ ((unused)) -#else -# define ARG_UNUSED -#endif - -#if !defined(RUBY) && defined(RUBY_EXPORT) -# define RUBY -#endif -#ifdef RUBY -# ifndef RUBY_DEFINES_H -# include "ruby/ruby.h" -# undef xmalloc -# undef xrealloc -# undef xcalloc -# undef xfree -# endif -#else /* RUBY */ -# include "config.h" -# if SIZEOF_LONG_LONG > 0 -# define LONG_LONG long long -# endif -#endif /* RUBY */ - -#include - -/* */ -/* escape other system UChar definition */ -#ifdef ONIG_ESCAPE_UCHAR_COLLISION -# undef ONIG_ESCAPE_UCHAR_COLLISION -#endif - -#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */ -#ifdef RUBY -# undef USE_CAPTURE_HISTORY -#else -# define USE_CAPTURE_HISTORY -#endif -#define USE_VARIABLE_META_CHARS -#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE -/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */ - - -#ifndef xmalloc -# define xmalloc malloc -# define xrealloc realloc -# define xcalloc calloc -# define xfree free -#endif - -#ifdef RUBY - -# define CHECK_INTERRUPT_IN_MATCH_AT do { \ - msa->counter++; \ - if (msa->counter >= 128) { \ - msa->counter = 0; \ - if (rb_reg_timeout_p(reg, &msa->end_time)) { \ - goto timeout; \ - } \ - rb_thread_check_ints(); \ - } \ -} while(0) -# define onig_st_init_table st_init_table -# define onig_st_init_table_with_size st_init_table_with_size -# define onig_st_init_numtable st_init_numtable -# define onig_st_init_numtable_with_size st_init_numtable_with_size -# define onig_st_init_strtable st_init_strtable -# define onig_st_init_strtable_with_size st_init_strtable_with_size -# define onig_st_delete st_delete -# define onig_st_delete_safe st_delete_safe -# define onig_st_insert st_insert -# define onig_st_lookup st_lookup -# define onig_st_foreach st_foreach -# define onig_st_add_direct st_add_direct -# define onig_st_free_table st_free_table -# define onig_st_cleanup_safe st_cleanup_safe -# define onig_st_copy st_copy -# define onig_st_nothing_key_clone st_nothing_key_clone -# define onig_st_nothing_key_free st_nothing_key_free -# define onig_st_is_member st_is_member - -# define USE_UPPER_CASE_TABLE -#else /* RUBY */ - -# define CHECK_INTERRUPT_IN_MATCH_AT - -# define st_init_table onig_st_init_table -# define st_init_table_with_size onig_st_init_table_with_size -# define st_init_numtable onig_st_init_numtable -# define st_init_numtable_with_size onig_st_init_numtable_with_size -# define st_init_strtable onig_st_init_strtable -# define st_init_strtable_with_size onig_st_init_strtable_with_size -# define st_delete onig_st_delete -# define st_delete_safe onig_st_delete_safe -# define st_insert onig_st_insert -# define st_lookup onig_st_lookup -# define st_foreach onig_st_foreach -# define st_add_direct onig_st_add_direct -# define st_free_table onig_st_free_table -# define st_cleanup_safe onig_st_cleanup_safe -# define st_copy onig_st_copy -# define st_nothing_key_clone onig_st_nothing_key_clone -# define st_nothing_key_free onig_st_nothing_key_free -/* */ -# define onig_st_is_member st_is_member - -#endif /* RUBY */ - -#define STATE_CHECK_STRING_THRESHOLD_LEN 7 -#define STATE_CHECK_BUFF_MAX_SIZE 0x4000 - -#define xmemset memset -#define xmemcpy memcpy -#define xmemmove memmove - -#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \ - || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \ - && !defined(__GNUC__) -# define xalloca _alloca -# define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args) -# define xsnprintf sprintf_s -# define xstrcat(dest,src,size) strcat_s(dest,size,src) -#else -# define xalloca alloca -# define xvsnprintf vsnprintf -# define xsnprintf snprintf -# define xstrcat(dest,src,size) strcat(dest,src) -#endif - -#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER) -# define _CRTDBG_MAP_ALLOC -# include -# include -#endif - -#include - -#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__)) -# include -#endif - -#include - -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#ifdef HAVE_STDINT_H -# include -#endif - -#ifdef HAVE_INTTYPES_H -# include -#endif - -#include - -#ifdef _WIN32 -# include /* for alloca() */ -#endif - -#ifdef ONIG_DEBUG -# include -#endif - -#ifdef _WIN32 -# if defined(_MSC_VER) && (_MSC_VER < 1300) -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -typedef int intptr_t; -# endif -# ifndef _UINTPTR_T_DEFINED -# define _UINTPTR_T_DEFINED -typedef unsigned int uintptr_t; -# endif -# endif -#endif /* _WIN32 */ - -#ifndef PRIdPTR -# ifdef _WIN64 -# define PRIdPTR "I64d" -# define PRIuPTR "I64u" -# define PRIxPTR "I64x" -# else -# define PRIdPTR "ld" -# define PRIuPTR "lu" -# define PRIxPTR "lx" -# endif -#endif - -#ifndef PRIdPTRDIFF -# define PRIdPTRDIFF PRIdPTR -#endif - -#include "regenc.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#ifdef MIN -# undef MIN -#endif -#ifdef MAX -# undef MAX -#endif -#define MIN(a,b) (((a)>(b))?(b):(a)) -#define MAX(a,b) (((a)<(b))?(b):(a)) - -#define IS_NULL(p) (((void*)(p)) == (void*)0) -#define IS_NOT_NULL(p) (((void*)(p)) != (void*)0) -#define CHECK_NULL_RETURN(p) if (IS_NULL(p)) return NULL -#define CHECK_NULL_RETURN_MEMERR(p) if (IS_NULL(p)) return ONIGERR_MEMORY -#define NULL_UCHARP ((UChar* )0) - -#define ONIG_LAST_CODE_POINT (~((OnigCodePoint )0)) - -#define PLATFORM_GET_INC_ARGUMENTS_ASSERT(val, type) \ - ((void)sizeof(char[2 * (sizeof(val) == sizeof(type)) - 1])) - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS - -# define PLATFORM_GET_INC(val,p,type) do{\ - PLATFORM_GET_INC_ARGUMENTS_ASSERT(val, type);\ - val = *(type* )p;\ - (p) += sizeof(type);\ -} while(0) - -#else - -# define PLATFORM_GET_INC(val,p,type) do{\ - PLATFORM_GET_INC_ARGUMENTS_ASSERT(val, type);\ - type platform_get_value;\ - xmemcpy(&platform_get_value, (p), sizeof(type));\ - val = platform_get_value;\ - (p) += sizeof(type);\ -} while(0) - -/* sizeof(OnigCodePoint) */ -# define WORD_ALIGNMENT_SIZE SIZEOF_LONG - -# define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\ - (pad_size) = WORD_ALIGNMENT_SIZE \ - - ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\ - if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\ -} while (0) - -# define ALIGNMENT_RIGHT(addr) do {\ - (addr) += (WORD_ALIGNMENT_SIZE - 1);\ - (addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\ -} while (0) - -#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ - -/* stack pop level */ -#define STACK_POP_LEVEL_FREE 0 -#define STACK_POP_LEVEL_MEM_START 1 -#define STACK_POP_LEVEL_ALL 2 - -/* optimize flags */ -#define ONIG_OPTIMIZE_NONE 0 -#define ONIG_OPTIMIZE_EXACT 1 /* Slow Search */ -#define ONIG_OPTIMIZE_EXACT_BM 2 /* Boyer Moore Search */ -#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV 3 /* BM (applied to a multibyte string) */ -#define ONIG_OPTIMIZE_EXACT_IC 4 /* Slow Search (ignore case) */ -#define ONIG_OPTIMIZE_MAP 5 /* char map */ -#define ONIG_OPTIMIZE_EXACT_BM_IC 6 /* BM (ignore case) */ -#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC 7 /* BM (applied to a multibyte string) (ignore case) */ - -/* bit status */ -typedef unsigned int BitStatusType; - -#define BIT_STATUS_BITS_NUM (sizeof(BitStatusType) * 8) -#define BIT_STATUS_CLEAR(stats) (stats) = 0 -#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0) -#define BIT_STATUS_AT(stats,n) \ - ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & ((BitStatusType )1 << n)) : ((stats) & 1)) - -#define BIT_STATUS_ON_AT(stats,n) do {\ - if ((n) < (int )BIT_STATUS_BITS_NUM)\ - (stats) |= (1 << (n));\ - else\ - (stats) |= 1;\ -} while (0) - -#define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\ - if ((n) < (int )BIT_STATUS_BITS_NUM)\ - (stats) |= (1 << (n));\ -} while (0) - - -#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1) -#define LONG_MAX_LIMIT ((1UL << (SIZEOF_LONG * 8 - 1)) - 1) - -#define DIGITVAL(code) ((code) - '0') -#define ODIGITVAL(code) DIGITVAL(code) -#define XDIGITVAL(enc,code) \ - (ONIGENC_IS_CODE_DIGIT(enc,code) ? DIGITVAL(code) \ - : (ONIGENC_IS_CODE_UPPER(enc,code) ? (code) - 'A' + 10 : (code) - 'a' + 10)) - -#define IS_SINGLELINE(option) ((option) & ONIG_OPTION_SINGLELINE) -#define IS_MULTILINE(option) ((option) & ONIG_OPTION_MULTILINE) -#define IS_IGNORECASE(option) ((option) & ONIG_OPTION_IGNORECASE) -#define IS_EXTEND(option) ((option) & ONIG_OPTION_EXTEND) -#define IS_FIND_LONGEST(option) ((option) & ONIG_OPTION_FIND_LONGEST) -#define IS_FIND_NOT_EMPTY(option) ((option) & ONIG_OPTION_FIND_NOT_EMPTY) -#define IS_FIND_CONDITION(option) ((option) & \ - (ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY)) -#define IS_NOTBOL(option) ((option) & ONIG_OPTION_NOTBOL) -#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL) -#define IS_NOTBOS(option) ((option) & ONIG_OPTION_NOTBOS) -#define IS_NOTEOS(option) ((option) & ONIG_OPTION_NOTEOS) -#define IS_ASCII_RANGE(option) ((option) & ONIG_OPTION_ASCII_RANGE) -#define IS_POSIX_BRACKET_ALL_RANGE(option) ((option) & ONIG_OPTION_POSIX_BRACKET_ALL_RANGE) -#define IS_WORD_BOUND_ALL_RANGE(option) ((option) & ONIG_OPTION_WORD_BOUND_ALL_RANGE) -#define IS_NEWLINE_CRLF(option) ((option) & ONIG_OPTION_NEWLINE_CRLF) - -/* OP_SET_OPTION is required for these options. -#define IS_DYNAMIC_OPTION(option) \ - (((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0) -*/ -/* ignore-case and multibyte status are included in compiled code. */ -#define IS_DYNAMIC_OPTION(option) 0 - -#define DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag) \ - ((case_fold_flag) & ~INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) - -#define REPEAT_INFINITE -1 -#define IS_REPEAT_INFINITE(n) ((n) == REPEAT_INFINITE) - -/* bitset */ -#define BITS_PER_BYTE 8 -#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE) -#define BITS_IN_ROOM ((int )sizeof(Bits) * BITS_PER_BYTE) -#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM) - -#ifdef PLATFORM_UNALIGNED_WORD_ACCESS -typedef unsigned int Bits; -#else -typedef unsigned char Bits; -#endif -typedef Bits BitSet[BITSET_SIZE]; -typedef Bits* BitSetRef; - -#define SIZE_BITSET (int )sizeof(BitSet) - -#define BITSET_CLEAR(bs) do {\ - int i;\ - for (i = 0; i < BITSET_SIZE; i++) { (bs)[i] = 0; } \ -} while (0) - -#define BS_ROOM(bs,pos) (bs)[(int )(pos) / BITS_IN_ROOM] -#define BS_BIT(pos) (1U << ((int )(pos) % BITS_IN_ROOM)) - -#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos)) -#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos) -#define BITSET_CLEAR_BIT(bs, pos) BS_ROOM(bs,pos) &= ~(BS_BIT(pos)) -#define BITSET_INVERT_BIT(bs, pos) BS_ROOM(bs,pos) ^= BS_BIT(pos) - -/* bytes buffer */ -typedef struct _BBuf { - UChar* p; - unsigned int used; - unsigned int alloc; -} BBuf; - -#define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size)) - -#define BBUF_SIZE_INC(buf,inc) do{\ - UChar *tmp;\ - (buf)->alloc += (inc);\ - tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ - (buf)->p = tmp;\ -} while (0) - -#define BBUF_EXPAND(buf,low) do{\ - UChar *tmp;\ - do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\ - tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\ - if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ - (buf)->p = tmp;\ -} while (0) - -#define BBUF_ENSURE_SIZE(buf,size) do{\ - unsigned int new_alloc = (buf)->alloc;\ - while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\ - if ((buf)->alloc != new_alloc) {\ - UChar *tmp;\ - tmp = (UChar* )xrealloc((buf)->p, new_alloc);\ - if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\ - (buf)->p = tmp;\ - (buf)->alloc = new_alloc;\ - }\ -} while (0) - -#define BBUF_WRITE(buf,pos,bytes,n) do{\ - int used = (pos) + (int )(n);\ - if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\ - xmemcpy((buf)->p + (pos), (bytes), (n));\ - if ((buf)->used < (unsigned int )used) (buf)->used = used;\ -} while (0) - -#define BBUF_WRITE1(buf,pos,byte) do{\ - int used = (pos) + 1;\ - if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\ - (buf)->p[(pos)] = (UChar )(byte);\ - if ((buf)->used < (unsigned int )used) (buf)->used = used;\ -} while (0) - -#define BBUF_ADD(buf,bytes,n) BBUF_WRITE((buf),(buf)->used,(bytes),(n)) -#define BBUF_ADD1(buf,byte) BBUF_WRITE1((buf),(buf)->used,(byte)) -#define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used) -#define BBUF_GET_OFFSET_POS(buf) ((buf)->used) - -/* from < to */ -#define BBUF_MOVE_RIGHT(buf,from,to,n) do {\ - if ((unsigned int )((to)+(n)) > (buf)->alloc) BBUF_EXPAND((buf),(to) + (n));\ - xmemmove((buf)->p + (to), (buf)->p + (from), (n));\ - if ((unsigned int )((to)+(n)) > (buf)->used) (buf)->used = (to) + (n);\ -} while (0) - -/* from > to */ -#define BBUF_MOVE_LEFT(buf,from,to,n) do {\ - xmemmove((buf)->p + (to), (buf)->p + (from), (n));\ -} while (0) - -/* from > to */ -#define BBUF_MOVE_LEFT_REDUCE(buf,from,to) do {\ - xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from));\ - (buf)->used -= (from - to);\ -} while (0) - -#define BBUF_INSERT(buf,pos,bytes,n) do {\ - if (pos >= (buf)->used) {\ - BBUF_WRITE(buf,pos,bytes,n);\ - }\ - else {\ - BBUF_MOVE_RIGHT((buf),(pos),(pos) + (n),((buf)->used - (pos)));\ - xmemcpy((buf)->p + (pos), (bytes), (n));\ - }\ -} while (0) - -#define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)] - - -#define ANCHOR_BEGIN_BUF (1<<0) -#define ANCHOR_BEGIN_LINE (1<<1) -#define ANCHOR_BEGIN_POSITION (1<<2) -#define ANCHOR_END_BUF (1<<3) -#define ANCHOR_SEMI_END_BUF (1<<4) -#define ANCHOR_END_LINE (1<<5) - -#define ANCHOR_WORD_BOUND (1<<6) -#define ANCHOR_NOT_WORD_BOUND (1<<7) -#define ANCHOR_WORD_BEGIN (1<<8) -#define ANCHOR_WORD_END (1<<9) -#define ANCHOR_PREC_READ (1<<10) -#define ANCHOR_PREC_READ_NOT (1<<11) -#define ANCHOR_LOOK_BEHIND (1<<12) -#define ANCHOR_LOOK_BEHIND_NOT (1<<13) - -#define ANCHOR_ANYCHAR_STAR (1<<14) /* ".*" optimize info */ -#define ANCHOR_ANYCHAR_STAR_ML (1<<15) /* ".*" optimize info (multi-line) */ - -#define ANCHOR_KEEP (1<<16) - -/* operation code */ -enum OpCode { - OP_FINISH = 0, /* matching process terminator (no more alternative) */ - OP_END = 1, /* pattern code terminator (success end) */ - - OP_EXACT1 = 2, /* single byte, N = 1 */ - OP_EXACT2, /* single byte, N = 2 */ - OP_EXACT3, /* single byte, N = 3 */ - OP_EXACT4, /* single byte, N = 4 */ - OP_EXACT5, /* single byte, N = 5 */ - OP_EXACTN, /* single byte */ - OP_EXACTMB2N1, /* mb-length = 2 N = 1 */ - OP_EXACTMB2N2, /* mb-length = 2 N = 2 */ - OP_EXACTMB2N3, /* mb-length = 2 N = 3 */ - OP_EXACTMB2N, /* mb-length = 2 */ - OP_EXACTMB3N, /* mb-length = 3 */ - OP_EXACTMBN, /* other length */ - - OP_EXACT1_IC, /* single byte, N = 1, ignore case */ - OP_EXACTN_IC, /* single byte, ignore case */ - - OP_CCLASS, - OP_CCLASS_MB, - OP_CCLASS_MIX, - OP_CCLASS_NOT, - OP_CCLASS_MB_NOT, - OP_CCLASS_MIX_NOT, - - OP_ANYCHAR, /* "." */ - OP_ANYCHAR_ML, /* "." multi-line */ - OP_ANYCHAR_STAR, /* ".*" */ - OP_ANYCHAR_ML_STAR, /* ".*" multi-line */ - OP_ANYCHAR_STAR_PEEK_NEXT, - OP_ANYCHAR_ML_STAR_PEEK_NEXT, - - OP_WORD, - OP_NOT_WORD, - OP_WORD_BOUND, - OP_NOT_WORD_BOUND, - OP_WORD_BEGIN, - OP_WORD_END, - - OP_ASCII_WORD, - OP_NOT_ASCII_WORD, - OP_ASCII_WORD_BOUND, - OP_NOT_ASCII_WORD_BOUND, - OP_ASCII_WORD_BEGIN, - OP_ASCII_WORD_END, - - OP_BEGIN_BUF, - OP_END_BUF, - OP_BEGIN_LINE, - OP_END_LINE, - OP_SEMI_END_BUF, - OP_BEGIN_POSITION, - - OP_BACKREF1, - OP_BACKREF2, - OP_BACKREFN, - OP_BACKREFN_IC, - OP_BACKREF_MULTI, - OP_BACKREF_MULTI_IC, - OP_BACKREF_WITH_LEVEL, /* \k, \k */ - - OP_MEMORY_START, - OP_MEMORY_START_PUSH, /* push back-tracker to stack */ - OP_MEMORY_END_PUSH, /* push back-tracker to stack */ - OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */ - OP_MEMORY_END, - OP_MEMORY_END_REC, /* push marker to stack */ - - OP_KEEP, - - OP_FAIL, /* pop stack and move */ - OP_JUMP, - OP_PUSH, - OP_POP, - OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */ - OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */ - OP_REPEAT, /* {n,m} */ - OP_REPEAT_NG, /* {n,m}? (non greedy) */ - OP_REPEAT_INC, - OP_REPEAT_INC_NG, /* non greedy */ - OP_REPEAT_INC_SG, /* search and get in stack */ - OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */ - OP_NULL_CHECK_START, /* null loop checker start */ - OP_NULL_CHECK_END, /* null loop checker end */ - OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */ - OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */ - - OP_PUSH_POS, /* (?=...) start */ - OP_POP_POS, /* (?=...) end */ - OP_PUSH_POS_NOT, /* (?!...) start */ - OP_FAIL_POS, /* (?!...) end */ - OP_PUSH_STOP_BT, /* (?>...) start */ - OP_POP_STOP_BT, /* (?>...) end */ - OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */ - OP_PUSH_LOOK_BEHIND_NOT, /* (? */ - OP_RETURN, - - OP_CONDITION, - - OP_STATE_CHECK_PUSH, /* combination explosion check and push */ - OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */ - OP_STATE_CHECK, /* check only */ - OP_STATE_CHECK_ANYCHAR_STAR, - OP_STATE_CHECK_ANYCHAR_ML_STAR, - - /* no need: IS_DYNAMIC_OPTION() == 0 */ - OP_SET_OPTION_PUSH, /* set option and push recover option */ - OP_SET_OPTION /* set option */ -}; - -typedef int RelAddrType; -typedef int AbsAddrType; -typedef int LengthType; -typedef int RepeatNumType; -typedef short int MemNumType; -typedef short int StateCheckNumType; -typedef void* PointerType; - -#define SIZE_OPCODE 1 -#define SIZE_RELADDR (int )sizeof(RelAddrType) -#define SIZE_ABSADDR (int )sizeof(AbsAddrType) -#define SIZE_LENGTH (int )sizeof(LengthType) -#define SIZE_MEMNUM (int )sizeof(MemNumType) -#define SIZE_STATE_CHECK_NUM (int )sizeof(StateCheckNumType) -#define SIZE_REPEATNUM (int )sizeof(RepeatNumType) -#define SIZE_OPTION (int )sizeof(OnigOptionType) -#define SIZE_CODE_POINT (int )sizeof(OnigCodePoint) -#define SIZE_POINTER (int )sizeof(PointerType) - - -#define GET_RELADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, RelAddrType) -#define GET_ABSADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, AbsAddrType) -#define GET_LENGTH_INC(len,p) PLATFORM_GET_INC(len, p, LengthType) -#define GET_MEMNUM_INC(num,p) PLATFORM_GET_INC(num, p, MemNumType) -#define GET_REPEATNUM_INC(num,p) PLATFORM_GET_INC(num, p, RepeatNumType) -#define GET_OPTION_INC(option,p) PLATFORM_GET_INC(option, p, OnigOptionType) -#define GET_POINTER_INC(ptr,p) PLATFORM_GET_INC(ptr, p, PointerType) -#define GET_STATE_CHECK_NUM_INC(num,p) PLATFORM_GET_INC(num, p, StateCheckNumType) - -/* code point's address must be aligned address. */ -#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p)) -#define GET_BYTE_INC(byte,p) do{\ - byte = *(p);\ - (p)++;\ -} while(0) - - -/* op-code + arg size */ -#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE -#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1) -#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_POP SIZE_OPCODE -#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1) -#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1) -#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_PUSH_POS SIZE_OPCODE -#define SIZE_OP_PUSH_POS_NOT (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_POP_POS SIZE_OPCODE -#define SIZE_OP_FAIL_POS SIZE_OPCODE -#define SIZE_OP_SET_OPTION (SIZE_OPCODE + SIZE_OPTION) -#define SIZE_OP_SET_OPTION_PUSH (SIZE_OPCODE + SIZE_OPTION) -#define SIZE_OP_FAIL SIZE_OPCODE -#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_PUSH_STOP_BT SIZE_OPCODE -#define SIZE_OP_POP_STOP_BT SIZE_OPCODE -#define SIZE_OP_NULL_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_NULL_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM) -#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH) -#define SIZE_OP_PUSH_LOOK_BEHIND_NOT (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH) -#define SIZE_OP_FAIL_LOOK_BEHIND_NOT SIZE_OPCODE -#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR) -#define SIZE_OP_RETURN SIZE_OPCODE -#define SIZE_OP_CONDITION (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR) -#define SIZE_OP_PUSH_ABSENT_POS SIZE_OPCODE -#define SIZE_OP_ABSENT (SIZE_OPCODE + SIZE_RELADDR) -#define SIZE_OP_ABSENT_END SIZE_OPCODE - -#ifdef USE_COMBINATION_EXPLOSION_CHECK -# define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) -# define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR) -# define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR) -# define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) -#endif - -#define MC_ESC(syn) (syn)->meta_char_table.esc -#define MC_ANYCHAR(syn) (syn)->meta_char_table.anychar -#define MC_ANYTIME(syn) (syn)->meta_char_table.anytime -#define MC_ZERO_OR_ONE_TIME(syn) (syn)->meta_char_table.zero_or_one_time -#define MC_ONE_OR_MORE_TIME(syn) (syn)->meta_char_table.one_or_more_time -#define MC_ANYCHAR_ANYTIME(syn) (syn)->meta_char_table.anychar_anytime - -#define IS_MC_ESC_CODE(code, syn) \ - ((code) == MC_ESC(syn) && \ - !IS_SYNTAX_OP2((syn), ONIG_SYN_OP2_INEFFECTIVE_ESCAPE)) - - -#define SYN_POSIX_COMMON_OP \ - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET | \ - ONIG_SYN_OP_DECIMAL_BACKREF | \ - ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_ASTERISK_ZERO_INF | \ - ONIG_SYN_OP_LINE_ANCHOR | \ - ONIG_SYN_OP_ESC_CONTROL_CHARS ) - -#define SYN_GNU_REGEX_OP \ - ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | \ - ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_DECIMAL_BACKREF | \ - ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_LPAREN_SUBEXP | \ - ONIG_SYN_OP_VBAR_ALT | \ - ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF | \ - ONIG_SYN_OP_QMARK_ZERO_ONE | \ - ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR | ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR | \ - ONIG_SYN_OP_ESC_W_WORD | \ - ONIG_SYN_OP_ESC_B_WORD_BOUND | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | \ - ONIG_SYN_OP_ESC_S_WHITE_SPACE | ONIG_SYN_OP_ESC_D_DIGIT | \ - ONIG_SYN_OP_LINE_ANCHOR ) - -#define SYN_GNU_REGEX_BV \ - ( ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | \ - ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | ONIG_SYN_ALLOW_INVALID_INTERVAL | \ - ONIG_SYN_BACKSLASH_ESCAPE_IN_CC | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC ) - - -#define NCCLASS_FLAGS(cc) ((cc)->flags) -#define NCCLASS_FLAG_SET(cc,flag) (NCCLASS_FLAGS(cc) |= (flag)) -#define NCCLASS_FLAG_CLEAR(cc,flag) (NCCLASS_FLAGS(cc) &= ~(flag)) -#define IS_NCCLASS_FLAG_ON(cc,flag) ((NCCLASS_FLAGS(cc) & (flag)) != 0) - -/* cclass node */ -#define FLAG_NCCLASS_NOT (1<<0) - -#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT) -#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT) -#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT) - -typedef struct { - int type; - /* struct _Node* next; */ - /* unsigned int flags; */ -} NodeBase; - -typedef struct { - NodeBase base; - unsigned int flags; - BitSet bs; - BBuf* mbuf; /* multi-byte info or NULL */ -} CClassNode; - -typedef intptr_t OnigStackIndex; - -typedef struct _OnigStackType { - unsigned int type; - OnigStackIndex null_check; - union { - struct { - UChar *pcode; /* byte code position */ - UChar *pstr; /* string position */ - UChar *pstr_prev; /* previous char position of pstr */ -#ifdef USE_COMBINATION_EXPLOSION_CHECK - unsigned int state_check; -#endif - UChar *pkeep; /* keep pattern position */ - } state; - struct { - int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */ - UChar *pcode; /* byte code position (head of repeated target) */ - int num; /* repeat id */ - } repeat; - struct { - OnigStackIndex si; /* index of stack */ - } repeat_inc; - struct { - int num; /* memory num */ - UChar *pstr; /* start/end position */ - /* Following information is set, if this stack type is MEM-START */ - OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */ - OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */ - } mem; - struct { - int num; /* null check id */ - UChar *pstr; /* start position */ - } null_check; -#ifdef USE_SUBEXP_CALL - struct { - UChar *ret_addr; /* byte code position */ - int num; /* null check id */ - UChar *pstr; /* string position */ - } call_frame; -#endif - struct { - UChar *abs_pstr; /* absent start position */ - const UChar *end_pstr; /* end position */ - } absent_pos; -#ifdef USE_MATCH_CACHE - struct { - long index; /* index of the match cache buffer */ - uint8_t mask; /* bit-mask for the match cache buffer */ - } match_cache_point; -#endif - } u; -} OnigStackType; - -#ifdef USE_MATCH_CACHE -typedef struct { - UChar *addr; - long cache_point; - int outer_repeat_mem; - long num_cache_points_at_outer_repeat; - long num_cache_points_in_outer_repeat; - int lookaround_nesting; - UChar *match_addr; -} OnigCacheOpcode; -#endif - -typedef struct { - void* stack_p; - size_t stack_n; - OnigOptionType options; - OnigRegion* region; - const UChar* start; /* search start position */ - const UChar* gpos; /* global position (for \G: BEGIN_POSITION) */ -#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE - OnigPosition best_len; /* for ONIG_OPTION_FIND_LONGEST */ - UChar* best_s; -#endif -#ifdef USE_COMBINATION_EXPLOSION_CHECK - void* state_check_buff; - int state_check_buff_size; -#endif - int counter; - /* rb_hrtime_t from hrtime.h */ -#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL - int128_t end_time; -#else - uint64_t end_time; -#endif -#ifdef USE_MATCH_CACHE - int match_cache_status; - long num_fails; - long num_cache_opcodes; - OnigCacheOpcode* cache_opcodes; - long num_cache_points; - uint8_t* match_cache_buf; -#endif -} OnigMatchArg; - -#define NUM_CACHE_OPCODES_UNINIT 1 -#define NUM_CACHE_OPCODES_IMPOSSIBLE -1 - -#define MATCH_CACHE_STATUS_UNINIT 1 -#define MATCH_CACHE_STATUS_INIT 2 -#define MATCH_CACHE_STATUS_DISABLED -1 -#define MATCH_CACHE_STATUS_ENABLED 0 - -#define IS_CODE_SB_WORD(enc,code) \ - (ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code)) - -typedef struct OnigEndCallListItem { - struct OnigEndCallListItem* next; - void (*func)(void); -} OnigEndCallListItemType; - -extern void onig_add_end_call(void (*func)(void)); - - -#ifdef ONIG_DEBUG - -typedef struct { - short int opcode; - const char* name; - short int arg_type; -} OnigOpInfoType; - -extern OnigOpInfoType OnigOpInfo[]; - - -extern void onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc); - -# ifdef ONIG_DEBUG_STATISTICS -extern void onig_statistics_init(void); -extern void onig_print_statistics(FILE* f); -# endif -#endif - -#ifndef PRINTF_ARGS -#define PRINTF_ARGS(func, fmt, vargs) func -#endif - -extern UChar* onig_error_code_to_format(OnigPosition code); -PRINTF_ARGS(extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, va_list args), 6, 0); -PRINTF_ARGS(extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, ...), 6, 7); -extern int onig_bbuf_init(BBuf* buf, OnigDistance size); -extern int onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo); -#ifdef RUBY -extern int onig_compile_ruby(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo, const char *sourcefile, int sourceline); -#endif -extern void onig_transfer(regex_t* to, regex_t* from); -extern int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc); -extern int onig_is_code_in_cc_len(int enclen, OnigCodePoint code, CClassNode* cc); - -/* strend hash */ -typedef void hash_table_type; -#ifdef RUBY -# include "ruby/st.h" -#else -# include "st.h" -#endif -typedef st_data_t hash_data_type; - -extern hash_table_type* onig_st_init_strend_table_with_size(st_index_t size); -extern int onig_st_lookup_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value); -extern int onig_st_insert_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value); - -#ifdef RUBY -extern size_t onig_memsize(const regex_t *reg); -extern size_t onig_region_memsize(const struct re_registers *regs); -bool rb_reg_timeout_p(regex_t *reg, void *end_time); -#endif - -RUBY_SYMBOL_EXPORT_END - -#endif /* ONIGMO_REGINT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regparse.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regparse.h deleted file mode 100644 index de980d0..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regparse.h +++ /dev/null @@ -1,371 +0,0 @@ -#ifndef ONIGMO_REGPARSE_H -#define ONIGMO_REGPARSE_H -/********************************************************************** - regparse.h - Onigmo (Oniguruma-mod) (regular expression library) -**********************************************************************/ -/*- - * Copyright (c) 2002-2007 K.Kosako - * Copyright (c) 2011-2016 K.Takata - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "regint.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -/* node type */ -#define NT_STR 0 -#define NT_CCLASS 1 -#define NT_CTYPE 2 -#define NT_CANY 3 -#define NT_BREF 4 -#define NT_QTFR 5 -#define NT_ENCLOSE 6 -#define NT_ANCHOR 7 -#define NT_LIST 8 -#define NT_ALT 9 -#define NT_CALL 10 - -/* node type bit */ -#define NTYPE2BIT(type) (1<<(type)) - -#define BIT_NT_STR NTYPE2BIT(NT_STR) -#define BIT_NT_CCLASS NTYPE2BIT(NT_CCLASS) -#define BIT_NT_CTYPE NTYPE2BIT(NT_CTYPE) -#define BIT_NT_CANY NTYPE2BIT(NT_CANY) -#define BIT_NT_BREF NTYPE2BIT(NT_BREF) -#define BIT_NT_QTFR NTYPE2BIT(NT_QTFR) -#define BIT_NT_ENCLOSE NTYPE2BIT(NT_ENCLOSE) -#define BIT_NT_ANCHOR NTYPE2BIT(NT_ANCHOR) -#define BIT_NT_LIST NTYPE2BIT(NT_LIST) -#define BIT_NT_ALT NTYPE2BIT(NT_ALT) -#define BIT_NT_CALL NTYPE2BIT(NT_CALL) - -#define IS_NODE_TYPE_SIMPLE(type) \ - ((NTYPE2BIT(type) & (BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE |\ - BIT_NT_CANY | BIT_NT_BREF)) != 0) - -#define NTYPE(node) ((node)->u.base.type) -#define SET_NTYPE(node, ntype) \ - do { \ - int value = ntype; \ - memcpy(&((node)->u.base.type), &value, sizeof(int)); \ - } while (0) - -#define NSTR(node) (&((node)->u.str)) -#define NCCLASS(node) (&((node)->u.cclass)) -#define NCTYPE(node) (&((node)->u.ctype)) -#define NBREF(node) (&((node)->u.bref)) -#define NQTFR(node) (&((node)->u.qtfr)) -#define NENCLOSE(node) (&((node)->u.enclose)) -#define NANCHOR(node) (&((node)->u.anchor)) -#define NCONS(node) (&((node)->u.cons)) -#define NCALL(node) (&((node)->u.call)) - -#define NCAR(node) (NCONS(node)->car) -#define NCDR(node) (NCONS(node)->cdr) - - - -#define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML) -#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF) - -#define ENCLOSE_MEMORY (1<<0) -#define ENCLOSE_OPTION (1<<1) -#define ENCLOSE_STOP_BACKTRACK (1<<2) -#define ENCLOSE_CONDITION (1<<3) -#define ENCLOSE_ABSENT (1<<4) - -#define NODE_STR_MARGIN 16 -#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */ -#define NODE_BACKREFS_SIZE 6 - -#define NSTR_RAW (1<<0) /* by backslashed number */ -#define NSTR_AMBIG (1<<1) -#define NSTR_DONT_GET_OPT_INFO (1<<2) - -#define NSTRING_LEN(node) (OnigDistance )((node)->u.str.end - (node)->u.str.s) -#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW -#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW -#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG -#define NSTRING_SET_DONT_GET_OPT_INFO(node) \ - (node)->u.str.flag |= NSTR_DONT_GET_OPT_INFO -#define NSTRING_IS_RAW(node) (((node)->u.str.flag & NSTR_RAW) != 0) -#define NSTRING_IS_AMBIG(node) (((node)->u.str.flag & NSTR_AMBIG) != 0) -#define NSTRING_IS_DONT_GET_OPT_INFO(node) \ - (((node)->u.str.flag & NSTR_DONT_GET_OPT_INFO) != 0) - -#define BACKREFS_P(br) \ - (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static); - -#define NQ_TARGET_ISNOT_EMPTY 0 -#define NQ_TARGET_IS_EMPTY 1 -#define NQ_TARGET_IS_EMPTY_MEM 2 -#define NQ_TARGET_IS_EMPTY_REC 3 - -/* status bits */ -#define NST_MIN_FIXED (1<<0) -#define NST_MAX_FIXED (1<<1) -#define NST_CLEN_FIXED (1<<2) -#define NST_MARK1 (1<<3) -#define NST_MARK2 (1<<4) -#define NST_MEM_BACKREFED (1<<5) -#define NST_STOP_BT_SIMPLE_REPEAT (1<<6) -#define NST_RECURSION (1<<7) -#define NST_CALLED (1<<8) -#define NST_ADDR_FIXED (1<<9) -#define NST_NAMED_GROUP (1<<10) -#define NST_NAME_REF (1<<11) -#define NST_IN_REPEAT (1<<12) /* STK_REPEAT is nested in stack. */ -#define NST_NEST_LEVEL (1<<13) -#define NST_BY_NUMBER (1<<14) /* {n,m} */ - -#define SET_ENCLOSE_STATUS(node,f) (node)->u.enclose.state |= (f) -#define CLEAR_ENCLOSE_STATUS(node,f) (node)->u.enclose.state &= ~(f) - -#define IS_ENCLOSE_CALLED(en) (((en)->state & NST_CALLED) != 0) -#define IS_ENCLOSE_ADDR_FIXED(en) (((en)->state & NST_ADDR_FIXED) != 0) -#define IS_ENCLOSE_RECURSION(en) (((en)->state & NST_RECURSION) != 0) -#define IS_ENCLOSE_MARK1(en) (((en)->state & NST_MARK1) != 0) -#define IS_ENCLOSE_MARK2(en) (((en)->state & NST_MARK2) != 0) -#define IS_ENCLOSE_MIN_FIXED(en) (((en)->state & NST_MIN_FIXED) != 0) -#define IS_ENCLOSE_MAX_FIXED(en) (((en)->state & NST_MAX_FIXED) != 0) -#define IS_ENCLOSE_CLEN_FIXED(en) (((en)->state & NST_CLEN_FIXED) != 0) -#define IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(en) \ - (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0) -#define IS_ENCLOSE_NAMED_GROUP(en) (((en)->state & NST_NAMED_GROUP) != 0) -#define IS_ENCLOSE_NAME_REF(en) (((en)->state & NST_NAME_REF) != 0) - -#define SET_CALL_RECURSION(node) (node)->u.call.state |= NST_RECURSION -#define IS_CALL_RECURSION(cn) (((cn)->state & NST_RECURSION) != 0) -#define IS_CALL_NAME_REF(cn) (((cn)->state & NST_NAME_REF) != 0) -#define IS_BACKREF_NAME_REF(bn) (((bn)->state & NST_NAME_REF) != 0) -#define IS_BACKREF_NEST_LEVEL(bn) (((bn)->state & NST_NEST_LEVEL) != 0) -#define IS_QUANTIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0) -#define IS_QUANTIFIER_BY_NUMBER(qn) (((qn)->state & NST_BY_NUMBER) != 0) - -#define CALLNODE_REFNUM_UNDEF -1 - -typedef struct { - NodeBase base; - UChar* s; - UChar* end; - unsigned int flag; - int capa; /* (allocated size - 1) or 0: use buf[] */ - UChar buf[NODE_STR_BUF_SIZE]; -} StrNode; - -typedef struct { - NodeBase base; - int state; - struct _Node* target; - int lower; - int upper; - int greedy; - int target_empty_info; - struct _Node* head_exact; - struct _Node* next_head_exact; - int is_referred; /* include called node. don't eliminate even if {0} */ -#ifdef USE_COMBINATION_EXPLOSION_CHECK - int comb_exp_check_num; /* 1,2,3...: check, 0: no check */ -#endif -} QtfrNode; - -typedef struct { - NodeBase base; - int state; - int type; - int regnum; - OnigOptionType option; - AbsAddrType call_addr; - struct _Node* target; - /* for multiple call reference */ - OnigDistance min_len; /* min length (byte) */ - OnigDistance max_len; /* max length (byte) */ - int char_len; /* character length */ - int opt_count; /* referenced count in optimize_node_left() */ -} EncloseNode; - -#ifdef USE_SUBEXP_CALL - -typedef struct { - int offset; - struct _Node* target; -} UnsetAddr; - -typedef struct { - int num; - int alloc; - UnsetAddr* us; -} UnsetAddrList; - -typedef struct { - NodeBase base; - int state; - int group_num; - UChar* name; - UChar* name_end; - struct _Node* target; /* EncloseNode : ENCLOSE_MEMORY */ - UnsetAddrList* unset_addr_list; -} CallNode; - -#endif - -typedef struct { - NodeBase base; - int state; - int back_num; - int back_static[NODE_BACKREFS_SIZE]; - int* back_dynamic; - int nest_level; -} BRefNode; - -typedef struct { - NodeBase base; - int type; - struct _Node* target; - int char_len; - int ascii_range; -} AnchorNode; - -typedef struct { - NodeBase base; - struct _Node* car; - struct _Node* cdr; -} ConsAltNode; - -typedef struct { - NodeBase base; - int ctype; - int not; - int ascii_range; -} CtypeNode; - -typedef struct _Node { - union { - NodeBase base; - StrNode str; - CClassNode cclass; - QtfrNode qtfr; - EncloseNode enclose; - BRefNode bref; - AnchorNode anchor; - ConsAltNode cons; - CtypeNode ctype; -#ifdef USE_SUBEXP_CALL - CallNode call; -#endif - } u; -} Node; - - -#define NULL_NODE ((Node* )0) - -#define SCANENV_MEMNODES_SIZE 8 -#define SCANENV_MEM_NODES(senv) \ - (IS_NOT_NULL((senv)->mem_nodes_dynamic) ? \ - (senv)->mem_nodes_dynamic : (senv)->mem_nodes_static) - -typedef struct { - OnigOptionType option; - OnigCaseFoldType case_fold_flag; - OnigEncoding enc; - const OnigSyntaxType* syntax; - BitStatusType capture_history; - BitStatusType bt_mem_start; - BitStatusType bt_mem_end; - BitStatusType backrefed_mem; - UChar* pattern; - UChar* pattern_end; - UChar* error; - UChar* error_end; - regex_t* reg; /* for reg->names only */ -#ifdef USE_SUBEXP_CALL - UnsetAddrList* unset_addr_list; -#endif - int num_call; - int num_mem; -#ifdef USE_NAMED_GROUP - int num_named; -#endif - int mem_alloc; - Node* mem_nodes_static[SCANENV_MEMNODES_SIZE]; - Node** mem_nodes_dynamic; -#ifdef USE_COMBINATION_EXPLOSION_CHECK - int num_comb_exp_check; - int comb_exp_max_regnum; - int curr_max_regnum; - int has_recursion; -#endif - unsigned int parse_depth; - int warnings_flag; -#ifdef RUBY - const char* sourcefile; - int sourceline; -#endif -} ScanEnv; - - -#define IS_SYNTAX_OP(syn, opm) (((syn)->op & (opm)) != 0) -#define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0) -#define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0) - -#ifdef USE_NAMED_GROUP -typedef struct { - int new_val; -} GroupNumRemap; - -extern int onig_renumber_name_table(regex_t* reg, GroupNumRemap* map); -#endif - -extern int onig_strncmp(const UChar* s1, const UChar* s2, size_t n); -extern void onig_strcpy(UChar* dest, const UChar* src, const UChar* end); -extern void onig_scan_env_set_error_string(ScanEnv* env, int ecode, UChar* arg, UChar* arg_end); -extern int onig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc); -extern void onig_reduce_nested_quantifier(Node* pnode, Node* cnode); -extern void onig_node_conv_to_str_node(Node* node, int raw); -extern int onig_node_str_cat(Node* node, const UChar* s, const UChar* end); -extern int onig_node_str_set(Node* node, const UChar* s, const UChar* end); -extern void onig_node_free(Node* node); -extern Node* onig_node_new_enclose(int type); -extern Node* onig_node_new_anchor(int type); -extern Node* onig_node_new_str(const UChar* s, const UChar* end); -extern Node* onig_node_new_list(Node* left, Node* right); -extern Node* onig_node_list_add(Node* list, Node* x); -extern Node* onig_node_new_alt(Node* left, Node* right); -extern void onig_node_str_clear(Node* node); -extern int onig_names_free(regex_t* reg); -extern int onig_names_copy(regex_t* reg, regex_t* oreg); -extern int onig_parse_make_tree(Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env); -extern int onig_free_shared_cclass_table(void); - -#ifdef ONIG_DEBUG -# ifdef USE_NAMED_GROUP -extern int onig_print_names(FILE*, regex_t*); -# endif -#endif - -RUBY_SYMBOL_EXPORT_END - -#endif /* ONIGMO_REGPARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h deleted file mode 100644 index b82bd48..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h +++ /dev/null @@ -1,5 +0,0 @@ -#define RUBY_REVISION "32c733f57b" -#define RUBY_FULL_REVISION "32c733f57bb91e22972319ee63eac9521d954ebc" -#define RUBY_RELEASE_YEAR 2024 -#define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 7 diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h deleted file mode 100644 index 26d1d67..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef RUBY_RJIT_H -#define RUBY_RJIT_H 1 -/********************************************************************** - - rjit.h - Interface to RJIT - - Copyright (C) 2023 Takashi Kokubun . - -**********************************************************************/ - -#include "ruby/internal/config.h" // defines USE_RJIT -#include "ruby/internal/stdbool.h" -#include "vm_core.h" - -# if USE_RJIT - -#include "ruby.h" -#include "vm_core.h" - -// RJIT options which can be defined on the MRI command line. -struct rb_rjit_options { - // Converted from "rjit" feature flag to tell the enablement - // information to ruby_show_version(). - bool on; - // Size of executable memory block in MiB - unsigned int exec_mem_size; - // Number of calls to trigger JIT compilation - unsigned int call_threshold; - // Collect RJIT statistics - bool stats; - // Do not start RJIT until RJIT.enable is called - bool disable; - // Allow TracePoint during JIT compilation - bool trace; - // Trace side exit locations - bool trace_exits; - // Enable disasm of all JIT code - bool dump_disasm; - // Verify context objects - bool verify_ctx; -}; - -RUBY_SYMBOL_EXPORT_BEGIN -RUBY_EXTERN struct rb_rjit_options rb_rjit_opts; -RUBY_EXTERN bool rb_rjit_call_p; - -#define rb_rjit_call_threshold() rb_rjit_opts.call_threshold - -extern void rb_rjit_compile(const rb_iseq_t *iseq); -RUBY_SYMBOL_EXPORT_END - -extern void rb_rjit_cancel_all(const char *reason); -extern void rb_rjit_init(const struct rb_rjit_options *opts); -extern void rb_rjit_free_iseq(const rb_iseq_t *iseq); -extern void rb_rjit_iseq_update_references(struct rb_iseq_constant_body *const body); -extern void rb_rjit_mark(void); -extern void rb_rjit_iseq_mark(VALUE rjit_blocks); -extern void rjit_notify_waitpid(int exit_code); - -extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -extern void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme); -extern void rb_rjit_before_ractor_spawn(void); -extern void rb_rjit_constant_state_changed(ID id); -extern void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); -extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); - -extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -extern void rb_rjit_before_ractor_spawn(void); -extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); -extern void rb_rjit_collect_vm_usage_insn(int insn); - -extern bool rb_rjit_enabled; -extern bool rb_rjit_stats_enabled; -extern bool rb_rjit_trace_exits_enabled; - -# else // USE_RJIT - -static inline void rb_rjit_compile(const rb_iseq_t *iseq){} - -static inline void rb_rjit_cancel_all(const char *reason){} -static inline void rb_rjit_free_iseq(const rb_iseq_t *iseq){} -static inline void rb_rjit_mark(void){} - -static inline void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} -static inline void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme) {} -static inline void rb_rjit_before_ractor_spawn(void) {} -static inline void rb_rjit_constant_state_changed(ID id) {} -static inline void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {} -static inline void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events) {} - -#define rb_rjit_enabled false -#define rb_rjit_call_p false -#define rb_rjit_stats_enabled false -#define rb_rjit_trace_exits_enabled false - -#define rb_rjit_call_threshold() UINT_MAX - -static inline void rb_rjit_collect_vm_usage_insn(int insn) {} - -# endif // USE_RJIT -#endif // RUBY_RJIT_H diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h deleted file mode 100644 index 029f811..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +++ /dev/null @@ -1,165 +0,0 @@ -// This file is parsed by tool/rjit/generate.rb to generate rjit_c.rb -#ifndef RJIT_C_H -#define RJIT_C_H - -#include "ruby/internal/config.h" -#include "internal/string.h" -#include "internal/struct.h" -#include "internal/variable.h" -#include "vm_core.h" -#include "vm_callinfo.h" -#include "builtin.h" -#include "ccan/list/list.h" -#include "rjit.h" -#include "shape.h" - -extern uint8_t *rb_rjit_mem_block; - -#define RJIT_RUNTIME_COUNTERS(...) struct rb_rjit_runtime_counters { size_t __VA_ARGS__; }; -RJIT_RUNTIME_COUNTERS( - rjit_insns_count, - - send_args_splat_kw_splat, - send_args_splat, - send_args_splat_not_array, - send_args_splat_length_not_equal, - send_args_splat_cfunc_var_args, - send_args_splat_arity_error, - send_args_splat_ruby2_hash, - send_args_splat_cfunc_zuper, - send_args_splat_cfunc_ruby2_keywords, - send_kw_splat, - send_kwarg, - send_klass_megamorphic, - send_missing_cme, - send_private, - send_protected_check_failed, - send_tailcall, - send_notimplemented, - send_missing, - send_bmethod, - send_alias, - send_undef, - send_zsuper, - send_refined, - send_stackoverflow, - send_arity, - send_c_tracing, - send_is_a_class_mismatch, - send_instance_of_class_mismatch, - send_keywords, - - send_blockiseq, - send_block_handler, - send_block_setup, - send_block_not_nil, - send_block_not_proxy, - send_block_arg, - - send_iseq_kwparam, - send_iseq_accepts_no_kwarg, - send_iseq_has_opt, - send_iseq_has_kwrest, - send_iseq_ruby2_keywords, - send_iseq_has_rest_and_captured, - send_iseq_has_rest_and_kw_supplied, - send_iseq_has_no_kw, - send_iseq_zsuper, - send_iseq_materialized_block, - send_iseq_has_rest, - send_iseq_block_arg0_splat, - send_iseq_kw_call, - send_iseq_kw_splat, - send_iseq_splat, - send_iseq_has_rest_and_optional, - send_iseq_arity_error, - send_iseq_missing_optional_kw, - send_iseq_too_many_kwargs, - send_iseq_kwargs_mismatch, - send_iseq_splat_with_kw, - send_iseq_splat_arity_error, - send_iseq_has_rest_and_splat_not_equal, - - send_cfunc_variadic, - send_cfunc_too_many_args, - send_cfunc_ruby_array_varg, - send_cfunc_splat_with_kw, - send_cfunc_tracing, - send_cfunc_argc_mismatch, - send_cfunc_toomany_args, - - send_attrset_splat, - send_attrset_kwarg, - send_attrset_method, - - send_ivar_splat, - send_ivar_opt_send, - - send_optimized_send_no_args, - send_optimized_send_not_sym_or_str, - send_optimized_send_mid_class_changed, - send_optimized_send_mid_id_changed, - send_optimized_send_null_mid, - send_optimized_send_send, - send_optimized_call_block, - send_optimized_call_kwarg, - send_optimized_call_splat, - send_optimized_struct_aref_error, - - send_optimized_block_call, - send_optimized_struct_aset, - - send_bmethod_not_iseq, - send_bmethod_blockarg, - - invokesuper_me_changed, - invokesuper_block, - - invokeblock_none, - invokeblock_symbol, - invokeblock_proc, - invokeblock_tag_changed, - invokeblock_iseq_block_changed, - invokeblock_iseq_arity, - invokeblock_iseq_arg0_splat, - invokeblock_ifunc_args_splat, - invokeblock_ifunc_kw_splat, - invokeblock_iseq_arg0_args_splat, - invokeblock_iseq_arg0_has_kw, - - getivar_megamorphic, - getivar_not_heap, - getivar_special_const, - getivar_too_complex, - - optaref_arg_not_fixnum, - optaref_argc_not_one, - optaref_recv_not_array, - optaref_recv_not_hash, - optaref_send, - - optgetconst_not_cached, - optgetconst_cref, - optgetconst_cache_miss, - - setivar_frozen, - setivar_not_heap, - setivar_megamorphic, - setivar_too_complex, - - expandarray_splat, - expandarray_postarg, - expandarray_not_array, - expandarray_rhs_too_small, - - getblockpp_block_param_modified, - getblockpp_block_handler_none, - getblockpp_not_gc_guarded, - getblockpp_not_iseq_block, - - compiled_block_count -) -#undef RJIT_RUNTIME_COUNTERS -extern struct rb_rjit_runtime_counters rb_rjit_counters; - -#endif /* RJIT_C_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h deleted file mode 100644 index d8f7ddd..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef RUBY_TOPLEVEL_ASSERT_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_TOPLEVEL_ASSERT_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ -#include "ruby/assert.h" -#undef assert -#define assert RUBY_ASSERT_NDEBUG - -#endif /* RUBY_TOPLEVEL_ASSERT_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h deleted file mode 100644 index 57d3410..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +++ /dev/null @@ -1,23 +0,0 @@ -#include "ruby/atomic.h" - -/* shim macros only */ -#define ATOMIC_ADD(var, val) RUBY_ATOMIC_ADD(var, val) -#define ATOMIC_CAS(var, oldval, newval) RUBY_ATOMIC_CAS(var, oldval, newval) -#define ATOMIC_DEC(var) RUBY_ATOMIC_DEC(var) -#define ATOMIC_EXCHANGE(var, val) RUBY_ATOMIC_EXCHANGE(var, val) -#define ATOMIC_FETCH_ADD(var, val) RUBY_ATOMIC_FETCH_ADD(var, val) -#define ATOMIC_FETCH_SUB(var, val) RUBY_ATOMIC_FETCH_SUB(var, val) -#define ATOMIC_INC(var) RUBY_ATOMIC_INC(var) -#define ATOMIC_OR(var, val) RUBY_ATOMIC_OR(var, val) -#define ATOMIC_PTR_CAS(var, oldval, newval) RUBY_ATOMIC_PTR_CAS(var, oldval, newval) -#define ATOMIC_PTR_EXCHANGE(var, val) RUBY_ATOMIC_PTR_EXCHANGE(var, val) -#define ATOMIC_SET(var, val) RUBY_ATOMIC_SET(var, val) -#define ATOMIC_SIZE_ADD(var, val) RUBY_ATOMIC_SIZE_ADD(var, val) -#define ATOMIC_SIZE_CAS(var, oldval, newval) RUBY_ATOMIC_SIZE_CAS(var, oldval, newval) -#define ATOMIC_SIZE_DEC(var) RUBY_ATOMIC_SIZE_DEC(var) -#define ATOMIC_SIZE_EXCHANGE(var, val) RUBY_ATOMIC_SIZE_EXCHANGE(var, val) -#define ATOMIC_SIZE_INC(var) RUBY_ATOMIC_SIZE_INC(var) -#define ATOMIC_SIZE_SUB(var, val) RUBY_ATOMIC_SIZE_SUB(var, val) -#define ATOMIC_SUB(var, val) RUBY_ATOMIC_SUB(var, val) -#define ATOMIC_VALUE_CAS(var, oldval, val) RUBY_ATOMIC_VALUE_CAS(var, oldval, val) -#define ATOMIC_VALUE_EXCHANGE(var, val) RUBY_ATOMIC_VALUE_EXCHANGE(var, val) diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h deleted file mode 100644 index 08111a8..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h +++ /dev/null @@ -1,1350 +0,0 @@ -#ifndef RUBY_RUBYPARSER_H -#define RUBY_RUBYPARSER_H 1 -/* - * This is a header file for librubyparser interface - */ - -#include /* for va_list */ -#include - -#ifdef UNIVERSAL_PARSER - -#define rb_encoding const void -#define OnigCodePoint unsigned int -#include "parser_st.h" -#ifndef RUBY_RUBY_H -#include "parser_value.h" -#endif - -#else - -#include "ruby/encoding.h" - -#endif - -#ifndef FLEX_ARY_LEN -/* From internal/compilers.h */ -/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define FLEX_ARY_LEN /* VALUE ary[]; */ -#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) -# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */ -#else -# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */ -#endif -#endif - -#if defined(__GNUC__) -# if defined(__MINGW_PRINTF_FORMAT) -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index))) -# else -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index))) -# endif -#elif defined(__clang__) -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index))) -#else -# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) -#endif - -/* - * Parser String - */ -enum rb_parser_string_coderange_type { - /** The object's coderange is unclear yet. */ - RB_PARSER_ENC_CODERANGE_UNKNOWN = 0, - RB_PARSER_ENC_CODERANGE_7BIT = 1, - RB_PARSER_ENC_CODERANGE_VALID = 2, - RB_PARSER_ENC_CODERANGE_BROKEN = 3 -}; - -typedef struct rb_parser_string { - enum rb_parser_string_coderange_type coderange; - rb_encoding *enc; - /* Length of the string, not including terminating NUL character. */ - long len; - /* Pointer to the contents of the string. */ - char *ptr; -} rb_parser_string_t; - -enum rb_parser_shareability { - rb_parser_shareable_none, - rb_parser_shareable_literal, - rb_parser_shareable_copy, - rb_parser_shareable_everything, -}; - -typedef void* rb_parser_input_data; - -/* - * AST Node - */ -enum node_type { - NODE_SCOPE, - NODE_BLOCK, - NODE_IF, - NODE_UNLESS, - NODE_CASE, - NODE_CASE2, - NODE_CASE3, - NODE_WHEN, - NODE_IN, - NODE_WHILE, - NODE_UNTIL, - NODE_ITER, - NODE_FOR, - NODE_FOR_MASGN, - NODE_BREAK, - NODE_NEXT, - NODE_REDO, - NODE_RETRY, - NODE_BEGIN, - NODE_RESCUE, - NODE_RESBODY, - NODE_ENSURE, - NODE_AND, - NODE_OR, - NODE_MASGN, - NODE_LASGN, - NODE_DASGN, - NODE_GASGN, - NODE_IASGN, - NODE_CDECL, - NODE_CVASGN, - NODE_OP_ASGN1, - NODE_OP_ASGN2, - NODE_OP_ASGN_AND, - NODE_OP_ASGN_OR, - NODE_OP_CDECL, - NODE_CALL, - NODE_OPCALL, - NODE_FCALL, - NODE_VCALL, - NODE_QCALL, - NODE_SUPER, - NODE_ZSUPER, - NODE_LIST, - NODE_ZLIST, - NODE_HASH, - NODE_RETURN, - NODE_YIELD, - NODE_LVAR, - NODE_DVAR, - NODE_GVAR, - NODE_IVAR, - NODE_CONST, - NODE_CVAR, - NODE_NTH_REF, - NODE_BACK_REF, - NODE_MATCH, - NODE_MATCH2, - NODE_MATCH3, - NODE_INTEGER, - NODE_FLOAT, - NODE_RATIONAL, - NODE_IMAGINARY, - NODE_STR, - NODE_DSTR, - NODE_XSTR, - NODE_DXSTR, - NODE_EVSTR, - NODE_REGX, - NODE_DREGX, - NODE_ONCE, - NODE_ARGS, - NODE_ARGS_AUX, - NODE_OPT_ARG, - NODE_KW_ARG, - NODE_POSTARG, - NODE_ARGSCAT, - NODE_ARGSPUSH, - NODE_SPLAT, - NODE_BLOCK_PASS, - NODE_DEFN, - NODE_DEFS, - NODE_ALIAS, - NODE_VALIAS, - NODE_UNDEF, - NODE_CLASS, - NODE_MODULE, - NODE_SCLASS, - NODE_COLON2, - NODE_COLON3, - NODE_DOT2, - NODE_DOT3, - NODE_FLIP2, - NODE_FLIP3, - NODE_SELF, - NODE_NIL, - NODE_TRUE, - NODE_FALSE, - NODE_ERRINFO, - NODE_DEFINED, - NODE_POSTEXE, - NODE_SYM, - NODE_DSYM, - NODE_ATTRASGN, - NODE_LAMBDA, - NODE_ARYPTN, - NODE_HSHPTN, - NODE_FNDPTN, - NODE_ERROR, - NODE_LINE, - NODE_FILE, - NODE_ENCODING, - NODE_LAST -}; - -typedef struct rb_ast_id_table { - int size; - ID ids[FLEX_ARY_LEN]; -} rb_ast_id_table_t; - -typedef struct rb_code_position_struct { - int lineno; - int column; -} rb_code_position_t; - -typedef struct rb_code_location_struct { - rb_code_position_t beg_pos; - rb_code_position_t end_pos; -} rb_code_location_t; -#define YYLTYPE rb_code_location_t -#define YYLTYPE_IS_DECLARED 1 - -typedef struct rb_parser_ast_token { - int id; - const char *type_name; - rb_parser_string_t *str; - rb_code_location_t loc; -} rb_parser_ast_token_t; - -/* - * Array-like object for parser - */ -typedef void* rb_parser_ary_data; - -enum rb_parser_ary_data_type { - PARSER_ARY_DATA_AST_TOKEN = 1, - PARSER_ARY_DATA_SCRIPT_LINE, - PARSER_ARY_DATA_NODE -}; - -typedef struct rb_parser_ary { - enum rb_parser_ary_data_type data_type; - rb_parser_ary_data *data; - long len; // current size - long capa; // capacity -} rb_parser_ary_t; - -/* Header part of AST Node */ -typedef struct RNode { - VALUE flags; - rb_code_location_t nd_loc; - int node_id; -} NODE; - -typedef struct RNode_SCOPE { - NODE node; - - rb_ast_id_table_t *nd_tbl; - struct RNode *nd_body; - struct RNode_ARGS *nd_args; -} rb_node_scope_t; - -typedef struct RNode_BLOCK { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_end; - struct RNode *nd_next; -} rb_node_block_t; - -typedef struct RNode_IF { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - struct RNode *nd_else; -} rb_node_if_t; - -typedef struct RNode_UNLESS { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - struct RNode *nd_else; - rb_code_location_t keyword_loc; - rb_code_location_t then_keyword_loc; - rb_code_location_t end_keyword_loc; -} rb_node_unless_t; - -typedef struct RNode_CASE { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - rb_code_location_t case_keyword_loc; - rb_code_location_t end_keyword_loc; -} rb_node_case_t; - -typedef struct RNode_CASE2 { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - rb_code_location_t case_keyword_loc; - rb_code_location_t end_keyword_loc; -} rb_node_case2_t; - -typedef struct RNode_CASE3 { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - rb_code_location_t case_keyword_loc; - rb_code_location_t end_keyword_loc; -} rb_node_case3_t; - -typedef struct RNode_WHEN { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - struct RNode *nd_next; - rb_code_location_t keyword_loc; - rb_code_location_t then_keyword_loc; -} rb_node_when_t; - -typedef struct RNode_IN { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - struct RNode *nd_next; -} rb_node_in_t; - -typedef struct RNode_LOOP { - NODE node; - - struct RNode *nd_cond; - struct RNode *nd_body; - long nd_state; - rb_code_location_t keyword_loc; - rb_code_location_t closing_loc; -} rb_node_while_t, rb_node_until_t; - -typedef struct RNode_ITER { - NODE node; - - struct RNode *nd_body; - struct RNode *nd_iter; -} rb_node_iter_t, rb_node_for_t; - -typedef struct RNode_FOR_MASGN { - NODE node; - - struct RNode *nd_var; -} rb_node_for_masgn_t; - -typedef struct RNode_EXITS { - NODE node; - - struct RNode *nd_chain; - struct RNode *nd_stts; - rb_code_location_t keyword_loc; -} rb_node_exits_t, rb_node_break_t, rb_node_next_t, rb_node_redo_t; - -typedef struct RNode_RETRY { - NODE node; -} rb_node_retry_t; - -typedef struct RNode_BEGIN { - NODE node; - - struct RNode *nd_body; -} rb_node_begin_t; - -typedef struct RNode_RESCUE { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_resq; - struct RNode *nd_else; -} rb_node_rescue_t; - -typedef struct RNode_RESBODY { - NODE node; - - struct RNode *nd_args; - struct RNode *nd_exc_var; - struct RNode *nd_body; - struct RNode *nd_next; -} rb_node_resbody_t; - -typedef struct RNode_ENSURE { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_ensr; -} rb_node_ensure_t; - -typedef struct { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; - rb_code_location_t operator_loc; -} rb_node_and_t, rb_node_or_t; - -typedef struct RNode_MASGN { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; - struct RNode *nd_args; -} rb_node_masgn_t; - -typedef struct RNode_LASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_lasgn_t; - -typedef struct RNode_DASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_dasgn_t; - -typedef struct RNode_GASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_gasgn_t; - -typedef struct RNode_IASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_iasgn_t; - -typedef struct RNode_CDECL { - NODE node; - - ID nd_vid; - struct RNode *nd_value; - struct RNode *nd_else; - enum rb_parser_shareability shareability; -} rb_node_cdecl_t; - -typedef struct RNode_CVASGN { - NODE node; - - ID nd_vid; - struct RNode *nd_value; -} rb_node_cvasgn_t; - -typedef struct RNode_OP_ASGN1 { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_index; - struct RNode *nd_rvalue; - rb_code_location_t call_operator_loc; - rb_code_location_t opening_loc; - rb_code_location_t closing_loc; - rb_code_location_t binary_operator_loc; -} rb_node_op_asgn1_t; - -typedef struct RNode_OP_ASGN2 { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_value; - ID nd_vid; - ID nd_mid; - bool nd_aid; - rb_code_location_t call_operator_loc; - rb_code_location_t message_loc; - rb_code_location_t binary_operator_loc; -} rb_node_op_asgn2_t; - -typedef struct RNode_OP_ASGN_AND { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; -} rb_node_op_asgn_and_t; - -typedef struct RNode_OP_ASGN_OR { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; -} rb_node_op_asgn_or_t; - -typedef struct RNode_OP_CDECL { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_value; - ID nd_aid; - enum rb_parser_shareability shareability; -} rb_node_op_cdecl_t; - -typedef struct RNode_CALL { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_call_t; - -typedef struct RNode_OPCALL { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_opcall_t; - -typedef struct RNode_FCALL { - NODE node; - - ID nd_mid; - struct RNode *nd_args; -} rb_node_fcall_t; - -typedef struct RNode_VCALL { - NODE node; - - ID nd_mid; -} rb_node_vcall_t; - -typedef struct RNode_QCALL { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_qcall_t; - -typedef struct RNode_SUPER { - NODE node; - - struct RNode *nd_args; -} rb_node_super_t; - -typedef struct RNode_ZSUPER { - NODE node; -} rb_node_zsuper_t; - -/* - - Structure of LIST: - - LIST +--> LIST - * head --> element | * head - * alen (length of list) | * nd_end (point to the last LIST) - * next -----------------+ * next - -*/ -typedef struct RNode_LIST { - NODE node; - - struct RNode *nd_head; /* element */ - union { - long nd_alen; - struct RNode *nd_end; /* Second list node has this structure */ - } as; - struct RNode *nd_next; /* next list node */ -} rb_node_list_t; - -typedef struct RNode_ZLIST { - NODE node; -} rb_node_zlist_t; - -typedef struct RNode_HASH { - NODE node; - - struct RNode *nd_head; - long nd_brace; -} rb_node_hash_t; - -typedef struct RNode_RETURN { - NODE node; - - struct RNode *nd_stts; - rb_code_location_t keyword_loc; -} rb_node_return_t; - -typedef struct RNode_YIELD { - NODE node; - - struct RNode *nd_head; -} rb_node_yield_t; - -typedef struct RNode_LVAR { - NODE node; - - ID nd_vid; -} rb_node_lvar_t; - -typedef struct RNode_DVAR { - NODE node; - - ID nd_vid; -} rb_node_dvar_t; - -typedef struct RNode_GVAR { - NODE node; - - ID nd_vid; -} rb_node_gvar_t; - -typedef struct RNode_IVAR { - NODE node; - - ID nd_vid; -} rb_node_ivar_t; - -typedef struct RNode_CONST { - NODE node; - - ID nd_vid; -} rb_node_const_t; - -typedef struct RNode_CVAR { - NODE node; - - ID nd_vid; -} rb_node_cvar_t; - -typedef struct RNode_NTH_REF { - NODE node; - - long nd_nth; -} rb_node_nth_ref_t; - -typedef struct RNode_BACK_REF { - NODE node; - - long nd_nth; -} rb_node_back_ref_t; - -typedef struct RNode_MATCH2 { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_value; - struct RNode *nd_args; -} rb_node_match2_t; - -typedef struct RNode_MATCH3 { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_value; -} rb_node_match3_t; - -typedef struct RNode_INTEGER { - NODE node; - - char *val; - int minus; - int base; -} rb_node_integer_t; - -typedef struct RNode_FLOAT { - NODE node; - - char *val; - int minus; -} rb_node_float_t; - -typedef struct RNode_RATIONAL { - NODE node; - - char *val; - int minus; - int base; - int seen_point; -} rb_node_rational_t; - -enum rb_numeric_type { - integer_literal, - float_literal, - rational_literal -}; - -typedef struct RNode_IMAGINARY { - NODE node; - - char *val; - int minus; - int base; - int seen_point; - enum rb_numeric_type type; -} rb_node_imaginary_t; - -typedef struct RNode_STR { - NODE node; - - struct rb_parser_string *string; -} rb_node_str_t; - -/* NODE_DSTR, NODE_DXSTR, NODE_DREGX, NODE_DSYM */ -typedef struct RNode_DSTR { - NODE node; - - struct rb_parser_string *string; - union { - long nd_alen; - long nd_cflag; - struct RNode *nd_end; /* Second dstr node has this structure. See also RNode_LIST */ - } as; - struct RNode_LIST *nd_next; -} rb_node_dstr_t; - -typedef rb_node_str_t rb_node_xstr_t; - -typedef rb_node_dstr_t rb_node_dxstr_t; - -typedef struct RNode_EVSTR { - NODE node; - - struct RNode *nd_body; -} rb_node_evstr_t; - -typedef struct RNode_REGX { /* also RNode_MATCH */ - NODE node; - - struct rb_parser_string *string; - int options; -} rb_node_regx_t, rb_node_match_t; - -typedef rb_node_dstr_t rb_node_dregx_t; - -typedef struct RNode_ONCE { - NODE node; - - struct RNode *nd_body; -} rb_node_once_t; - -struct rb_args_info { - NODE *pre_init; - NODE *post_init; - - int pre_args_num; /* count of mandatory pre-arguments */ - int post_args_num; /* count of mandatory post-arguments */ - - ID first_post_arg; - - ID rest_arg; - ID block_arg; - - struct RNode_KW_ARG *kw_args; - NODE *kw_rest_arg; - - struct RNode_OPT_ARG *opt_args; - unsigned int no_kwarg: 1; - unsigned int ruby2_keywords: 1; - unsigned int forwarding: 1; -}; - -typedef struct RNode_ARGS { - NODE node; - - struct rb_args_info nd_ainfo; -} rb_node_args_t; - -typedef struct RNode_ARGS_AUX { - NODE node; - - ID nd_pid; - int nd_plen; - struct RNode *nd_next; -} rb_node_args_aux_t; - -typedef struct RNode_OPT_ARG { - NODE node; - - struct RNode *nd_body; - struct RNode_OPT_ARG *nd_next; -} rb_node_opt_arg_t; - -typedef struct RNode_KW_ARG { - NODE node; - - struct RNode *nd_body; - struct RNode_KW_ARG *nd_next; -} rb_node_kw_arg_t; - -typedef struct RNode_POSTARG { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; -} rb_node_postarg_t; - -typedef struct RNode_ARGSCAT { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_argscat_t; - -typedef struct RNode_ARGSPUSH { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; -} rb_node_argspush_t; - -typedef struct RNode_SPLAT { - NODE node; - - struct RNode *nd_head; - rb_code_location_t operator_loc; -} rb_node_splat_t; - -typedef struct RNode_BLOCK_PASS { - NODE node; - - struct RNode *nd_head; - struct RNode *nd_body; - unsigned int forwarding: 1; - rb_code_location_t operator_loc; -} rb_node_block_pass_t; - -typedef struct RNode_DEFN { - NODE node; - - ID nd_mid; - struct RNode *nd_defn; -} rb_node_defn_t; - -typedef struct RNode_DEFS { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_defn; -} rb_node_defs_t; - -typedef struct RNode_ALIAS { - NODE node; - - struct RNode *nd_1st; - struct RNode *nd_2nd; - rb_code_location_t keyword_loc; -} rb_node_alias_t; - -typedef struct RNode_VALIAS { - NODE node; - - ID nd_alias; - ID nd_orig; - rb_code_location_t keyword_loc; -} rb_node_valias_t; - -typedef struct RNode_UNDEF { - NODE node; - - rb_parser_ary_t *nd_undefs; - rb_code_location_t keyword_loc; -} rb_node_undef_t; - -typedef struct RNode_CLASS { - NODE node; - - struct RNode *nd_cpath; - struct RNode *nd_body; - struct RNode *nd_super; -} rb_node_class_t; - -typedef struct RNode_MODULE { - NODE node; - - struct RNode *nd_cpath; - struct RNode *nd_body; -} rb_node_module_t; - -typedef struct RNode_SCLASS { - NODE node; - - struct RNode *nd_recv; - struct RNode *nd_body; -} rb_node_sclass_t; - -typedef struct RNode_COLON2 { - NODE node; - - struct RNode *nd_head; - ID nd_mid; -} rb_node_colon2_t; - -typedef struct RNode_COLON3 { - NODE node; - - ID nd_mid; -} rb_node_colon3_t; - -/* NODE_DOT2, NODE_DOT3, NODE_FLIP2, NODE_FLIP3 */ -typedef struct RNode_DOTS { - NODE node; - - struct RNode *nd_beg; - struct RNode *nd_end; -} rb_node_dot2_t, rb_node_dot3_t, rb_node_flip2_t, rb_node_flip3_t; - -typedef struct RNode_SELF { - NODE node; - - long nd_state; /* Default 1. See NEW_SELF. */ -} rb_node_self_t; - -typedef struct RNode_NIL { - NODE node; -} rb_node_nil_t; - -typedef struct RNode_TRUE { - NODE node; -} rb_node_true_t; - -typedef struct RNode_FALSE { - NODE node; -} rb_node_false_t; - -typedef struct RNode_ERRINFO { - NODE node; -} rb_node_errinfo_t; - -typedef struct RNode_DEFINED { - NODE node; - - struct RNode *nd_head; -} rb_node_defined_t; - -typedef struct RNode_POSTEXE { - NODE node; - - struct RNode *nd_body; -} rb_node_postexe_t; - -typedef struct RNode_SYM { - NODE node; - - struct rb_parser_string *string; -} rb_node_sym_t; - -typedef rb_node_dstr_t rb_node_dsym_t; - -typedef struct RNode_ATTRASGN { - NODE node; - - struct RNode *nd_recv; - ID nd_mid; - struct RNode *nd_args; -} rb_node_attrasgn_t; - -typedef struct RNode_LAMBDA { - NODE node; - - struct RNode *nd_body; -} rb_node_lambda_t; - -typedef struct RNode_ARYPTN { - NODE node; - - struct RNode *nd_pconst; - NODE *pre_args; - NODE *rest_arg; - NODE *post_args; -} rb_node_aryptn_t; - -typedef struct RNode_HSHPTN { - NODE node; - - struct RNode *nd_pconst; - struct RNode *nd_pkwargs; - struct RNode *nd_pkwrestarg; -} rb_node_hshptn_t; - -typedef struct RNode_FNDPTN { - NODE node; - - struct RNode *nd_pconst; - NODE *pre_rest_arg; - NODE *args; - NODE *post_rest_arg; -} rb_node_fndptn_t; - -typedef struct RNode_LINE { - NODE node; -} rb_node_line_t; - -typedef struct RNode_FILE { - NODE node; - - struct rb_parser_string *path; -} rb_node_file_t; - -typedef struct RNode_ENCODING { - NODE node; - rb_encoding *enc; -} rb_node_encoding_t; - -typedef struct RNode_ERROR { - NODE node; -} rb_node_error_t; - -#define RNODE(obj) ((NODE *)(obj)) - -#define RNODE_SCOPE(node) ((rb_node_scope_t *)(node)) -#define RNODE_BLOCK(node) ((rb_node_block_t *)(node)) -#define RNODE_IF(node) ((rb_node_if_t *)(node)) -#define RNODE_UNLESS(node) ((rb_node_unless_t *)(node)) -#define RNODE_CASE(node) ((rb_node_case_t *)(node)) -#define RNODE_CASE2(node) ((rb_node_case2_t *)(node)) -#define RNODE_CASE3(node) ((rb_node_case3_t *)(node)) -#define RNODE_WHEN(node) ((rb_node_when_t *)(node)) -#define RNODE_IN(node) ((rb_node_in_t *)(node)) -#define RNODE_WHILE(node) ((rb_node_while_t *)(node)) -#define RNODE_UNTIL(node) ((rb_node_until_t *)(node)) -#define RNODE_ITER(node) ((rb_node_iter_t *)(node)) -#define RNODE_FOR(node) ((rb_node_for_t *)(node)) -#define RNODE_FOR_MASGN(node) ((rb_node_for_masgn_t *)(node)) -#define RNODE_BREAK(node) ((rb_node_break_t *)(node)) -#define RNODE_NEXT(node) ((rb_node_next_t *)(node)) -#define RNODE_REDO(node) ((rb_node_redo_t *)(node)) -#define RNODE_RETRY(node) ((rb_node_retry_t *)(node)) -#define RNODE_BEGIN(node) ((rb_node_begin_t *)(node)) -#define RNODE_RESCUE(node) ((rb_node_rescue_t *)(node)) -#define RNODE_RESBODY(node) ((rb_node_resbody_t *)(node)) -#define RNODE_ENSURE(node) ((rb_node_ensure_t *)(node)) -#define RNODE_AND(node) ((rb_node_and_t *)(node)) -#define RNODE_OR(node) ((rb_node_or_t *)(node)) -#define RNODE_MASGN(node) ((rb_node_masgn_t *)(node)) -#define RNODE_LASGN(node) ((rb_node_lasgn_t *)(node)) -#define RNODE_DASGN(node) ((rb_node_dasgn_t *)(node)) -#define RNODE_GASGN(node) ((rb_node_gasgn_t *)(node)) -#define RNODE_IASGN(node) ((rb_node_iasgn_t *)(node)) -#define RNODE_CDECL(node) ((rb_node_cdecl_t *)(node)) -#define RNODE_CVASGN(node) ((rb_node_cvasgn_t *)(node)) -#define RNODE_OP_ASGN1(node) ((rb_node_op_asgn1_t *)(node)) -#define RNODE_OP_ASGN2(node) ((rb_node_op_asgn2_t *)(node)) -#define RNODE_OP_ASGN_AND(node) ((rb_node_op_asgn_and_t *)(node)) -#define RNODE_OP_ASGN_OR(node) ((rb_node_op_asgn_or_t *)(node)) -#define RNODE_OP_CDECL(node) ((rb_node_op_cdecl_t *)(node)) -#define RNODE_CALL(node) ((rb_node_call_t *)(node)) -#define RNODE_OPCALL(node) ((rb_node_opcall_t *)(node)) -#define RNODE_FCALL(node) ((rb_node_fcall_t *)(node)) -#define RNODE_VCALL(node) ((rb_node_vcall_t *)(node)) -#define RNODE_QCALL(node) ((rb_node_qcall_t *)(node)) -#define RNODE_SUPER(node) ((rb_node_super_t *)(node)) -#define RNODE_ZSUPER(node) ((rb_node_zsuper_t *)(node)) -#define RNODE_LIST(node) ((rb_node_list_t *)(node)) -#define RNODE_ZLIST(node) ((rb_node_zlist_t *)(node)) -#define RNODE_HASH(node) ((rb_node_hash_t *)(node)) -#define RNODE_RETURN(node) ((rb_node_return_t *)(node)) -#define RNODE_YIELD(node) ((rb_node_yield_t *)(node)) -#define RNODE_LVAR(node) ((rb_node_lvar_t *)(node)) -#define RNODE_DVAR(node) ((rb_node_dvar_t *)(node)) -#define RNODE_GVAR(node) ((rb_node_gvar_t *)(node)) -#define RNODE_IVAR(node) ((rb_node_ivar_t *)(node)) -#define RNODE_CONST(node) ((rb_node_const_t *)(node)) -#define RNODE_CVAR(node) ((rb_node_cvar_t *)(node)) -#define RNODE_NTH_REF(node) ((rb_node_nth_ref_t *)(node)) -#define RNODE_BACK_REF(node) ((rb_node_back_ref_t *)(node)) -#define RNODE_MATCH(node) ((rb_node_match_t *)(node)) -#define RNODE_MATCH2(node) ((rb_node_match2_t *)(node)) -#define RNODE_MATCH3(node) ((rb_node_match3_t *)(node)) -#define RNODE_INTEGER(node) ((rb_node_integer_t *)(node)) -#define RNODE_FLOAT(node) ((rb_node_float_t *)(node)) -#define RNODE_RATIONAL(node) ((rb_node_rational_t *)(node)) -#define RNODE_IMAGINARY(node) ((rb_node_imaginary_t *)(node)) -#define RNODE_STR(node) ((rb_node_str_t *)(node)) -#define RNODE_DSTR(node) ((rb_node_dstr_t *)(node)) -#define RNODE_XSTR(node) ((rb_node_xstr_t *)(node)) -#define RNODE_DXSTR(node) ((rb_node_dxstr_t *)(node)) -#define RNODE_EVSTR(node) ((rb_node_evstr_t *)(node)) -#define RNODE_REGX(node) ((rb_node_regx_t *)(node)) -#define RNODE_DREGX(node) ((rb_node_dregx_t *)(node)) -#define RNODE_ONCE(node) ((rb_node_once_t *)(node)) -#define RNODE_ARGS(node) ((rb_node_args_t *)(node)) -#define RNODE_ARGS_AUX(node) ((rb_node_args_aux_t *)(node)) -#define RNODE_OPT_ARG(node) ((rb_node_opt_arg_t *)(node)) -#define RNODE_KW_ARG(node) ((rb_node_kw_arg_t *)(node)) -#define RNODE_POSTARG(node) ((rb_node_postarg_t *)(node)) -#define RNODE_ARGSCAT(node) ((rb_node_argscat_t *)(node)) -#define RNODE_ARGSPUSH(node) ((rb_node_argspush_t *)(node)) -#define RNODE_SPLAT(node) ((rb_node_splat_t *)(node)) -#define RNODE_BLOCK_PASS(node) ((rb_node_block_pass_t *)(node)) -#define RNODE_DEFN(node) ((rb_node_defn_t *)(node)) -#define RNODE_DEFS(node) ((rb_node_defs_t *)(node)) -#define RNODE_ALIAS(node) ((rb_node_alias_t *)(node)) -#define RNODE_VALIAS(node) ((rb_node_valias_t *)(node)) -#define RNODE_UNDEF(node) ((rb_node_undef_t *)(node)) -#define RNODE_CLASS(node) ((rb_node_class_t *)(node)) -#define RNODE_MODULE(node) ((rb_node_module_t *)(node)) -#define RNODE_SCLASS(node) ((rb_node_sclass_t *)(node)) -#define RNODE_COLON2(node) ((rb_node_colon2_t *)(node)) -#define RNODE_COLON3(node) ((rb_node_colon3_t *)(node)) -#define RNODE_DOT2(node) ((rb_node_dot2_t *)(node)) -#define RNODE_DOT3(node) ((rb_node_dot3_t *)(node)) -#define RNODE_FLIP2(node) ((rb_node_flip2_t *)(node)) -#define RNODE_FLIP3(node) ((rb_node_flip3_t *)(node)) -#define RNODE_SELF(node) ((rb_node_self_t *)(node)) -#define RNODE_NIL(node) ((rb_node_nil_t *)(node)) -#define RNODE_TRUE(node) ((rb_node_true_t *)(node)) -#define RNODE_FALSE(node) ((rb_node_false_t *)(node)) -#define RNODE_ERRINFO(node) ((rb_node_errinfo_t *)(node)) -#define RNODE_DEFINED(node) ((rb_node_defined_t *)(node)) -#define RNODE_POSTEXE(node) ((rb_node_postexe_t *)(node)) -#define RNODE_SYM(node) ((rb_node_sym_t *)(node)) -#define RNODE_DSYM(node) ((rb_node_dsym_t *)(node)) -#define RNODE_ATTRASGN(node) ((rb_node_attrasgn_t *)(node)) -#define RNODE_LAMBDA(node) ((rb_node_lambda_t *)(node)) -#define RNODE_ARYPTN(node) ((rb_node_aryptn_t *)(node)) -#define RNODE_HSHPTN(node) ((rb_node_hshptn_t *)(node)) -#define RNODE_FNDPTN(node) ((rb_node_fndptn_t *)(node)) -#define RNODE_LINE(node) ((rb_node_line_t *)(node)) -#define RNODE_FILE(node) ((rb_node_file_t *)(node)) -#define RNODE_ENCODING(node) ((rb_node_encoding_t *)(node)) - -/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: UNUSED, 9: UNUSED, 10: EXIVAR, 11: FREEZE */ -/* NODE_FL: 0..4: UNUSED, 5: UNUSED, 6: UNUSED, 7: NODE_FL_NEWLINE, - * 8..14: nd_type, - * 15..: nd_line - */ -#define NODE_FL_NEWLINE (((VALUE)1)<<7) - -#define NODE_TYPESHIFT 8 -#define NODE_TYPEMASK (((VALUE)0x7f)<flags & NODE_FL_NEWLINE) -#define nd_set_fl_newline(n) ((n)->flags |= NODE_FL_NEWLINE) -#define nd_unset_fl_newline(n) ((n)->flags &= ~NODE_FL_NEWLINE) - -#define nd_type(n) ((int) ((RNODE(n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) -#define nd_set_type(n,t) \ - rb_node_set_type(n, t) -#define nd_init_type(n,t) \ - (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<> SHAPE_ID_NUM_BITS) - -# define SHAPE_FLAG_SHIFT ((SIZEOF_VALUE * 8) - SHAPE_ID_NUM_BITS) - -# define SHAPE_MAX_VARIATIONS 8 - -# define INVALID_SHAPE_ID SHAPE_MASK -# define ROOT_SHAPE_ID 0x0 - -# define SPECIAL_CONST_SHAPE_ID (ROOT_SHAPE_ID + 1) -# define OBJ_TOO_COMPLEX_SHAPE_ID (SPECIAL_CONST_SHAPE_ID + 1) -# define FIRST_T_OBJECT_SHAPE_ID (OBJ_TOO_COMPLEX_SHAPE_ID + 1) - -typedef struct redblack_node redblack_node_t; - -struct rb_shape { - struct rb_id_table * edges; // id_table from ID (ivar) to next shape - ID edge_name; // ID (ivar) for transition from parent to rb_shape - attr_index_t next_iv_index; - uint32_t capacity; // Total capacity of the object with this shape - uint8_t type; - uint8_t heap_index; - shape_id_t parent_id; - redblack_node_t * ancestor_index; -}; - -typedef struct rb_shape rb_shape_t; - -struct redblack_node { - ID key; - rb_shape_t * value; - redblack_id_t l; - redblack_id_t r; -}; - -enum shape_type { - SHAPE_ROOT, - SHAPE_IVAR, - SHAPE_FROZEN, - SHAPE_T_OBJECT, - SHAPE_OBJ_TOO_COMPLEX, -}; - -typedef struct { - /* object shapes */ - rb_shape_t *shape_list; - rb_shape_t *root_shape; - shape_id_t next_shape_id; - - redblack_node_t *shape_cache; - unsigned int cache_size; -} rb_shape_tree_t; -RUBY_EXTERN rb_shape_tree_t *rb_shape_tree_ptr; - -static inline rb_shape_tree_t * -rb_current_shape_tree(void) -{ - return rb_shape_tree_ptr; -} -#define GET_SHAPE_TREE() rb_current_shape_tree() - -static inline shape_id_t -get_shape_id_from_flags(VALUE obj) -{ - RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj)); - return (shape_id_t)(SHAPE_MASK & ((RBASIC(obj)->flags) >> SHAPE_FLAG_SHIFT)); -} - -static inline void -set_shape_id_in_flags(VALUE obj, shape_id_t shape_id) -{ - // Ractors are occupying the upper 32 bits of flags, but only in debug mode - // Object shapes are occupying top bits - RBASIC(obj)->flags &= SHAPE_FLAG_MASK; - RBASIC(obj)->flags |= ((VALUE)(shape_id) << SHAPE_FLAG_SHIFT); -} - - -#if SHAPE_IN_BASIC_FLAGS -static inline shape_id_t -RBASIC_SHAPE_ID(VALUE obj) -{ - return get_shape_id_from_flags(obj); -} - -static inline void -RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id) -{ - set_shape_id_in_flags(obj, shape_id); -} -#endif - -static inline shape_id_t -ROBJECT_SHAPE_ID(VALUE obj) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - return get_shape_id_from_flags(obj); -} - -static inline void -ROBJECT_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - set_shape_id_in_flags(obj, shape_id); -} - -static inline shape_id_t -RCLASS_SHAPE_ID(VALUE obj) -{ - RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE)); - return get_shape_id_from_flags(obj); -} - -static inline void -RCLASS_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id) -{ - RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE)); - set_shape_id_in_flags(obj, shape_id); -} - -rb_shape_t * rb_shape_get_root_shape(void); -int32_t rb_shape_id_offset(void); - -rb_shape_t * rb_shape_get_parent(rb_shape_t * shape); - -RUBY_FUNC_EXPORTED rb_shape_t *rb_shape_get_shape_by_id(shape_id_t shape_id); -RUBY_FUNC_EXPORTED shape_id_t rb_shape_get_shape_id(VALUE obj); -rb_shape_t * rb_shape_get_next_iv_shape(rb_shape_t * shape, ID id); -bool rb_shape_get_iv_index(rb_shape_t * shape, ID id, attr_index_t * value); -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); -RUBY_FUNC_EXPORTED bool rb_shape_obj_too_complex(VALUE obj); - -void rb_shape_set_shape(VALUE obj, rb_shape_t* shape); -rb_shape_t* rb_shape_get_shape(VALUE obj); -int rb_shape_frozen_shape_p(rb_shape_t* shape); -rb_shape_t* rb_shape_transition_shape_frozen(VALUE obj); -bool rb_shape_transition_shape_remove_ivar(VALUE obj, ID id, rb_shape_t *shape, VALUE * removed); -rb_shape_t* rb_shape_get_next(rb_shape_t* shape, VALUE obj, ID id); -rb_shape_t* rb_shape_get_next_no_warnings(rb_shape_t* shape, VALUE obj, ID id); - -rb_shape_t * rb_shape_rebuild_shape(rb_shape_t * initial_shape, rb_shape_t * dest_shape); - -static inline uint32_t -ROBJECT_IV_CAPACITY(VALUE obj) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - // Asking for capacity doesn't make sense when the object is using - // a hash table for storing instance variables - RUBY_ASSERT(!rb_shape_obj_too_complex(obj)); - return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->capacity; -} - -static inline st_table * -ROBJECT_IV_HASH(VALUE obj) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - return (st_table *)ROBJECT(obj)->as.heap.ivptr; -} - -static inline void -ROBJECT_SET_IV_HASH(VALUE obj, const st_table *tbl) -{ - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - RUBY_ASSERT(rb_shape_obj_too_complex(obj)); - ROBJECT(obj)->as.heap.ivptr = (VALUE *)tbl; -} - -size_t rb_id_table_size(const struct rb_id_table *tbl); - -static inline uint32_t -ROBJECT_IV_COUNT(VALUE obj) -{ - if (rb_shape_obj_too_complex(obj)) { - return (uint32_t)rb_st_table_size(ROBJECT_IV_HASH(obj)); - } - else { - RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT); - RUBY_ASSERT(!rb_shape_obj_too_complex(obj)); - return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->next_iv_index; - } -} - -static inline uint32_t -RBASIC_IV_COUNT(VALUE obj) -{ - return rb_shape_get_shape_by_id(rb_shape_get_shape_id(obj))->next_iv_index; -} - -rb_shape_t *rb_shape_traverse_from_new_root(rb_shape_t *initial_shape, rb_shape_t *orig_shape); - -bool rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id); - -VALUE rb_obj_debug_shape(VALUE self, VALUE obj); - -// For ext/objspace -RUBY_SYMBOL_EXPORT_BEGIN -typedef void each_shape_callback(rb_shape_t * shape, void *data); -void rb_shape_each_shape(each_shape_callback callback, void *data); -size_t rb_shape_memsize(rb_shape_t *shape); -size_t rb_shape_edges_count(rb_shape_t *shape); -size_t rb_shape_depth(rb_shape_t *shape); -shape_id_t rb_shape_id(rb_shape_t * shape); -RUBY_SYMBOL_EXPORT_END - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/siphash.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/siphash.h deleted file mode 100644 index f49bc51..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/siphash.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef SIPHASH_H -#define SIPHASH_H 1 -#include -#ifdef HAVE_STDINT_H -#include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif - -#ifndef HAVE_UINT64_T -typedef struct { - uint32_t u32[2]; -} sip_uint64_t; -#define uint64_t sip_uint64_t -#else -typedef uint64_t sip_uint64_t; -#endif - -typedef struct { - int c; - int d; - uint64_t v[4]; - uint8_t buf[sizeof(uint64_t)]; - uint8_t buflen; - uint8_t msglen_byte; -} sip_state; - -typedef struct sip_interface_st sip_interface; - -typedef struct { - sip_state state[1]; - const sip_interface *methods; -} sip_hash; - -sip_hash *sip_hash_new(const uint8_t key[16], int c, int d); -sip_hash *sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d); -int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len); -int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len); -int sip_hash_final_integer(sip_hash *h, uint64_t *digest); -int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len); -int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest); -void sip_hash_free(sip_hash *h); -void sip_hash_dump(sip_hash *h); - -NO_SANITIZE("unsigned-integer-overflow", uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/symbol.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/symbol.h deleted file mode 100644 index 6b51868..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/symbol.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef RUBY_SYMBOL_H -#define RUBY_SYMBOL_H 1 -/********************************************************************** - - symbol.h - - - $Author$ - created at: Tue Jul 8 15:49:54 JST 2014 - - Copyright (C) 2014 Yukihiro Matsumoto - -**********************************************************************/ - -#include "id.h" -#include "ruby/encoding.h" - -#define DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID) -#define STATIC_ID2SYM(id) (((VALUE)(id)<tLAST_OP_ID) -#define is_local_id(id) (id_type(id)==ID_LOCAL) -#define is_global_id(id) (id_type(id)==ID_GLOBAL) -#define is_instance_id(id) (id_type(id)==ID_INSTANCE) -#define is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET) -#define is_const_id(id) (id_type(id)==ID_CONST) -#define is_class_id(id) (id_type(id)==ID_CLASS) -#define is_junk_id(id) (id_type(id)==ID_JUNK) - -static inline int -id_type(ID id) -{ - if (is_notop_id(id)) { - return (int)(id&ID_SCOPE_MASK); - } - else { - return -1; - } -} - -typedef uint32_t rb_id_serial_t; -static const uint32_t RB_ID_SERIAL_MAX = /* 256M on LP32 */ - UINT32_MAX >> - ((sizeof(ID)-sizeof(rb_id_serial_t))*CHAR_BIT < RUBY_ID_SCOPE_SHIFT ? - RUBY_ID_SCOPE_SHIFT : 0); - -typedef struct { - rb_id_serial_t last_id; - st_table *str_sym; - VALUE ids; - VALUE dsymbol_fstr_hash; -} rb_symbols_t; - -static inline rb_id_serial_t -rb_id_to_serial(ID id) -{ - if (is_notop_id(id)) { - return (rb_id_serial_t)(id >> ID_SCOPE_SHIFT); - } - else { - return (rb_id_serial_t)id; - } -} - -static inline int -sym_type(VALUE sym) -{ - ID id; - if (STATIC_SYM_P(sym)) { - id = RSHIFT(sym, RUBY_SPECIAL_SHIFT); - if (id<=tLAST_OP_ID) { - return -1; - } - } - else { - id = RSYMBOL(sym)->id; - } - return (int)(id&ID_SCOPE_MASK); -} - -#define is_local_sym(sym) (sym_type(sym)==ID_LOCAL) -#define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL) -#define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE) -#define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET) -#define is_const_sym(sym) (sym_type(sym)==ID_CONST) -#define is_class_sym(sym) (sym_type(sym)==ID_CLASS) -#define is_junk_sym(sym) (sym_type(sym)==ID_JUNK) - -#ifndef RIPPER -RUBY_FUNC_EXPORTED -#else -RUBY_EXTERN -#endif -const uint_least32_t ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32]; - -static inline int -is_global_name_punct(const int c) -{ - if (c <= 0x20 || 0x7e < c) return 0; - return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1; -} - -RUBY_SYMBOL_EXPORT_BEGIN - -int rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset); -size_t rb_sym_immortal_count(void); - -RUBY_SYMBOL_EXPORT_END -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_none.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_none.h deleted file mode 100644 index ac47e52..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_none.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RUBY_THREAD_NONE_H -#define RUBY_THREAD_NONE_H - -#define RB_NATIVETHREAD_LOCK_INIT (void)(0) -#define RB_NATIVETHREAD_COND_INIT (void)(0) - -// no-thread impl doesn't use TLS but define this to avoid using tls key -// based implementation in vm.c -#define RB_THREAD_LOCAL_SPECIFIER - -struct rb_native_thread { - void *thread_id; // NULL -}; - -struct rb_thread_sched_item {}; -struct rb_thread_sched {}; - -RUBY_EXTERN struct rb_execution_context_struct *ruby_current_ec; -NOINLINE(struct rb_execution_context_struct *rb_current_ec_noinline(void)); // for assertions - -#endif /* RUBY_THREAD_NONE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h deleted file mode 100644 index 1312077..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef RUBY_THREAD_PTHREAD_H -#define RUBY_THREAD_PTHREAD_H -/********************************************************************** - - thread_pthread.h - - - $Author$ - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -#ifdef HAVE_PTHREAD_NP_H -#include -#endif - -#define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER -#define RB_NATIVETHREAD_COND_INIT PTHREAD_COND_INITIALIZER - -// this data should be protected by timer_th.waiting_lock -struct rb_thread_sched_waiting { - enum thread_sched_waiting_flag { - thread_sched_waiting_none = 0x00, - thread_sched_waiting_timeout = 0x01, - thread_sched_waiting_io_read = 0x02, - thread_sched_waiting_io_write = 0x08, - thread_sched_waiting_io_force = 0x40, // ignore readable - } flags; - - struct { - // should be compat with hrtime.h -#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL - int128_t timeout; -#else - uint64_t timeout; -#endif - int fd; // -1 for timeout only - int result; - } data; - - // connected to timer_th.waiting - struct ccan_list_node node; -}; - -// per-Thead scheduler helper data -struct rb_thread_sched_item { - struct { - struct ccan_list_node ubf; - - // connected to ractor->threads.sched.reqdyq - // locked by ractor->threads.sched.lock - struct ccan_list_node readyq; - - // connected to vm->ractor.sched.timeslice_threads - // locked by vm->ractor.sched.lock - struct ccan_list_node timeslice_threads; - - // connected to vm->ractor.sched.running_threads - // locked by vm->ractor.sched.lock - struct ccan_list_node running_threads; - - // connected to vm->ractor.sched.zombie_threads - struct ccan_list_node zombie_threads; - } node; - - struct rb_thread_sched_waiting waiting_reason; - - bool finished; - bool malloc_stack; - void *context_stack; - struct coroutine_context *context; -}; - -struct rb_native_thread { - rb_atomic_t serial; - struct rb_vm_struct *vm; - - rb_nativethread_id_t thread_id; - -#ifdef RB_THREAD_T_HAS_NATIVE_ID - int tid; -#endif - - struct rb_thread_struct *running_thread; - - // to control native thread -#if defined(__GLIBC__) || defined(__FreeBSD__) - union -#else - /* - * assume the platform condvars are badly implemented and have a - * "memory" of which mutex they're associated with - */ - struct -#endif - { - rb_nativethread_cond_t intr; /* th->interrupt_lock */ - rb_nativethread_cond_t readyq; /* use sched->lock */ - } cond; - -#ifdef USE_SIGALTSTACK - void *altstack; -#endif - - struct coroutine_context *nt_context; - int dedicated; - - size_t machine_stack_maxsize; -}; - -#undef except -#undef try -#undef leave -#undef finally - -// per-Ractor -struct rb_thread_sched { - rb_nativethread_lock_t lock_; -#if VM_CHECK_MODE - struct rb_thread_struct *lock_owner; -#endif - struct rb_thread_struct *running; // running thread or NULL - bool is_running; - bool is_running_timeslice; - bool enable_mn_threads; - - struct ccan_list_head readyq; - int readyq_cnt; - // ractor scheduling - struct ccan_list_node grq_node; -}; - -#ifdef RB_THREAD_LOCAL_SPECIFIER - NOINLINE(void rb_current_ec_set(struct rb_execution_context_struct *)); - NOINLINE(struct rb_execution_context_struct *rb_current_ec_noinline(void)); - - # ifdef __APPLE__ - // on Darwin, TLS can not be accessed across .so - NOINLINE(struct rb_execution_context_struct *rb_current_ec(void)); - # else - RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec; - - // for RUBY_DEBUG_LOG() - RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER rb_atomic_t ruby_nt_serial; - #define RUBY_NT_SERIAL 1 - # endif -#else -typedef pthread_key_t native_tls_key_t; - -static inline void * -native_tls_get(native_tls_key_t key) -{ - // return value should be checked by caller - return pthread_getspecific(key); -} - -static inline void -native_tls_set(native_tls_key_t key, void *ptr) -{ - if (UNLIKELY(pthread_setspecific(key, ptr) != 0)) { - rb_bug("pthread_setspecific error"); - } -} - -RUBY_EXTERN native_tls_key_t ruby_current_ec_key; -#endif - -#endif /* RUBY_THREAD_PTHREAD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h deleted file mode 100644 index 23cd71f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef RUBY_THREAD_WIN32_H -#define RUBY_THREAD_WIN32_H -/********************************************************************** - - thread_win32.h - - - $Author$ - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -/* interface */ - -# ifdef __CYGWIN__ -# undef _WIN32 -# endif - -#define USE_VM_CLOCK 1 - -WINBASEAPI BOOL WINAPI -TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection); - -struct rb_native_thread { - HANDLE thread_id; - HANDLE interrupt_event; -}; - -struct rb_thread_sched_item { - void *vm_stack; -}; - -struct rb_thread_sched { - HANDLE lock; -}; - -typedef DWORD native_tls_key_t; // TLS index - -static inline void * -native_tls_get(native_tls_key_t key) -{ - // return value should be checked by caller. - return TlsGetValue(key); -} - -static inline void -native_tls_set(native_tls_key_t key, void *ptr) -{ - if (UNLIKELY(TlsSetValue(key, ptr) == 0)) { - rb_bug("TlsSetValue() error"); - } -} - -RUBY_SYMBOL_EXPORT_BEGIN -RUBY_EXTERN native_tls_key_t ruby_current_ec_key; -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_THREAD_WIN32_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/timev.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/timev.h deleted file mode 100644 index d350a17..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/timev.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef RUBY_TIMEV_H -#define RUBY_TIMEV_H -#include "ruby/ruby.h" - -struct vtm { - VALUE year; /* 2000 for example. Integer. */ - VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */ - VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */ - VALUE zone; /* "JST", "EST", "EDT", etc. as String */ - unsigned int yday:9; /* 1..366 */ - unsigned int mon:4; /* 1..12 */ - unsigned int mday:5; /* 1..31 */ - unsigned int hour:5; /* 0..23 */ - unsigned int min:6; /* 0..59 */ - unsigned int sec:6; /* 0..60 */ - unsigned int wday:3; /* 0:Sunday, 1:Monday, ..., 6:Saturday 7:init */ - unsigned int isdst:2; /* 0:StandardTime 1:DayLightSavingTime 3:init */ - - /* Flags for struct time_object */ - unsigned int tzmode:3; /* 0:localtime 1:utc 2:fixoff 3:uninitialized */ - unsigned int tm_got:1; -}; - -#define TIME_SCALE 1000000000 - -#ifndef TYPEOF_TIMEVAL_TV_SEC -# define TYPEOF_TIMEVAL_TV_SEC time_t -#endif -#ifndef TYPEOF_TIMEVAL_TV_USEC -# if INT_MAX >= 1000000 -# define TYPEOF_TIMEVAL_TV_USEC int -# else -# define TYPEOF_TIMEVAL_TV_USEC long -# endif -#endif - -#if SIZEOF_TIME_T == SIZEOF_LONG -typedef unsigned long unsigned_time_t; -#elif SIZEOF_TIME_T == SIZEOF_INT -typedef unsigned int unsigned_time_t; -#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG -typedef unsigned LONG_LONG unsigned_time_t; -#else -# error cannot find integer type which size is same as time_t. -#endif - -/* strftime.c */ -#ifdef RUBY_ENCODING_H -VALUE rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc, - VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt); -VALUE rb_strftime(const char *format, size_t format_len, rb_encoding *enc, - VALUE time, const struct vtm *vtm, VALUE timev, int gmt); -#endif - -/* time.c */ -VALUE rb_time_zone_abbreviation(VALUE zone, VALUE time); - -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h deleted file mode 100644 index 416e50d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef RUBY_TRANSCODE_DATA_H -#define RUBY_TRANSCODE_DATA_H 1 -/********************************************************************** - - transcode_data.h - - - $Author$ - created at: Mon 10 Dec 2007 14:01:47 JST 2007 - - Copyright (C) 2007 Martin Duerst - -**********************************************************************/ - -#include "ruby/ruby.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#define WORDINDEX_SHIFT_BITS 2 -#define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS) -#define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS) -#define BYTE_LOOKUP_BASE(bl) ((bl)[0]) -#define BYTE_LOOKUP_INFO(bl) ((bl)[1]) - -#define PType (unsigned int) - -#define NOMAP (PType 0x01) /* direct map */ -#define ONEbt (0x02) /* one byte payload */ -#define TWObt (0x03) /* two bytes payload */ -#define THREEbt (0x05) /* three bytes payload */ -#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */ -#define INVALID (PType 0x07) /* invalid byte sequence */ -#define UNDEF (PType 0x09) /* legal but undefined */ -#define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */ -#define FUNii (PType 0x0B) /* function from info to info */ -#define FUNsi (PType 0x0D) /* function from start to info */ -#define FUNio (PType 0x0E) /* function from info to output */ -#define FUNso (PType 0x0F) /* function from start to output */ -#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */ -#define GB4bt (PType 0x12) /* GB18030 four bytes payload */ -#define FUNsio (PType 0x13) /* function from start and info to output */ - -#define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4) -#define STR1_BYTEINDEX(w) ((w) >> 6) -#define makeSTR1(bi) (((bi) << 6) | STR1) -#define makeSTR1LEN(len) ((len)-4) - -#define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt)) -#define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|\ - (((unsigned char)(b2))<<16)|\ - TWObt)) -#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\ - (((unsigned char)(b2))<<16)|\ - (((unsigned int)(unsigned char)(b3))<<24)|\ - THREEbt)&\ - 0xffffffffU)) -#define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\ - (((unsigned char)(b2))<<16)|\ - (((unsigned int)(unsigned char)(b3))<<24)|\ - ((((unsigned char)(b0))&0x07)<<5)|\ - FOURbt)&\ - 0xffffffffU)) -#define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|\ - (((unsigned char)(b2))<<16)|\ - ((((unsigned char)(b1))&0x0f)<<24)|\ - ((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|\ - GB4bt)&\ - 0xffffffffU)) -#define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio)) - -#define getBT1(a) ((unsigned char)((a)>> 8)) -#define getBT2(a) ((unsigned char)((a)>>16)) -#define getBT3(a) ((unsigned char)((a)>>24)) -#define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */ - -#define getGB4bt0(a) ((unsigned char)((a)>> 8)) -#define getGB4bt1(a) (((unsigned char)((a)>>24)&0x0F)|0x30) -#define getGB4bt2(a) ((unsigned char)((a)>>16)) -#define getGB4bt3(a) (((unsigned char)((a)>>28)&0x0F)|0x30) - -#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii)) - -/* do we need these??? maybe not, can be done with simple tables */ -#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */ -#define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */ -#define THREETRAIL /* legal but undefined if three more trailing UTF-8 */ - -typedef enum { - asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */ - asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */ - asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */ - /* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */ -} rb_transcoder_asciicompat_type_t; - -typedef struct rb_transcoder rb_transcoder; - -/* static structure, one per supported encoding pair */ -struct rb_transcoder { - const char *src_encoding; - const char *dst_encoding; - unsigned int conv_tree_start; - const unsigned char *byte_array; - unsigned int byte_array_length; - const unsigned int *word_array; - unsigned int word_array_length; - int word_size; - int input_unit_length; - int max_input; - int max_output; - rb_transcoder_asciicompat_type_t asciicompat_type; - size_t state_size; - int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */ - int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */ - VALUE (*func_ii)(void*, VALUE); /* info -> info */ - VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */ - ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */ - ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */ - ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */ - ssize_t (*resetsize_func)(void*); /* -> len */ - ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */ - ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */ -}; - -void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib); -void rb_register_transcoder(const rb_transcoder *); - -/* - * To get rid of collision of initializer symbols in statically-linked encodings - * and transcoders - */ -#if defined(EXTSTATIC) && EXTSTATIC -# define TRANS_INIT(name) void Init_trans_ ## name(void) -#else -# define TRANS_INIT(name) void Init_ ## name(void) -#endif - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_TRANSCODE_DATA_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/variable.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/variable.h deleted file mode 100644 index 1abc89e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/variable.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef RUBY_TOPLEVEL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_TOPLEVEL_VARIABLE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ - -/* per-object */ - -#include "shape.h" - -struct gen_ivtbl { -#if !SHAPE_IN_BASIC_FLAGS - uint16_t shape_id; -#endif - union { - struct { - uint32_t numiv; - VALUE ivptr[1]; - } shape; - struct { - st_table *table; - } complex; - } as; -}; - -int rb_ivar_generic_ivtbl_lookup(VALUE obj, struct gen_ivtbl **); - -#if !SHAPE_IN_BASIC_FLAGS -shape_id_t rb_generic_shape_id(VALUE obj); -#endif - -void rb_free_rb_global_tbl(void); -void rb_free_generic_iv_tbl_(void); - -#endif /* RUBY_TOPLEVEL_VARIABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/version.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/version.h deleted file mode 100644 index 7aca89f..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/version.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef RUBY_TOPLEVEL_VERSION_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_TOPLEVEL_VERSION_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ -# define RUBY_VERSION_MAJOR RUBY_API_VERSION_MAJOR -# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR -#define RUBY_VERSION_TEENY 0 -#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL -1 - -#include "ruby/version.h" -#include "ruby/internal/abi.h" - -#ifndef RUBY_REVISION -#include "revision.h" - -#ifndef TOKEN_PASTE -#define TOKEN_PASTE(x,y) x##y -#endif -#define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000 -#define WITH_ZERO_PADDING(x) TOKEN_PASTE(0,x) -#define RUBY_BIRTH_YEAR_STR STRINGIZE(RUBY_BIRTH_YEAR) -#define RUBY_RELEASE_YEAR_STR STRINGIZE(RUBY_RELEASE_YEAR) -#if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH) -#define RUBY_RELEASE_MONTH_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_MONTH)) -#else -#define RUBY_RELEASE_MONTH_STR STRINGIZE(RUBY_RELEASE_MONTH) -#endif -#if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY) -#define RUBY_RELEASE_DAY_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_DAY)) -#else -#define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY) -#endif - -#endif - -#ifdef RUBY_ABI_VERSION -# define RUBY_ABI_VERSION_SUFFIX "+"STRINGIZE(RUBY_ABI_VERSION) -#else -# define RUBY_ABI_VERSION_SUFFIX "" -#endif -#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE -# if RUBY_LIB_VERSION_STYLE == 3 -# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \ - "."STRINGIZE(RUBY_API_VERSION_TEENY) RUBY_ABI_VERSION_SUFFIX -# elif RUBY_LIB_VERSION_STYLE == 2 -# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \ - RUBY_ABI_VERSION_SUFFIX -# endif -#endif - -#if RUBY_PATCHLEVEL == -1 -# ifdef RUBY_PATCHLEVEL_NAME -# define RUBY_PATCHLEVEL_STR STRINGIZE(RUBY_PATCHLEVEL_NAME) -# else -# define RUBY_PATCHLEVEL_STR "preview2" -# endif -#elif defined RUBY_ABI_VERSION -# error RUBY_ABI_VERSION is defined in non-development branch -#else -# define RUBY_PATCHLEVEL_STR "" -#endif - -#endif /* RUBY_TOPLEVEL_VERSION_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm.inc deleted file mode 100644 index 81d59ba..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm.inc +++ /dev/null @@ -1,5840 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is VM main loop. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/vm.inc.erb" - or tool/insns2vm.rb - */ - -#include "vm_insnhelper.h" - -/* insn nop()()() */ -INSN_ENTRY(nop) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(nop); - DEBUG_ENTER_INSN("nop"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _nop() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(nop); -} - -/* insn getlocal(idx, level)()(val) */ -INSN_ENTRY(getlocal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getlocal); - DEBUG_ENTER_INSN("getlocal"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getlocal(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getlocal -# line 81 "insns.def" -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} -# line 95 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getlocal); -} - -/* insn setlocal(idx, level)(val)() */ -INSN_ENTRY(setlocal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setlocal); - DEBUG_ENTER_INSN("setlocal"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setlocal(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setlocal -# line 95 "insns.def" -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} -# line 140 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setlocal); -} - -/* insn getblockparam(idx, level)()(val) */ -INSN_ENTRY(getblockparam) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getblockparam); - DEBUG_ENTER_INSN("getblockparam"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getblockparam(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getblockparam -# line 107 "insns.def" -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - val = rb_vm_bh_to_procval(ec, VM_ENV_BLOCK_HANDLER(ep)); - vm_env_write(ep, -(int)idx, val); - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); - } - else { - val = *(ep - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); - } -} -# line 192 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getblockparam); -} - -/* insn setblockparam(idx, level)(val)() */ -INSN_ENTRY(setblockparam) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setblockparam); - DEBUG_ENTER_INSN("setblockparam"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setblockparam(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setblockparam -# line 129 "insns.def" -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - vm_env_write(ep, -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); - - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); -} -# line 242 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setblockparam); -} - -/* insn getblockparamproxy(idx, level)()(val) */ -INSN_ENTRY(getblockparamproxy) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getblockparamproxy); - DEBUG_ENTER_INSN("getblockparamproxy"); - - /* ### Declare and assign variables. ### */ - lindex_t idx = (lindex_t)GET_OPERAND(1); - rb_num_t level = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getblockparamproxy(idx, level) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, level); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getblockparamproxy -# line 148 "insns.def" -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - VALUE block_handler = VM_ENV_BLOCK_HANDLER(ep); - - if (block_handler) { - switch (vm_block_handler_type(block_handler)) { - case block_handler_type_iseq: - case block_handler_type_ifunc: - val = rb_block_param_proxy; - break; - case block_handler_type_symbol: - val = rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler)); - goto INSN_LABEL(set); - case block_handler_type_proc: - val = VM_BH_TO_PROC(block_handler); - goto INSN_LABEL(set); - default: - VM_UNREACHABLE(getblockparamproxy); - } - } - else { - val = Qnil; - INSN_LABEL(set): - vm_env_write(ep, -(int)idx, val); - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); - } - } - else { - val = *(ep - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); - } -} -# line 315 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getblockparamproxy); -} - -/* insn getspecial(key, type)()(val) */ -INSN_ENTRY(getspecial) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getspecial); - DEBUG_ENTER_INSN("getspecial"); - - /* ### Declare and assign variables. ### */ - rb_num_t key = (rb_num_t)GET_OPERAND(1); - rb_num_t type = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getspecial(key, type) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, type); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getspecial -# line 193 "insns.def" -{ - val = vm_getspecial(ec, GET_LEP(), key, type); -} -# line 358 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getspecial); -} - -/* insn setspecial(key)(obj)() */ -INSN_ENTRY(setspecial) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setspecial); - DEBUG_ENTER_INSN("setspecial"); - - /* ### Declare and assign variables. ### */ - rb_num_t key = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setspecial(key) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE obj = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setspecial -# line 203 "insns.def" -{ - lep_svar_set(ec, GET_LEP(), key, obj); -} -# line 399 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setspecial); -} - -/* insn getinstancevariable(id, ic)()(val) */ -INSN_ENTRY(getinstancevariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getinstancevariable); - DEBUG_ENTER_INSN("getinstancevariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - IVC ic = (IVC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getinstancevariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getinstancevariable -# line 215 "insns.def" -{ - val = vm_getinstancevariable(GET_ISEQ(), GET_SELF(), id, ic); -} -# line 439 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getinstancevariable); -} - -/* insn setinstancevariable(id, ic)(val)() */ -INSN_ENTRY(setinstancevariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setinstancevariable); - DEBUG_ENTER_INSN("setinstancevariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - IVC ic = (IVC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setinstancevariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setinstancevariable -# line 226 "insns.def" -{ - vm_setinstancevariable(GET_ISEQ(), GET_SELF(), id, val, ic); -} -# line 482 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setinstancevariable); -} - -/* insn getclassvariable(id, ic)()(val) */ -INSN_ENTRY(getclassvariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getclassvariable); - DEBUG_ENTER_INSN("getclassvariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ICVARC ic = (ICVARC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _getclassvariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getclassvariable -# line 238 "insns.def" -{ - rb_control_frame_t *cfp = GET_CFP(); - val = vm_getclassvariable(GET_ISEQ(), cfp, id, ic); -} -# line 523 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getclassvariable); -} - -/* insn setclassvariable(id, ic)(val)() */ -INSN_ENTRY(setclassvariable) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setclassvariable); - DEBUG_ENTER_INSN("setclassvariable"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ICVARC ic = (ICVARC)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _setclassvariable(id, ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setclassvariable -# line 251 "insns.def" -{ - vm_ensure_not_refinement_module(GET_SELF()); - vm_setclassvariable(GET_ISEQ(), GET_CFP(), id, val, ic); -} -# line 567 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setclassvariable); -} - -/* insn opt_getconstant_path(ic)()(val) */ -INSN_ENTRY(opt_getconstant_path) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_getconstant_path); - DEBUG_ENTER_INSN("opt_getconstant_path"); - - /* ### Declare and assign variables. ### */ - IC ic = (IC)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_getconstant_path(ic) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ic); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_getconstant_path -# line 262 "insns.def" -{ - val = rb_vm_opt_getconstant_path(ec, GET_CFP(), ic); -} -# line 605 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_getconstant_path); -} - -/* insn getconstant(id)(klass, allow_nil)(val) */ -INSN_ENTRY(getconstant) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getconstant); - DEBUG_ENTER_INSN("getconstant"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getconstant(id) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE klass = TOPN(1); - VALUE allow_nil = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getconstant -# line 277 "insns.def" -{ - val = vm_get_ev_const(ec, klass, id, allow_nil == Qtrue, 0); -} -# line 648 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getconstant); -} - -/* insn setconstant(id)(val, cbase)() */ -INSN_ENTRY(setconstant) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setconstant); - DEBUG_ENTER_INSN("setconstant"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setconstant(id) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(1); - VALUE cbase = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setconstant -# line 293 "insns.def" -{ - vm_check_if_namespace(cbase); - vm_ensure_not_refinement_module(GET_SELF()); - rb_const_set(cbase, id, val); -} -# line 692 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setconstant); -} - -/* insn getglobal(gid)()(val) */ -INSN_ENTRY(getglobal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getglobal); - DEBUG_ENTER_INSN("getglobal"); - - /* ### Declare and assign variables. ### */ - ID gid = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getglobal(gid) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, gid); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getglobal -# line 306 "insns.def" -{ - val = rb_gvar_get(gid); -} -# line 730 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getglobal); -} - -/* insn setglobal(gid)(val)() */ -INSN_ENTRY(setglobal) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setglobal); - DEBUG_ENTER_INSN("setglobal"); - - /* ### Declare and assign variables. ### */ - ID gid = (ID)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setglobal(gid) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, gid); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setglobal -# line 317 "insns.def" -{ - rb_gvar_set(gid, val); -} -# line 771 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setglobal); -} - -/* insn putnil()()(val) */ -INSN_ENTRY(putnil) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putnil); - DEBUG_ENTER_INSN("putnil"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _putnil() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putnil -# line 331 "insns.def" -{ - val = Qnil; -} -# line 807 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putnil); -} - -/* insn putself()()(val) */ -INSN_ENTRY(putself) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putself); - DEBUG_ENTER_INSN("putself"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _putself() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putself -# line 341 "insns.def" -{ - val = GET_SELF(); -} -# line 846 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putself); -} - -/* insn putobject(val)()(val) */ -INSN_ENTRY(putobject) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putobject); - DEBUG_ENTER_INSN("putobject"); - - /* ### Declare and assign variables. ### */ - VALUE val = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putobject(val) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, val); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putobject); -} - -/* insn putspecialobject(value_type)()(val) */ -INSN_ENTRY(putspecialobject) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putspecialobject); - DEBUG_ENTER_INSN("putspecialobject"); - - /* ### Declare and assign variables. ### */ - rb_num_t value_type = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putspecialobject(value_type) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, value_type); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putspecialobject -# line 364 "insns.def" -{ - enum vm_special_object_type type; - - type = (enum vm_special_object_type)value_type; - val = vm_get_special_object(GET_EP(), type); -} -# line 919 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putspecialobject); -} - -/* insn putstring(str)()(val) */ -INSN_ENTRY(putstring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putstring); - DEBUG_ENTER_INSN("putstring"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putstring(str) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putstring -# line 377 "insns.def" -{ - val = rb_ec_str_resurrect(ec, str, false); -} -# line 960 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putstring); -} - -/* insn putchilledstring(str)()(val) */ -INSN_ENTRY(putchilledstring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putchilledstring); - DEBUG_ENTER_INSN("putchilledstring"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _putchilledstring(str) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN putchilledstring -# line 387 "insns.def" -{ - val = rb_ec_str_resurrect(ec, str, true); -} -# line 1001 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putchilledstring); -} - -/* insn concatstrings(num)(...)(val) */ -INSN_ENTRY(concatstrings) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(concatstrings); - DEBUG_ENTER_INSN("concatstrings"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _concatstrings(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN concatstrings -# line 401 "insns.def" -{ - val = rb_str_concat_literals(num, STACK_ADDR_FROM_TOP(num)); -} -# line 1042 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(concatstrings); -} - -/* insn anytostring()(val, str)(val) */ -INSN_ENTRY(anytostring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(anytostring); - DEBUG_ENTER_INSN("anytostring"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _anytostring() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(1); - VALUE str = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN anytostring -# line 412 "insns.def" -{ - val = rb_obj_as_string_result(str, val); -} -# line 1082 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(anytostring); -} - -/* insn toregexp(opt, cnt)(...)(val) */ -INSN_ENTRY(toregexp) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(toregexp); - DEBUG_ENTER_INSN("toregexp"); - - /* ### Declare and assign variables. ### */ - rb_num_t opt = (rb_num_t)GET_OPERAND(1); - rb_num_t cnt = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _toregexp(opt, cnt) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, opt); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cnt); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN toregexp -# line 428 "insns.def" -{ - const VALUE ary = rb_ary_tmp_new_from_values(0, cnt, STACK_ADDR_FROM_TOP(cnt)); - val = rb_reg_new_ary(ary, (int)opt); - rb_ary_clear(ary); -} -# line 1127 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(toregexp); -} - -/* insn intern()(str)(sym) */ -INSN_ENTRY(intern) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(intern); - DEBUG_ENTER_INSN("intern"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _intern() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE str = TOPN(0); - VALUE sym; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN intern -# line 440 "insns.def" -{ - sym = rb_str_intern(str); -} -# line 1167 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = sym; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(intern); -} - -/* insn newarray(num)(...)(val) */ -INSN_ENTRY(newarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newarray); - DEBUG_ENTER_INSN("newarray"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newarray(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newarray -# line 451 "insns.def" -{ - val = rb_ec_ary_new_from_values(ec, num, STACK_ADDR_FROM_TOP(num)); -} -# line 1208 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newarray); -} - -/* insn pushtoarraykwsplat()(ary, hash)(ary) */ -INSN_ENTRY(pushtoarraykwsplat) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(pushtoarraykwsplat); - DEBUG_ENTER_INSN("pushtoarraykwsplat"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _pushtoarraykwsplat() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary = TOPN(1); - VALUE hash = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN pushtoarraykwsplat -# line 463 "insns.def" -{ - if (!RHASH_EMPTY_P(hash)) { - rb_ary_push(ary, hash); - } -} -# line 1250 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = ary; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(pushtoarraykwsplat); -} - -/* insn duparray(ary)()(val) */ -INSN_ENTRY(duparray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(duparray); - DEBUG_ENTER_INSN("duparray"); - - /* ### Declare and assign variables. ### */ - VALUE ary = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _duparray(ary) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ary); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN duparray -# line 475 "insns.def" -{ - RUBY_DTRACE_CREATE_HOOK(ARRAY, RARRAY_LEN(ary)); - val = rb_ary_resurrect(ary); -} -# line 1292 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(duparray); -} - -/* insn duphash(hash)()(val) */ -INSN_ENTRY(duphash) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(duphash); - DEBUG_ENTER_INSN("duphash"); - - /* ### Declare and assign variables. ### */ - VALUE hash = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _duphash(hash) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN duphash -# line 486 "insns.def" -{ - RUBY_DTRACE_CREATE_HOOK(HASH, RHASH_SIZE(hash) << 1); - val = rb_hash_resurrect(hash); -} -# line 1334 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(duphash); -} - -/* insn expandarray(num, flag)(..., ary)(...) */ -INSN_ENTRY(expandarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(expandarray); - DEBUG_ENTER_INSN("expandarray"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); - rb_num_t flag = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _expandarray(num, flag) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, flag); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN expandarray -# line 508 "insns.def" -{ - vm_expandarray(GET_CFP(), ary, num, (int)flag); -} -# line 1377 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(expandarray); -} - -/* insn concatarray()(ary1, ary2)(ary) */ -INSN_ENTRY(concatarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(concatarray); - DEBUG_ENTER_INSN("concatarray"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _concatarray() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary1 = TOPN(1); - VALUE ary2 = TOPN(0); - VALUE ary; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN concatarray -# line 521 "insns.def" -{ - ary = vm_concat_array(ary1, ary2); -} -# line 1413 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = ary; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(concatarray); -} - -/* insn concattoarray()(ary1, ary2)(ary) */ -INSN_ENTRY(concattoarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(concattoarray); - DEBUG_ENTER_INSN("concattoarray"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _concattoarray() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary1 = TOPN(1); - VALUE ary2 = TOPN(0); - VALUE ary; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN concattoarray -# line 535 "insns.def" -{ - ary = vm_concat_to_array(ary1, ary2); -} -# line 1454 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = ary; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(concattoarray); -} - -/* insn pushtoarray(num)(...)(val) */ -INSN_ENTRY(pushtoarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(pushtoarray); - DEBUG_ENTER_INSN("pushtoarray"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _pushtoarray(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN pushtoarray -# line 546 "insns.def" -{ - const VALUE *objp = STACK_ADDR_FROM_TOP(num); - val = rb_ary_cat(*(objp-1), objp, num); -} -# line 1496 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(pushtoarray); -} - -/* insn splatarray(flag)(ary)(obj) */ -INSN_ENTRY(splatarray) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(splatarray); - DEBUG_ENTER_INSN("splatarray"); - - /* ### Declare and assign variables. ### */ - VALUE flag = (VALUE)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _splatarray(flag) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE ary = TOPN(0); - VALUE obj; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN splatarray -# line 558 "insns.def" -{ - obj = vm_splat_array(flag, ary); -} -# line 1538 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = obj; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(splatarray); -} - -/* insn splatkw()(hash, block)(obj, block) */ -INSN_ENTRY(splatkw) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(splatkw); - DEBUG_ENTER_INSN("splatkw"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _splatkw() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE hash = TOPN(1); - VALUE block = TOPN(0); - VALUE obj; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN splatkw -# line 569 "insns.def" -{ - if (NIL_P(hash)) { - obj = Qnil; - } - else { - obj = rb_to_hash_type(hash); - } -} -# line 1584 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = block; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - TOPN(1) = obj; - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(splatkw); -} - -/* insn newhash(num)(...)(val) */ -INSN_ENTRY(newhash) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newhash); - DEBUG_ENTER_INSN("newhash"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newhash(num) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newhash -# line 586 "insns.def" -{ - RUBY_DTRACE_CREATE_HOOK(HASH, num); - - if (num) { - val = rb_hash_new_with_size(num / 2); - rb_hash_bulk_insert(num, STACK_ADDR_FROM_TOP(num), val); - } - else { - val = rb_hash_new(); - } -} -# line 1636 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newhash); -} - -/* insn newrange(flag)(low, high)(val) */ -INSN_ENTRY(newrange) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(newrange); - DEBUG_ENTER_INSN("newrange"); - - /* ### Declare and assign variables. ### */ - rb_num_t flag = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _newrange(flag) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE low = TOPN(1); - VALUE high = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN newrange -# line 606 "insns.def" -{ - val = rb_range_new(low, high, (int)flag); -} -# line 1679 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(newrange); -} - -/* insn pop()(val)() */ -INSN_ENTRY(pop) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(pop); - DEBUG_ENTER_INSN("pop"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _pop() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN pop -# line 620 "insns.def" -{ - (void)val; - /* none */ -} -# line 1719 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(pop); -} - -/* insn dup()(val)(val1, val2) */ -INSN_ENTRY(dup) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(dup); - DEBUG_ENTER_INSN("dup"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _dup() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - VALUE val1; - VALUE val2; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN dup -# line 631 "insns.def" -{ - val1 = val2 = val; -} -# line 1757 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val2; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - TOPN(1) = val1; - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(dup); -} - -/* insn dupn(n)(...)(...) */ -INSN_ENTRY(dupn) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(dupn); - DEBUG_ENTER_INSN("dupn"); - - /* ### Declare and assign variables. ### */ - rb_num_t n = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _dupn(n) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN dupn -# line 642 "insns.def" -{ - void *dst = GET_SP(); - void *src = STACK_ADDR_FROM_TOP(n); - - MEMCPY(dst, src, VALUE, n); -} -# line 1802 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(dupn); -} - -/* insn swap()(val, obj)(obj, val) */ -INSN_ENTRY(swap) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(swap); - DEBUG_ENTER_INSN("swap"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _swap() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(1); - VALUE obj = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - TOPN(1) = obj; - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(swap); -} - -/* insn opt_reverse(n)(...)(...) */ -INSN_ENTRY(opt_reverse) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_reverse); - DEBUG_ENTER_INSN("opt_reverse"); - - /* ### Declare and assign variables. ### */ - rb_num_t n = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_reverse(n) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_reverse -# line 666 "insns.def" -{ - rb_num_t i; - VALUE *sp = STACK_ADDR_FROM_TOP(n); - - for (i=0; iiseq_encoded, GET_SP(), - ISEQ_BODY(class_iseq)->local_table_size, - ISEQ_BODY(class_iseq)->stack_max); - RESTORE_REGS(); - NEXT_INSN(); -} -# line 2266 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(defineclass); -} - -/* insn definemethod(id, iseq)()() */ -INSN_ENTRY(definemethod) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(definemethod); - DEBUG_ENTER_INSN("definemethod"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ISEQ iseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _definemethod(id, iseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, iseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN definemethod -# line 824 "insns.def" -{ - vm_define_method(ec, Qnil, id, (VALUE)iseq, FALSE); -} -# line 2306 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(definemethod); -} - -/* insn definesmethod(id, iseq)(obj)() */ -INSN_ENTRY(definesmethod) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(definesmethod); - DEBUG_ENTER_INSN("definesmethod"); - - /* ### Declare and assign variables. ### */ - ID id = (ID)GET_OPERAND(1); - ISEQ iseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _definesmethod(id, iseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE obj = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, iseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN definesmethod -# line 833 "insns.def" -{ - vm_define_method(ec, obj, id, (VALUE)iseq, TRUE); -} -# line 2346 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(definesmethod); -} - -/* insn send(cd, blockiseq)(...)(val) */ -INSN_ENTRY(send) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(send); - DEBUG_ENTER_INSN("send"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); - ISEQ blockiseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _send(cd, blockiseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, blockiseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN send -# line 849 "insns.def" -{ - VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, false); - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2393 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(send); -} - -/* insn sendforward(cd, blockiseq)(...)(val) */ -INSN_ENTRY(sendforward) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(sendforward); - DEBUG_ENTER_INSN("sendforward"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); - ISEQ blockiseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _sendforward(cd, blockiseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, blockiseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN sendforward -# line 868 "insns.def" -{ - struct rb_forwarding_call_data adjusted_cd; - struct rb_callinfo adjusted_ci; - - VALUE bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), cd, blockiseq, 0, &adjusted_cd, &adjusted_ci); - - val = vm_sendish(ec, GET_CFP(), &adjusted_cd.cd, bh, mexp_search_method); - JIT_EXEC(ec, val); - - if (cd->cc != adjusted_cd.cd.cc && vm_cc_markable(adjusted_cd.cd.cc)) { - RB_OBJ_WRITE(GET_ISEQ(), &cd->cc, adjusted_cd.cd.cc); - } - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2449 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(sendforward); -} - -/* insn opt_send_without_block(cd)(...)(val) */ -INSN_ENTRY(opt_send_without_block) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_send_without_block); - DEBUG_ENTER_INSN("opt_send_without_block"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_send_without_block(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_send_without_block -# line 896 "insns.def" -{ - VALUE bh = VM_BLOCK_HANDLER_NONE; - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2495 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_send_without_block); -} - -/* insn objtostring(cd)(recv)(val) */ -INSN_ENTRY(objtostring) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(objtostring); - DEBUG_ENTER_INSN("objtostring"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _objtostring(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN objtostring -# line 914 "insns.def" -{ - val = vm_objtostring(GET_ISEQ(), recv, cd); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 2538 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(objtostring); -} - -/* insn opt_ary_freeze(ary, cd)()(val) */ -INSN_ENTRY(opt_ary_freeze) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_ary_freeze); - DEBUG_ENTER_INSN("opt_ary_freeze"); - - /* ### Declare and assign variables. ### */ - VALUE ary = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_ary_freeze(ary, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ary); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_ary_freeze -# line 927 "insns.def" -{ - val = vm_opt_ary_freeze(ary, BOP_FREEZE, idFreeze); - - if (UNDEF_P(val)) { - RUBY_DTRACE_CREATE_HOOK(ARRAY, RARRAY_LEN(ary)); - PUSH(rb_ary_resurrect(ary)); - CALL_SIMPLE_METHOD(); - } -} -# line 2587 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_ary_freeze); -} - -/* insn opt_hash_freeze(hash, cd)()(val) */ -INSN_ENTRY(opt_hash_freeze) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_hash_freeze); - DEBUG_ENTER_INSN("opt_hash_freeze"); - - /* ### Declare and assign variables. ### */ - VALUE hash = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_hash_freeze(hash, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_hash_freeze -# line 942 "insns.def" -{ - val = vm_opt_hash_freeze(hash, BOP_FREEZE, idFreeze); - - if (UNDEF_P(val)) { - RUBY_DTRACE_CREATE_HOOK(HASH, RHASH_SIZE(hash) << 1); - PUSH(rb_hash_resurrect(hash)); - CALL_SIMPLE_METHOD(); - } -} -# line 2636 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_hash_freeze); -} - -/* insn opt_str_freeze(str, cd)()(val) */ -INSN_ENTRY(opt_str_freeze) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_str_freeze); - DEBUG_ENTER_INSN("opt_str_freeze"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_str_freeze(str, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_str_freeze -# line 957 "insns.def" -{ - val = vm_opt_str_freeze(str, BOP_FREEZE, idFreeze); - - if (UNDEF_P(val)) { - PUSH(rb_str_resurrect(str)); - CALL_SIMPLE_METHOD(); - } -} -# line 2684 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_str_freeze); -} - -/* insn opt_nil_p(cd)(recv)(val) */ -INSN_ENTRY(opt_nil_p) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_nil_p); - DEBUG_ENTER_INSN("opt_nil_p"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_nil_p(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_nil_p -# line 972 "insns.def" -{ - val = vm_opt_nil_p(GET_ISEQ(), cd, recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 2730 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_nil_p); -} - -/* insn opt_str_uminus(str, cd)()(val) */ -INSN_ENTRY(opt_str_uminus) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_str_uminus); - DEBUG_ENTER_INSN("opt_str_uminus"); - - /* ### Declare and assign variables. ### */ - VALUE str = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_str_uminus(str, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_str_uminus -# line 985 "insns.def" -{ - val = vm_opt_str_freeze(str, BOP_UMINUS, idUMinus); - - if (UNDEF_P(val)) { - PUSH(rb_str_resurrect(str)); - CALL_SIMPLE_METHOD(); - } -} -# line 2778 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_str_uminus); -} - -/* insn opt_newarray_send(num, method)(...)(val) */ -INSN_ENTRY(opt_newarray_send) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_newarray_send); - DEBUG_ENTER_INSN("opt_newarray_send"); - - /* ### Declare and assign variables. ### */ - rb_num_t num = (rb_num_t)GET_OPERAND(1); - rb_num_t method = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_newarray_send(num, method) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, method); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_newarray_send -# line 1006 "insns.def" -{ - switch(method) { - case VM_OPT_NEWARRAY_SEND_HASH: - val = vm_opt_newarray_hash(ec, num, STACK_ADDR_FROM_TOP(num)); - break; - case VM_OPT_NEWARRAY_SEND_MIN: - val = vm_opt_newarray_min(ec, num, STACK_ADDR_FROM_TOP(num)); - break; - case VM_OPT_NEWARRAY_SEND_MAX: - val = vm_opt_newarray_max(ec, num, STACK_ADDR_FROM_TOP(num)); - break; - case VM_OPT_NEWARRAY_SEND_PACK: - val = vm_opt_newarray_pack_buffer(ec, (long)num-1, STACK_ADDR_FROM_TOP(num), TOPN(0), Qundef); - break; - case VM_OPT_NEWARRAY_SEND_PACK_BUFFER: - val = vm_opt_newarray_pack_buffer(ec, (long)num-2, STACK_ADDR_FROM_TOP(num), TOPN(1), TOPN(0)); - break; - default: - rb_bug("unreachable"); - } -} -# line 2839 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_newarray_send); -} - -/* insn invokesuper(cd, blockiseq)(...)(val) */ -INSN_ENTRY(invokesuper) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokesuper); - DEBUG_ENTER_INSN("invokesuper"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); - ISEQ blockiseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _invokesuper(cd, blockiseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, blockiseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokesuper -# line 1036 "insns.def" -{ - VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, true); - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2890 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokesuper); -} - -/* insn invokesuperforward(cd, blockiseq)(...)(val) */ -INSN_ENTRY(invokesuperforward) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokesuperforward); - DEBUG_ENTER_INSN("invokesuperforward"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); - ISEQ blockiseq = (ISEQ)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _invokesuperforward(cd, blockiseq) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, blockiseq); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokesuperforward -# line 1055 "insns.def" -{ - struct rb_forwarding_call_data adjusted_cd; - struct rb_callinfo adjusted_ci; - - VALUE bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), cd, blockiseq, 1, &adjusted_cd, &adjusted_ci); - - val = vm_sendish(ec, GET_CFP(), &adjusted_cd.cd, bh, mexp_search_super); - JIT_EXEC(ec, val); - - if (cd->cc != adjusted_cd.cd.cc && vm_cc_markable(adjusted_cd.cd.cc)) { - RB_OBJ_WRITE(GET_ISEQ(), &cd->cc, adjusted_cd.cd.cc); - } - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2946 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokesuperforward); -} - -/* insn invokeblock(cd)(...)(val) */ -INSN_ENTRY(invokeblock) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokeblock); - DEBUG_ENTER_INSN("invokeblock"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _invokeblock(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokeblock -# line 1083 "insns.def" -{ - VALUE bh = VM_BLOCK_HANDLER_NONE; - val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_invokeblock); - JIT_EXEC(ec, val); - - if (UNDEF_P(val)) { - RESTORE_REGS(); - NEXT_INSN(); - } -} -# line 2992 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokeblock); -} - -/* insn leave()(val)(val) */ -INSN_ENTRY(leave) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(leave); - DEBUG_ENTER_INSN("leave"); - - /* ### Declare and assign variables. ### */ -# define INSN_ATTR(x) attr_ ## x ## _leave() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN leave -# line 1105 "insns.def" -{ - if (OPT_CHECKED_RUN) { - const VALUE *const bp = vm_base_ptr(GET_CFP()); - if (GET_SP() != bp) { - vm_stack_consistency_error(ec, GET_CFP(), bp); - } - } - - if (vm_pop_frame(ec, GET_CFP(), GET_EP())) { -# if OPT_CALL_THREADED_CODE - rb_ec_thread_ptr(ec)->retval = val; - return 0; -# else - return val; -# endif - } - else { - RESTORE_REGS(); - } -} -# line 3046 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(leave); -} - -/* insn throw(throw_state)(throwobj)(val) */ -INSN_ENTRY(throw) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(throw); - DEBUG_ENTER_INSN("throw"); - - /* ### Declare and assign variables. ### */ - rb_num_t throw_state = (rb_num_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _throw(throw_state) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE throwobj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, throw_state); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN throw -# line 1138 "insns.def" -{ - val = vm_throw(ec, GET_CFP(), throw_state, throwobj); - THROW_EXCEPTION(val); - /* unreachable */ -} -# line 3087 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(throw); -} - -/* insn jump(dst)()() */ -INSN_ENTRY(jump) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(jump); - DEBUG_ENTER_INSN("jump"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _jump(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN jump -# line 1156 "insns.def" -{ - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); -} -# line 3128 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(jump); -} - -/* insn branchif(dst)(val)() */ -INSN_ENTRY(branchif) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(branchif); - DEBUG_ENTER_INSN("branchif"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _branchif(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN branchif -# line 1169 "insns.def" -{ - if (RTEST(val)) { - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); - } -} -# line 3169 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(branchif); -} - -/* insn branchunless(dst)(val)() */ -INSN_ENTRY(branchunless) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(branchunless); - DEBUG_ENTER_INSN("branchunless"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _branchunless(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN branchunless -# line 1184 "insns.def" -{ - if (!RTEST(val)) { - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); - } -} -# line 3210 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(branchunless); -} - -/* insn branchnil(dst)(val)() */ -INSN_ENTRY(branchnil) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(branchnil); - DEBUG_ENTER_INSN("branchnil"); - - /* ### Declare and assign variables. ### */ - OFFSET dst = (OFFSET)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _branchnil(dst) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN branchnil -# line 1199 "insns.def" -{ - if (NIL_P(val)) { - RUBY_VM_CHECK_INTS(ec); - JUMP(dst); - } -} -# line 3251 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(branchnil); -} - -/* insn once(iseq, ise)()(val) */ -INSN_ENTRY(once) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(once); - DEBUG_ENTER_INSN("once"); - - /* ### Declare and assign variables. ### */ - ISEQ iseq = (ISEQ)GET_OPERAND(1); - ISE ise = (ISE)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _once(iseq, ise) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - POPN(INSN_ATTR(popn)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, iseq); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, ise); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN once -# line 1216 "insns.def" -{ - val = vm_once_dispatch(ec, iseq, ise); -} -# line 3292 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - PUSH(val); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(once); -} - -/* insn opt_case_dispatch(hash, else_offset)(..., key)() */ -INSN_ENTRY(opt_case_dispatch) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_case_dispatch); - DEBUG_ENTER_INSN("opt_case_dispatch"); - - /* ### Declare and assign variables. ### */ - CDHASH hash = (CDHASH)GET_OPERAND(1); - OFFSET else_offset = (OFFSET)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_case_dispatch(hash, else_offset) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE key = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, else_offset); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_case_dispatch -# line 1227 "insns.def" -{ - OFFSET dst = vm_case_dispatch(hash, else_offset, key); - - if (dst) { - JUMP(dst); - } -} -# line 3336 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_case_dispatch); -} - -/* insn opt_plus(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_plus) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_plus); - DEBUG_ENTER_INSN("opt_plus"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_plus(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_plus -# line 1243 "insns.def" -{ - val = vm_opt_plus(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3380 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_plus); -} - -/* insn opt_minus(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_minus) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_minus); - DEBUG_ENTER_INSN("opt_minus"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_minus(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_minus -# line 1257 "insns.def" -{ - val = vm_opt_minus(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3427 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_minus); -} - -/* insn opt_mult(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_mult) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_mult); - DEBUG_ENTER_INSN("opt_mult"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_mult(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_mult -# line 1271 "insns.def" -{ - val = vm_opt_mult(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3474 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_mult); -} - -/* insn opt_div(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_div) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_div); - DEBUG_ENTER_INSN("opt_div"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_div(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_div -# line 1288 "insns.def" -{ - val = vm_opt_div(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3521 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_div); -} - -/* insn opt_mod(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_mod) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_mod); - DEBUG_ENTER_INSN("opt_mod"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_mod(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_mod -# line 1304 "insns.def" -{ - val = vm_opt_mod(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3568 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_mod); -} - -/* insn opt_eq(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_eq) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_eq); - DEBUG_ENTER_INSN("opt_eq"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_eq(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_eq -# line 1318 "insns.def" -{ - val = opt_equality(GET_ISEQ(), recv, obj, cd); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3615 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_eq); -} - -/* insn opt_neq(cd_eq, cd)(recv, obj)(val) */ -INSN_ENTRY(opt_neq) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_neq); - DEBUG_ENTER_INSN("opt_neq"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd_eq = (CALL_DATA)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_neq(cd_eq, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd_eq); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_neq -# line 1332 "insns.def" -{ - val = vm_opt_neq(GET_ISEQ(), cd, cd_eq, recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3664 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_neq); -} - -/* insn opt_lt(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_lt) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_lt); - DEBUG_ENTER_INSN("opt_lt"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_lt(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_lt -# line 1346 "insns.def" -{ - val = vm_opt_lt(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3711 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_lt); -} - -/* insn opt_le(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_le) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_le); - DEBUG_ENTER_INSN("opt_le"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_le(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_le -# line 1360 "insns.def" -{ - val = vm_opt_le(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3758 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_le); -} - -/* insn opt_gt(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_gt) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_gt); - DEBUG_ENTER_INSN("opt_gt"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_gt(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_gt -# line 1374 "insns.def" -{ - val = vm_opt_gt(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3805 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_gt); -} - -/* insn opt_ge(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_ge) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_ge); - DEBUG_ENTER_INSN("opt_ge"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_ge(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_ge -# line 1388 "insns.def" -{ - val = vm_opt_ge(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3852 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_ge); -} - -/* insn opt_ltlt(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_ltlt) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_ltlt); - DEBUG_ENTER_INSN("opt_ltlt"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_ltlt(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_ltlt -# line 1406 "insns.def" -{ - val = vm_opt_ltlt(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3899 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_ltlt); -} - -/* insn opt_and(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_and) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_and); - DEBUG_ENTER_INSN("opt_and"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_and(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_and -# line 1420 "insns.def" -{ - val = vm_opt_and(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3946 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_and); -} - -/* insn opt_or(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_or) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_or); - DEBUG_ENTER_INSN("opt_or"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_or(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_or -# line 1434 "insns.def" -{ - val = vm_opt_or(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 3993 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_or); -} - -/* insn opt_aref(cd)(recv, obj)(val) */ -INSN_ENTRY(opt_aref) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aref); - DEBUG_ENTER_INSN("opt_aref"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_aref(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE obj = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aref -# line 1453 "insns.def" -{ - val = vm_opt_aref(recv, obj); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4040 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aref); -} - -/* insn opt_aset(cd)(recv, obj, set)(val) */ -INSN_ENTRY(opt_aset) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aset); - DEBUG_ENTER_INSN("opt_aset"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_aset(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(2); - VALUE obj = TOPN(1); - VALUE set = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aset -# line 1470 "insns.def" -{ - val = vm_opt_aset(recv, obj, set); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4088 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aset); -} - -/* insn opt_aset_with(key, cd)(recv, val)(val) */ -INSN_ENTRY(opt_aset_with) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aset_with); - DEBUG_ENTER_INSN("opt_aset_with"); - - /* ### Declare and assign variables. ### */ - VALUE key = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_aset_with(key, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(1); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aset_with -# line 1486 "insns.def" -{ - VALUE tmp = vm_opt_aset_with(recv, key, val); - - if (!UNDEF_P(tmp)) { - val = tmp; - } - else { - TOPN(0) = rb_str_resurrect(key); - PUSH(val); - CALL_SIMPLE_METHOD(); - } -} -# line 4141 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aset_with); -} - -/* insn opt_aref_with(key, cd)(recv)(val) */ -INSN_ENTRY(opt_aref_with) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_aref_with); - DEBUG_ENTER_INSN("opt_aref_with"); - - /* ### Declare and assign variables. ### */ - VALUE key = (VALUE)GET_OPERAND(1); - CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_aref_with(key, cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_aref_with -# line 1507 "insns.def" -{ - val = vm_opt_aref_with(recv, key); - - if (UNDEF_P(val)) { - PUSH(rb_str_resurrect(key)); - CALL_SIMPLE_METHOD(); - } -} -# line 4190 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_aref_with); -} - -/* insn opt_length(cd)(recv)(val) */ -INSN_ENTRY(opt_length) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_length); - DEBUG_ENTER_INSN("opt_length"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_length(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_length -# line 1522 "insns.def" -{ - val = vm_opt_length(recv, BOP_LENGTH); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4236 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_length); -} - -/* insn opt_size(cd)(recv)(val) */ -INSN_ENTRY(opt_size) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_size); - DEBUG_ENTER_INSN("opt_size"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_size(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_size -# line 1536 "insns.def" -{ - val = vm_opt_length(recv, BOP_SIZE); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4282 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_size); -} - -/* insn opt_empty_p(cd)(recv)(val) */ -INSN_ENTRY(opt_empty_p) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_empty_p); - DEBUG_ENTER_INSN("opt_empty_p"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_empty_p(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_empty_p -# line 1550 "insns.def" -{ - val = vm_opt_empty_p(recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4328 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_empty_p); -} - -/* insn opt_succ(cd)(recv)(val) */ -INSN_ENTRY(opt_succ) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_succ); - DEBUG_ENTER_INSN("opt_succ"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_succ(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_succ -# line 1564 "insns.def" -{ - val = vm_opt_succ(recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4374 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_succ); -} - -/* insn opt_not(cd)(recv)(val) */ -INSN_ENTRY(opt_not) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_not); - DEBUG_ENTER_INSN("opt_not"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_not(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE recv = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_not -# line 1578 "insns.def" -{ - val = vm_opt_not(GET_ISEQ(), cd, recv); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4420 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_not); -} - -/* insn opt_regexpmatch2(cd)(obj2, obj1)(val) */ -INSN_ENTRY(opt_regexpmatch2) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_regexpmatch2); - DEBUG_ENTER_INSN("opt_regexpmatch2"); - - /* ### Declare and assign variables. ### */ - CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _opt_regexpmatch2(cd) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE obj2 = TOPN(1); - VALUE obj1 = TOPN(0); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_regexpmatch2 -# line 1593 "insns.def" -{ - val = vm_opt_regexpmatch2(obj2, obj1); - - if (UNDEF_P(val)) { - CALL_SIMPLE_METHOD(); - } -} -# line 4467 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_regexpmatch2); -} - -/* insn invokebuiltin(bf)(...)(val) */ -INSN_ENTRY(invokebuiltin) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(invokebuiltin); - DEBUG_ENTER_INSN("invokebuiltin"); - - /* ### Declare and assign variables. ### */ - RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _invokebuiltin(bf) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN invokebuiltin -# line 1609 "insns.def" -{ - val = vm_invoke_builtin(ec, reg_cfp, bf, STACK_ADDR_FROM_TOP(bf->argc)); -} -# line 4508 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(invokebuiltin); -} - -/* insn opt_invokebuiltin_delegate(bf, index)()(val) */ -INSN_ENTRY(opt_invokebuiltin_delegate) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_invokebuiltin_delegate); - DEBUG_ENTER_INSN("opt_invokebuiltin_delegate"); - - /* ### Declare and assign variables. ### */ - RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); - rb_num_t index = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_invokebuiltin_delegate(bf, index) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, index); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_invokebuiltin_delegate -# line 1620 "insns.def" -{ - val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index); -} -# line 4551 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_invokebuiltin_delegate); -} - -/* insn opt_invokebuiltin_delegate_leave(bf, index)()(val) */ -INSN_ENTRY(opt_invokebuiltin_delegate_leave) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(opt_invokebuiltin_delegate_leave); - DEBUG_ENTER_INSN("opt_invokebuiltin_delegate_leave"); - - /* ### Declare and assign variables. ### */ - RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); - rb_num_t index = (rb_num_t)GET_OPERAND(2); -# define INSN_ATTR(x) attr_ ## x ## _opt_invokebuiltin_delegate_leave(bf, index) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, index); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN opt_invokebuiltin_delegate_leave -# line 1631 "insns.def" -{ - val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index); - - /* leave fastpath */ - /* TracePoint/return fallbacks this insn to opt_invokebuiltin_delegate */ - if (vm_pop_frame(ec, GET_CFP(), GET_EP())) { -# if OPT_CALL_THREADED_CODE - rb_ec_thread_ptr(ec)->retval = val; - return 0; -# else - return val; -# endif - } - else { - RESTORE_REGS(); - } -} -# line 4608 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(opt_invokebuiltin_delegate_leave); -} - -/* insn getlocal_WC_0(idx)()(val) */ -INSN_ENTRY(getlocal_WC_0) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getlocal_WC_0); - DEBUG_ENTER_INSN("getlocal_WC_0"); - - /* ### Declare and assign variables. ### */ -#line 10 "defs/opt_operand.def" - const rb_num_t level = 0; -#line 4634 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getlocal_WC_0(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getlocal_WC_0 -# line 81 "insns.def" -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} -# line 4654 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getlocal_WC_0); -} - -/* insn getlocal_WC_1(idx)()(val) */ -INSN_ENTRY(getlocal_WC_1) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(getlocal_WC_1); - DEBUG_ENTER_INSN("getlocal_WC_1"); - - /* ### Declare and assign variables. ### */ -#line 11 "defs/opt_operand.def" - const rb_num_t level = 1; -#line 4680 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _getlocal_WC_1(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val; - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN getlocal_WC_1 -# line 81 "insns.def" -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} -# line 4700 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(getlocal_WC_1); -} - -/* insn setlocal_WC_0(idx)(val)() */ -INSN_ENTRY(setlocal_WC_0) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setlocal_WC_0); - DEBUG_ENTER_INSN("setlocal_WC_0"); - - /* ### Declare and assign variables. ### */ -#line 12 "defs/opt_operand.def" - const rb_num_t level = 0; -#line 4726 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setlocal_WC_0(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setlocal_WC_0 -# line 95 "insns.def" -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} -# line 4746 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setlocal_WC_0); -} - -/* insn setlocal_WC_1(idx)(val)() */ -INSN_ENTRY(setlocal_WC_1) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(setlocal_WC_1); - DEBUG_ENTER_INSN("setlocal_WC_1"); - - /* ### Declare and assign variables. ### */ -#line 13 "defs/opt_operand.def" - const rb_num_t level = 1; -#line 4769 "vm.inc" - lindex_t idx = (lindex_t)GET_OPERAND(1); -# define INSN_ATTR(x) attr_ ## x ## _setlocal_WC_1(idx) - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - VALUE val = TOPN(0); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - SETUP_CANARY(leaf); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); - - /* ### Here we do the instruction body. ### */ -# define NAME_OF_CURRENT_INSN setlocal_WC_1 -# line 95 "insns.def" -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} -# line 4789 "vm.inc" -# undef NAME_OF_CURRENT_INSN - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - CHECK_CANARY(leaf, INSN_ATTR(bin)); - INC_SP(INSN_ATTR(sp_inc)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(setlocal_WC_1); -} - -/* insn putobject_INT2FIX_0_()()(val) */ -INSN_ENTRY(putobject_INT2FIX_0_) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putobject_INT2FIX_0_); - DEBUG_ENTER_INSN("putobject_INT2FIX_0_"); - - /* ### Declare and assign variables. ### */ -#line 15 "defs/opt_operand.def" - const VALUE val = INT2FIX(0); -#line 4812 "vm.inc" -# define INSN_ATTR(x) attr_ ## x ## _putobject_INT2FIX_0_() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putobject_INT2FIX_0_); -} - -/* insn putobject_INT2FIX_1_()()(val) */ -INSN_ENTRY(putobject_INT2FIX_1_) -{ - /* ### Declare that we have just entered into an instruction. ### */ - START_OF_ORIGINAL_INSN(putobject_INT2FIX_1_); - DEBUG_ENTER_INSN("putobject_INT2FIX_1_"); - - /* ### Declare and assign variables. ### */ -#line 16 "defs/opt_operand.def" - const VALUE val = INT2FIX(1); -#line 4842 "vm.inc" -# define INSN_ATTR(x) attr_ ## x ## _putobject_INT2FIX_1_() - const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); - - /* ### Instruction preambles. ### */ - ADD_PC(INSN_ATTR(width)); - COLLECT_USAGE_INSN(INSN_ATTR(bin)); - - /* ### Instruction trailers. ### */ - CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); - INC_SP(INSN_ATTR(sp_inc)); - TOPN(0) = val; - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); - VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); -# undef INSN_ATTR - - /* ### Leave the instruction. ### */ - END_INSN(putobject_INT2FIX_1_); -} - -/* insn trace_nop(...)(...)(...) */ -INSN_ENTRY(trace_nop) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(nop); - END_INSN(trace_nop); -} - -/* insn trace_getlocal(...)(...)(...) */ -INSN_ENTRY(trace_getlocal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getlocal); - END_INSN(trace_getlocal); -} - -/* insn trace_setlocal(...)(...)(...) */ -INSN_ENTRY(trace_setlocal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setlocal); - END_INSN(trace_setlocal); -} - -/* insn trace_getblockparam(...)(...)(...) */ -INSN_ENTRY(trace_getblockparam) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getblockparam); - END_INSN(trace_getblockparam); -} - -/* insn trace_setblockparam(...)(...)(...) */ -INSN_ENTRY(trace_setblockparam) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setblockparam); - END_INSN(trace_setblockparam); -} - -/* insn trace_getblockparamproxy(...)(...)(...) */ -INSN_ENTRY(trace_getblockparamproxy) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getblockparamproxy); - END_INSN(trace_getblockparamproxy); -} - -/* insn trace_getspecial(...)(...)(...) */ -INSN_ENTRY(trace_getspecial) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getspecial); - END_INSN(trace_getspecial); -} - -/* insn trace_setspecial(...)(...)(...) */ -INSN_ENTRY(trace_setspecial) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setspecial); - END_INSN(trace_setspecial); -} - -/* insn trace_getinstancevariable(...)(...)(...) */ -INSN_ENTRY(trace_getinstancevariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getinstancevariable); - END_INSN(trace_getinstancevariable); -} - -/* insn trace_setinstancevariable(...)(...)(...) */ -INSN_ENTRY(trace_setinstancevariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setinstancevariable); - END_INSN(trace_setinstancevariable); -} - -/* insn trace_getclassvariable(...)(...)(...) */ -INSN_ENTRY(trace_getclassvariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getclassvariable); - END_INSN(trace_getclassvariable); -} - -/* insn trace_setclassvariable(...)(...)(...) */ -INSN_ENTRY(trace_setclassvariable) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setclassvariable); - END_INSN(trace_setclassvariable); -} - -/* insn trace_opt_getconstant_path(...)(...)(...) */ -INSN_ENTRY(trace_opt_getconstant_path) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_getconstant_path); - END_INSN(trace_opt_getconstant_path); -} - -/* insn trace_getconstant(...)(...)(...) */ -INSN_ENTRY(trace_getconstant) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getconstant); - END_INSN(trace_getconstant); -} - -/* insn trace_setconstant(...)(...)(...) */ -INSN_ENTRY(trace_setconstant) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setconstant); - END_INSN(trace_setconstant); -} - -/* insn trace_getglobal(...)(...)(...) */ -INSN_ENTRY(trace_getglobal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getglobal); - END_INSN(trace_getglobal); -} - -/* insn trace_setglobal(...)(...)(...) */ -INSN_ENTRY(trace_setglobal) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setglobal); - END_INSN(trace_setglobal); -} - -/* insn trace_putnil(...)(...)(...) */ -INSN_ENTRY(trace_putnil) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putnil); - END_INSN(trace_putnil); -} - -/* insn trace_putself(...)(...)(...) */ -INSN_ENTRY(trace_putself) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putself); - END_INSN(trace_putself); -} - -/* insn trace_putobject(...)(...)(...) */ -INSN_ENTRY(trace_putobject) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putobject); - END_INSN(trace_putobject); -} - -/* insn trace_putspecialobject(...)(...)(...) */ -INSN_ENTRY(trace_putspecialobject) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putspecialobject); - END_INSN(trace_putspecialobject); -} - -/* insn trace_putstring(...)(...)(...) */ -INSN_ENTRY(trace_putstring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putstring); - END_INSN(trace_putstring); -} - -/* insn trace_putchilledstring(...)(...)(...) */ -INSN_ENTRY(trace_putchilledstring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putchilledstring); - END_INSN(trace_putchilledstring); -} - -/* insn trace_concatstrings(...)(...)(...) */ -INSN_ENTRY(trace_concatstrings) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(concatstrings); - END_INSN(trace_concatstrings); -} - -/* insn trace_anytostring(...)(...)(...) */ -INSN_ENTRY(trace_anytostring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(anytostring); - END_INSN(trace_anytostring); -} - -/* insn trace_toregexp(...)(...)(...) */ -INSN_ENTRY(trace_toregexp) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(toregexp); - END_INSN(trace_toregexp); -} - -/* insn trace_intern(...)(...)(...) */ -INSN_ENTRY(trace_intern) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(intern); - END_INSN(trace_intern); -} - -/* insn trace_newarray(...)(...)(...) */ -INSN_ENTRY(trace_newarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newarray); - END_INSN(trace_newarray); -} - -/* insn trace_pushtoarraykwsplat(...)(...)(...) */ -INSN_ENTRY(trace_pushtoarraykwsplat) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(pushtoarraykwsplat); - END_INSN(trace_pushtoarraykwsplat); -} - -/* insn trace_duparray(...)(...)(...) */ -INSN_ENTRY(trace_duparray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(duparray); - END_INSN(trace_duparray); -} - -/* insn trace_duphash(...)(...)(...) */ -INSN_ENTRY(trace_duphash) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(duphash); - END_INSN(trace_duphash); -} - -/* insn trace_expandarray(...)(...)(...) */ -INSN_ENTRY(trace_expandarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(expandarray); - END_INSN(trace_expandarray); -} - -/* insn trace_concatarray(...)(...)(...) */ -INSN_ENTRY(trace_concatarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(concatarray); - END_INSN(trace_concatarray); -} - -/* insn trace_concattoarray(...)(...)(...) */ -INSN_ENTRY(trace_concattoarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(concattoarray); - END_INSN(trace_concattoarray); -} - -/* insn trace_pushtoarray(...)(...)(...) */ -INSN_ENTRY(trace_pushtoarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(pushtoarray); - END_INSN(trace_pushtoarray); -} - -/* insn trace_splatarray(...)(...)(...) */ -INSN_ENTRY(trace_splatarray) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(splatarray); - END_INSN(trace_splatarray); -} - -/* insn trace_splatkw(...)(...)(...) */ -INSN_ENTRY(trace_splatkw) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(splatkw); - END_INSN(trace_splatkw); -} - -/* insn trace_newhash(...)(...)(...) */ -INSN_ENTRY(trace_newhash) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newhash); - END_INSN(trace_newhash); -} - -/* insn trace_newrange(...)(...)(...) */ -INSN_ENTRY(trace_newrange) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(newrange); - END_INSN(trace_newrange); -} - -/* insn trace_pop(...)(...)(...) */ -INSN_ENTRY(trace_pop) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(pop); - END_INSN(trace_pop); -} - -/* insn trace_dup(...)(...)(...) */ -INSN_ENTRY(trace_dup) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(dup); - END_INSN(trace_dup); -} - -/* insn trace_dupn(...)(...)(...) */ -INSN_ENTRY(trace_dupn) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(dupn); - END_INSN(trace_dupn); -} - -/* insn trace_swap(...)(...)(...) */ -INSN_ENTRY(trace_swap) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(swap); - END_INSN(trace_swap); -} - -/* insn trace_opt_reverse(...)(...)(...) */ -INSN_ENTRY(trace_opt_reverse) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_reverse); - END_INSN(trace_opt_reverse); -} - -/* insn trace_topn(...)(...)(...) */ -INSN_ENTRY(trace_topn) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(topn); - END_INSN(trace_topn); -} - -/* insn trace_setn(...)(...)(...) */ -INSN_ENTRY(trace_setn) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setn); - END_INSN(trace_setn); -} - -/* insn trace_adjuststack(...)(...)(...) */ -INSN_ENTRY(trace_adjuststack) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(adjuststack); - END_INSN(trace_adjuststack); -} - -/* insn trace_defined(...)(...)(...) */ -INSN_ENTRY(trace_defined) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(defined); - END_INSN(trace_defined); -} - -/* insn trace_definedivar(...)(...)(...) */ -INSN_ENTRY(trace_definedivar) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(definedivar); - END_INSN(trace_definedivar); -} - -/* insn trace_checkmatch(...)(...)(...) */ -INSN_ENTRY(trace_checkmatch) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(checkmatch); - END_INSN(trace_checkmatch); -} - -/* insn trace_checkkeyword(...)(...)(...) */ -INSN_ENTRY(trace_checkkeyword) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(checkkeyword); - END_INSN(trace_checkkeyword); -} - -/* insn trace_checktype(...)(...)(...) */ -INSN_ENTRY(trace_checktype) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(checktype); - END_INSN(trace_checktype); -} - -/* insn trace_defineclass(...)(...)(...) */ -INSN_ENTRY(trace_defineclass) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(defineclass); - END_INSN(trace_defineclass); -} - -/* insn trace_definemethod(...)(...)(...) */ -INSN_ENTRY(trace_definemethod) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(definemethod); - END_INSN(trace_definemethod); -} - -/* insn trace_definesmethod(...)(...)(...) */ -INSN_ENTRY(trace_definesmethod) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(definesmethod); - END_INSN(trace_definesmethod); -} - -/* insn trace_send(...)(...)(...) */ -INSN_ENTRY(trace_send) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(send); - END_INSN(trace_send); -} - -/* insn trace_sendforward(...)(...)(...) */ -INSN_ENTRY(trace_sendforward) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(sendforward); - END_INSN(trace_sendforward); -} - -/* insn trace_opt_send_without_block(...)(...)(...) */ -INSN_ENTRY(trace_opt_send_without_block) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_send_without_block); -} - -/* insn trace_objtostring(...)(...)(...) */ -INSN_ENTRY(trace_objtostring) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(objtostring); - END_INSN(trace_objtostring); -} - -/* insn trace_opt_ary_freeze(...)(...)(...) */ -INSN_ENTRY(trace_opt_ary_freeze) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_ary_freeze); - END_INSN(trace_opt_ary_freeze); -} - -/* insn trace_opt_hash_freeze(...)(...)(...) */ -INSN_ENTRY(trace_opt_hash_freeze) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_hash_freeze); - END_INSN(trace_opt_hash_freeze); -} - -/* insn trace_opt_str_freeze(...)(...)(...) */ -INSN_ENTRY(trace_opt_str_freeze) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_str_freeze); - END_INSN(trace_opt_str_freeze); -} - -/* insn trace_opt_nil_p(...)(...)(...) */ -INSN_ENTRY(trace_opt_nil_p) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_nil_p); -} - -/* insn trace_opt_str_uminus(...)(...)(...) */ -INSN_ENTRY(trace_opt_str_uminus) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_str_uminus); - END_INSN(trace_opt_str_uminus); -} - -/* insn trace_opt_newarray_send(...)(...)(...) */ -INSN_ENTRY(trace_opt_newarray_send) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_newarray_send); - END_INSN(trace_opt_newarray_send); -} - -/* insn trace_invokesuper(...)(...)(...) */ -INSN_ENTRY(trace_invokesuper) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokesuper); - END_INSN(trace_invokesuper); -} - -/* insn trace_invokesuperforward(...)(...)(...) */ -INSN_ENTRY(trace_invokesuperforward) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokesuperforward); - END_INSN(trace_invokesuperforward); -} - -/* insn trace_invokeblock(...)(...)(...) */ -INSN_ENTRY(trace_invokeblock) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokeblock); - END_INSN(trace_invokeblock); -} - -/* insn trace_leave(...)(...)(...) */ -INSN_ENTRY(trace_leave) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(leave); - END_INSN(trace_leave); -} - -/* insn trace_throw(...)(...)(...) */ -INSN_ENTRY(trace_throw) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(throw); - END_INSN(trace_throw); -} - -/* insn trace_jump(...)(...)(...) */ -INSN_ENTRY(trace_jump) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(jump); - END_INSN(trace_jump); -} - -/* insn trace_branchif(...)(...)(...) */ -INSN_ENTRY(trace_branchif) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(branchif); - END_INSN(trace_branchif); -} - -/* insn trace_branchunless(...)(...)(...) */ -INSN_ENTRY(trace_branchunless) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(branchunless); - END_INSN(trace_branchunless); -} - -/* insn trace_branchnil(...)(...)(...) */ -INSN_ENTRY(trace_branchnil) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(branchnil); - END_INSN(trace_branchnil); -} - -/* insn trace_once(...)(...)(...) */ -INSN_ENTRY(trace_once) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(once); - END_INSN(trace_once); -} - -/* insn trace_opt_case_dispatch(...)(...)(...) */ -INSN_ENTRY(trace_opt_case_dispatch) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_case_dispatch); - END_INSN(trace_opt_case_dispatch); -} - -/* insn trace_opt_plus(...)(...)(...) */ -INSN_ENTRY(trace_opt_plus) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_plus); -} - -/* insn trace_opt_minus(...)(...)(...) */ -INSN_ENTRY(trace_opt_minus) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_minus); -} - -/* insn trace_opt_mult(...)(...)(...) */ -INSN_ENTRY(trace_opt_mult) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_mult); -} - -/* insn trace_opt_div(...)(...)(...) */ -INSN_ENTRY(trace_opt_div) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_div); -} - -/* insn trace_opt_mod(...)(...)(...) */ -INSN_ENTRY(trace_opt_mod) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_mod); -} - -/* insn trace_opt_eq(...)(...)(...) */ -INSN_ENTRY(trace_opt_eq) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_eq); -} - -/* insn trace_opt_neq(...)(...)(...) */ -INSN_ENTRY(trace_opt_neq) -{ - vm_trace(ec, GET_CFP()); - ADD_PC(1); - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_neq); -} - -/* insn trace_opt_lt(...)(...)(...) */ -INSN_ENTRY(trace_opt_lt) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_lt); -} - -/* insn trace_opt_le(...)(...)(...) */ -INSN_ENTRY(trace_opt_le) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_le); -} - -/* insn trace_opt_gt(...)(...)(...) */ -INSN_ENTRY(trace_opt_gt) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_gt); -} - -/* insn trace_opt_ge(...)(...)(...) */ -INSN_ENTRY(trace_opt_ge) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_ge); -} - -/* insn trace_opt_ltlt(...)(...)(...) */ -INSN_ENTRY(trace_opt_ltlt) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_ltlt); -} - -/* insn trace_opt_and(...)(...)(...) */ -INSN_ENTRY(trace_opt_and) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_and); -} - -/* insn trace_opt_or(...)(...)(...) */ -INSN_ENTRY(trace_opt_or) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_or); -} - -/* insn trace_opt_aref(...)(...)(...) */ -INSN_ENTRY(trace_opt_aref) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_aref); -} - -/* insn trace_opt_aset(...)(...)(...) */ -INSN_ENTRY(trace_opt_aset) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_aset); -} - -/* insn trace_opt_aset_with(...)(...)(...) */ -INSN_ENTRY(trace_opt_aset_with) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_aset_with); - END_INSN(trace_opt_aset_with); -} - -/* insn trace_opt_aref_with(...)(...)(...) */ -INSN_ENTRY(trace_opt_aref_with) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_aref_with); - END_INSN(trace_opt_aref_with); -} - -/* insn trace_opt_length(...)(...)(...) */ -INSN_ENTRY(trace_opt_length) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_length); -} - -/* insn trace_opt_size(...)(...)(...) */ -INSN_ENTRY(trace_opt_size) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_size); -} - -/* insn trace_opt_empty_p(...)(...)(...) */ -INSN_ENTRY(trace_opt_empty_p) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_empty_p); -} - -/* insn trace_opt_succ(...)(...)(...) */ -INSN_ENTRY(trace_opt_succ) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_succ); -} - -/* insn trace_opt_not(...)(...)(...) */ -INSN_ENTRY(trace_opt_not) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_not); -} - -/* insn trace_opt_regexpmatch2(...)(...)(...) */ -INSN_ENTRY(trace_opt_regexpmatch2) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_send_without_block); - END_INSN(trace_opt_regexpmatch2); -} - -/* insn trace_invokebuiltin(...)(...)(...) */ -INSN_ENTRY(trace_invokebuiltin) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(invokebuiltin); - END_INSN(trace_invokebuiltin); -} - -/* insn trace_opt_invokebuiltin_delegate(...)(...)(...) */ -INSN_ENTRY(trace_opt_invokebuiltin_delegate) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_invokebuiltin_delegate); - END_INSN(trace_opt_invokebuiltin_delegate); -} - -/* insn trace_opt_invokebuiltin_delegate_leave(...)(...)(...) */ -INSN_ENTRY(trace_opt_invokebuiltin_delegate_leave) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(opt_invokebuiltin_delegate_leave); - END_INSN(trace_opt_invokebuiltin_delegate_leave); -} - -/* insn trace_getlocal_WC_0(...)(...)(...) */ -INSN_ENTRY(trace_getlocal_WC_0) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getlocal_WC_0); - END_INSN(trace_getlocal_WC_0); -} - -/* insn trace_getlocal_WC_1(...)(...)(...) */ -INSN_ENTRY(trace_getlocal_WC_1) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(getlocal_WC_1); - END_INSN(trace_getlocal_WC_1); -} - -/* insn trace_setlocal_WC_0(...)(...)(...) */ -INSN_ENTRY(trace_setlocal_WC_0) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setlocal_WC_0); - END_INSN(trace_setlocal_WC_0); -} - -/* insn trace_setlocal_WC_1(...)(...)(...) */ -INSN_ENTRY(trace_setlocal_WC_1) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(setlocal_WC_1); - END_INSN(trace_setlocal_WC_1); -} - -/* insn trace_putobject_INT2FIX_0_(...)(...)(...) */ -INSN_ENTRY(trace_putobject_INT2FIX_0_) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putobject_INT2FIX_0_); - END_INSN(trace_putobject_INT2FIX_0_); -} - -/* insn trace_putobject_INT2FIX_1_(...)(...)(...) */ -INSN_ENTRY(trace_putobject_INT2FIX_1_) -{ - vm_trace(ec, GET_CFP()); - - DISPATCH_ORIGINAL_INSN(putobject_INT2FIX_1_); - END_INSN(trace_putobject_INT2FIX_1_); -} diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc deleted file mode 100644 index c800942..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc +++ /dev/null @@ -1,244 +0,0 @@ -/* -*- c -*- */ -#if 1 /* enable or disable this optimization */ - -/* DO NOT EDIT THIS FILE DIRECTLY - * - * This file is generated by tool/generic_erb.rb - * with template/call_iseq_optimized.inc.tmpl - */ - -static VALUE -vm_call_iseq_setup_normal_0start_0params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_0params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 5); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_1params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 5); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_2params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 5); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 0); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 1); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 2); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 3); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 4); -} - -static VALUE -vm_call_iseq_setup_normal_0start_3params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling) -{ - RB_DEBUG_COUNTER_INC(ccf_iseq_fix); - return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 5); -} - -/* vm_call_iseq_handlers[param][local] */ -static const vm_call_handler vm_call_iseq_handlers[][6] = { - { - vm_call_iseq_setup_normal_0start_0params_0locals, - vm_call_iseq_setup_normal_0start_0params_1locals, - vm_call_iseq_setup_normal_0start_0params_2locals, - vm_call_iseq_setup_normal_0start_0params_3locals, - vm_call_iseq_setup_normal_0start_0params_4locals, - vm_call_iseq_setup_normal_0start_0params_5locals, - }, - { - vm_call_iseq_setup_normal_0start_1params_0locals, - vm_call_iseq_setup_normal_0start_1params_1locals, - vm_call_iseq_setup_normal_0start_1params_2locals, - vm_call_iseq_setup_normal_0start_1params_3locals, - vm_call_iseq_setup_normal_0start_1params_4locals, - vm_call_iseq_setup_normal_0start_1params_5locals, - }, - { - vm_call_iseq_setup_normal_0start_2params_0locals, - vm_call_iseq_setup_normal_0start_2params_1locals, - vm_call_iseq_setup_normal_0start_2params_2locals, - vm_call_iseq_setup_normal_0start_2params_3locals, - vm_call_iseq_setup_normal_0start_2params_4locals, - vm_call_iseq_setup_normal_0start_2params_5locals, - }, - { - vm_call_iseq_setup_normal_0start_3params_0locals, - vm_call_iseq_setup_normal_0start_3params_1locals, - vm_call_iseq_setup_normal_0start_3params_2locals, - vm_call_iseq_setup_normal_0start_3params_3locals, - vm_call_iseq_setup_normal_0start_3params_4locals, - vm_call_iseq_setup_normal_0start_3params_5locals, - }, -}; - -static inline vm_call_handler -vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size) -{ - if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) { - return &vm_call_iseq_setup_tailcall_0start; - } - else if (0) { /* to disable optimize */ - return &vm_call_iseq_setup_normal_0start; - } - else if (param_size <= 3 && local_size <= 5) { - VM_ASSERT(local_size >= 0); - return vm_call_iseq_handlers[param_size][local_size]; - } - else { - return &vm_call_iseq_setup_normal_0start; - } -} - -#else - -static inline vm_call_handler -vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size) -{ - if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) { - return &vm_call_iseq_setup_tailcall_0start; - } - else { - return &vm_call_iseq_setup_normal_0start; - } -} -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_callinfo.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_callinfo.h deleted file mode 100644 index d85261a..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_callinfo.h +++ /dev/null @@ -1,627 +0,0 @@ -#ifndef RUBY_VM_CALLINFO_H /*-*-C-*-vi:se ft=c:*/ -#define RUBY_VM_CALLINFO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - */ - -#include "debug_counter.h" -#include "internal/class.h" -#include "shape.h" - -enum vm_call_flag_bits { - VM_CALL_ARGS_SPLAT_bit, // m(*args) - VM_CALL_ARGS_BLOCKARG_bit, // m(&block) - VM_CALL_FCALL_bit, // m(args) # receiver is self - VM_CALL_VCALL_bit, // m # method call that looks like a local variable - VM_CALL_ARGS_SIMPLE_bit, // !(ci->flag & (SPLAT|BLOCKARG|KWARG|KW_SPLAT|FORWARDING)) && !has_block_iseq - VM_CALL_KWARG_bit, // has kwarg - VM_CALL_KW_SPLAT_bit, // m(**opts) - VM_CALL_TAILCALL_bit, // located at tail position - VM_CALL_SUPER_bit, // super - VM_CALL_ZSUPER_bit, // zsuper - VM_CALL_OPT_SEND_bit, // internal flag - VM_CALL_KW_SPLAT_MUT_bit, // kw splat hash can be modified (to avoid allocating a new one) - VM_CALL_ARGS_SPLAT_MUT_bit, // args splat can be modified (to avoid allocating a new one) - VM_CALL_FORWARDING_bit, // m(...) - VM_CALL__END -}; - -#define VM_CALL_ARGS_SPLAT (0x01 << VM_CALL_ARGS_SPLAT_bit) -#define VM_CALL_ARGS_BLOCKARG (0x01 << VM_CALL_ARGS_BLOCKARG_bit) -#define VM_CALL_FCALL (0x01 << VM_CALL_FCALL_bit) -#define VM_CALL_VCALL (0x01 << VM_CALL_VCALL_bit) -#define VM_CALL_ARGS_SIMPLE (0x01 << VM_CALL_ARGS_SIMPLE_bit) -#define VM_CALL_KWARG (0x01 << VM_CALL_KWARG_bit) -#define VM_CALL_KW_SPLAT (0x01 << VM_CALL_KW_SPLAT_bit) -#define VM_CALL_TAILCALL (0x01 << VM_CALL_TAILCALL_bit) -#define VM_CALL_SUPER (0x01 << VM_CALL_SUPER_bit) -#define VM_CALL_ZSUPER (0x01 << VM_CALL_ZSUPER_bit) -#define VM_CALL_OPT_SEND (0x01 << VM_CALL_OPT_SEND_bit) -#define VM_CALL_KW_SPLAT_MUT (0x01 << VM_CALL_KW_SPLAT_MUT_bit) -#define VM_CALL_ARGS_SPLAT_MUT (0x01 << VM_CALL_ARGS_SPLAT_MUT_bit) -#define VM_CALL_FORWARDING (0x01 << VM_CALL_FORWARDING_bit) - -struct rb_callinfo_kwarg { - int keyword_len; - int references; - VALUE keywords[]; -}; - -static inline size_t -rb_callinfo_kwarg_bytes(int keyword_len) -{ - return rb_size_mul_add_or_raise( - keyword_len, - sizeof(VALUE), - sizeof(struct rb_callinfo_kwarg), - rb_eRuntimeError); -} - -// imemo_callinfo -struct rb_callinfo { - VALUE flags; - const struct rb_callinfo_kwarg *kwarg; - VALUE mid; - VALUE flag; - VALUE argc; -}; - -#if !defined(USE_EMBED_CI) || (USE_EMBED_CI+0) -#undef USE_EMBED_CI -#define USE_EMBED_CI 1 -#else -#undef USE_EMBED_CI -#define USE_EMBED_CI 0 -#endif - -#if SIZEOF_VALUE == 8 -#define CI_EMBED_TAG_bits 1 -#define CI_EMBED_ARGC_bits 15 -#define CI_EMBED_FLAG_bits 16 -#define CI_EMBED_ID_bits 32 -#elif SIZEOF_VALUE == 4 -#define CI_EMBED_TAG_bits 1 -#define CI_EMBED_ARGC_bits 3 -#define CI_EMBED_FLAG_bits 13 -#define CI_EMBED_ID_bits 15 -#endif - -#if (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits + CI_EMBED_FLAG_bits + CI_EMBED_ID_bits) != (SIZEOF_VALUE * 8) -#error -#endif - -#define CI_EMBED_FLAG 0x01 -#define CI_EMBED_ARGC_SHFT (CI_EMBED_TAG_bits) -#define CI_EMBED_ARGC_MASK ((((VALUE)1)<> CI_EMBED_ID_SHFT) & CI_EMBED_ID_MASK; - } - else { - return (ID)ci->mid; - } -} - -static inline unsigned int -vm_ci_flag(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - return (unsigned int)((((VALUE)ci) >> CI_EMBED_FLAG_SHFT) & CI_EMBED_FLAG_MASK); - } - else { - return (unsigned int)ci->flag; - } -} - -static inline unsigned int -vm_ci_argc(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - return (unsigned int)((((VALUE)ci) >> CI_EMBED_ARGC_SHFT) & CI_EMBED_ARGC_MASK); - } - else { - return (unsigned int)ci->argc; - } -} - -static inline const struct rb_callinfo_kwarg * -vm_ci_kwarg(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - return NULL; - } - else { - return ci->kwarg; - } -} - -static inline void -vm_ci_dump(const struct rb_callinfo *ci) -{ - if (vm_ci_packed_p(ci)) { - ruby_debug_printf("packed_ci ID:%s flag:%x argc:%u\n", - rb_id2name(vm_ci_mid(ci)), vm_ci_flag(ci), vm_ci_argc(ci)); - } - else { - rp(ci); - } -} - -#define vm_ci_new(mid, flag, argc, kwarg) vm_ci_new_(mid, flag, argc, kwarg, __FILE__, __LINE__) -#define vm_ci_new_runtime(mid, flag, argc, kwarg) vm_ci_new_runtime_(mid, flag, argc, kwarg, __FILE__, __LINE__) - -/* This is passed to STATIC_ASSERT. Cannot be an inline function. */ -#define VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg) \ - (((mid ) & ~CI_EMBED_ID_MASK) ? false : \ - ((flag) & ~CI_EMBED_FLAG_MASK) ? false : \ - ((argc) & ~CI_EMBED_ARGC_MASK) ? false : \ - (kwarg) ? false : true) - -#define vm_ci_new_id(mid, flag, argc, must_zero) \ - ((const struct rb_callinfo *) \ - ((((VALUE)(mid )) << CI_EMBED_ID_SHFT) | \ - (((VALUE)(flag)) << CI_EMBED_FLAG_SHFT) | \ - (((VALUE)(argc)) << CI_EMBED_ARGC_SHFT) | \ - RUBY_FIXNUM_FLAG)) - -// vm_method.c -const struct rb_callinfo *rb_vm_ci_lookup(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg); -void rb_vm_ci_free(const struct rb_callinfo *); - -static inline const struct rb_callinfo * -vm_ci_new_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line) -{ - if (USE_EMBED_CI && VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) { - RB_DEBUG_COUNTER_INC(ci_packed); - return vm_ci_new_id(mid, flag, argc, kwarg); - } - - const bool debug = 0; - if (debug) ruby_debug_printf("%s:%d ", file, line); - - const struct rb_callinfo *ci = rb_vm_ci_lookup(mid, flag, argc, kwarg); - - if (debug) rp(ci); - if (kwarg) { - RB_DEBUG_COUNTER_INC(ci_kw); - } - else { - RB_DEBUG_COUNTER_INC(ci_nokw); - } - - VM_ASSERT(vm_ci_flag(ci) == flag); - VM_ASSERT(vm_ci_argc(ci) == argc); - - return ci; -} - - -static inline const struct rb_callinfo * -vm_ci_new_runtime_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(ci_runtime); - return vm_ci_new_(mid, flag, argc, kwarg, file, line); -} - -#define VM_CALLINFO_NOT_UNDER_GC IMEMO_FL_USER0 - -static inline bool -vm_ci_markable(const struct rb_callinfo *ci) -{ - if (! ci) { - return false; /* or true? This is Qfalse... */ - } - else if (vm_ci_packed_p(ci)) { - return true; - } - else { - VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo)); - return ! FL_ANY_RAW((VALUE)ci, VM_CALLINFO_NOT_UNDER_GC); - } -} - -#define VM_CI_ON_STACK(mid_, flags_, argc_, kwarg_) \ - (struct rb_callinfo) { \ - .flags = T_IMEMO | \ - (imemo_callinfo << FL_USHIFT) | \ - VM_CALLINFO_NOT_UNDER_GC, \ - .mid = mid_, \ - .flag = flags_, \ - .argc = argc_, \ - .kwarg = kwarg_, \ - } - -typedef VALUE (*vm_call_handler)( - struct rb_execution_context_struct *ec, - struct rb_control_frame_struct *cfp, - struct rb_calling_info *calling); - -// imemo_callcache - -struct rb_callcache { - const VALUE flags; - - /* inline cache: key */ - const VALUE klass; // should not mark it because klass can not be free'd - // because of this marking. When klass is collected, - // cc will be cleared (cc->klass = 0) at vm_ccs_free(). - - /* inline cache: values */ - const struct rb_callable_method_entry_struct * const cme_; - const vm_call_handler call_; - - union { - struct { - uintptr_t value; // Shape ID in upper bits, index in lower bits - } attr; - const enum method_missing_reason method_missing_reason; /* used by method_missing */ - VALUE v; - const struct rb_builtin_function *bf; - } aux_; -}; - -#define VM_CALLCACHE_UNMARKABLE FL_FREEZE -#define VM_CALLCACHE_ON_STACK FL_EXIVAR - -/* VM_CALLCACHE_IVAR used for IVAR/ATTRSET/STRUCT_AREF/STRUCT_ASET methods */ -#define VM_CALLCACHE_IVAR IMEMO_FL_USER0 -#define VM_CALLCACHE_BF IMEMO_FL_USER1 -#define VM_CALLCACHE_SUPER IMEMO_FL_USER2 -#define VM_CALLCACHE_REFINEMENT IMEMO_FL_USER3 - -enum vm_cc_type { - cc_type_normal, // chained from ccs - cc_type_super, - cc_type_refinement, -}; - -extern const struct rb_callcache *rb_vm_empty_cc(void); -extern const struct rb_callcache *rb_vm_empty_cc_for_super(void); - -#define vm_cc_empty() rb_vm_empty_cc() - -static inline void vm_cc_attr_index_set(const struct rb_callcache *cc, attr_index_t index, shape_id_t dest_shape_id); - -static inline void -vm_cc_attr_index_initialize(const struct rb_callcache *cc, shape_id_t shape_id) -{ - vm_cc_attr_index_set(cc, (attr_index_t)-1, shape_id); -} - -static inline const struct rb_callcache * -vm_cc_new(VALUE klass, - const struct rb_callable_method_entry_struct *cme, - vm_call_handler call, - enum vm_cc_type type) -{ - struct rb_callcache *cc = IMEMO_NEW(struct rb_callcache, imemo_callcache, klass); - *((struct rb_callable_method_entry_struct **)&cc->cme_) = (struct rb_callable_method_entry_struct *)cme; - *((vm_call_handler *)&cc->call_) = call; - - VM_ASSERT(RB_TYPE_P(klass, T_CLASS) || RB_TYPE_P(klass, T_ICLASS)); - - switch (type) { - case cc_type_normal: - break; - case cc_type_super: - *(VALUE *)&cc->flags |= VM_CALLCACHE_SUPER; - break; - case cc_type_refinement: - *(VALUE *)&cc->flags |= VM_CALLCACHE_REFINEMENT; - break; - } - - if (cme->def->type == VM_METHOD_TYPE_ATTRSET || cme->def->type == VM_METHOD_TYPE_IVAR) { - vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID); - } - - RB_DEBUG_COUNTER_INC(cc_new); - return cc; -} - -static inline bool -vm_cc_super_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_SUPER) != 0; -} - -static inline bool -vm_cc_refinement_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_REFINEMENT) != 0; -} - -#define VM_CC_ON_STACK(clazz, call, aux, cme) \ - (struct rb_callcache) { \ - .flags = T_IMEMO | \ - (imemo_callcache << FL_USHIFT) | \ - VM_CALLCACHE_UNMARKABLE | \ - VM_CALLCACHE_ON_STACK, \ - .klass = clazz, \ - .cme_ = cme, \ - .call_ = call, \ - .aux_ = aux, \ - } - -static inline bool -vm_cc_class_check(const struct rb_callcache *cc, VALUE klass) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc->klass == 0 || - RB_TYPE_P(cc->klass, T_CLASS) || RB_TYPE_P(cc->klass, T_ICLASS)); - return cc->klass == klass; -} - -static inline int -vm_cc_markable(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return FL_TEST_RAW((VALUE)cc, VM_CALLCACHE_UNMARKABLE) == 0; -} - -static inline const struct rb_callable_method_entry_struct * -vm_cc_cme(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc->call_ == NULL || // not initialized yet - !vm_cc_markable(cc) || - cc->cme_ != NULL); - - return cc->cme_; -} - -static inline vm_call_handler -vm_cc_call(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc->call_ != NULL); - return cc->call_; -} - -static inline attr_index_t -vm_cc_attr_index(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return (attr_index_t)((cc->aux_.attr.value & SHAPE_FLAG_MASK) - 1); -} - -static inline shape_id_t -vm_cc_attr_index_dest_shape_id(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - - return cc->aux_.attr.value >> SHAPE_FLAG_SHIFT; -} - -static inline void -vm_cc_atomic_shape_and_index(const struct rb_callcache *cc, shape_id_t * shape_id, attr_index_t * index) -{ - uintptr_t cache_value = cc->aux_.attr.value; // Atomically read 64 bits - *shape_id = (shape_id_t)(cache_value >> SHAPE_FLAG_SHIFT); - *index = (attr_index_t)(cache_value & SHAPE_FLAG_MASK) - 1; - return; -} - -static inline void -vm_ic_atomic_shape_and_index(const struct iseq_inline_iv_cache_entry *ic, shape_id_t * shape_id, attr_index_t * index) -{ - uintptr_t cache_value = ic->value; // Atomically read 64 bits - *shape_id = (shape_id_t)(cache_value >> SHAPE_FLAG_SHIFT); - *index = (attr_index_t)(cache_value & SHAPE_FLAG_MASK) - 1; - return; -} - -static inline shape_id_t -vm_ic_attr_index_dest_shape_id(const struct iseq_inline_iv_cache_entry *ic) -{ - return (shape_id_t)(ic->value >> SHAPE_FLAG_SHIFT); -} - -static inline unsigned int -vm_cc_cmethod_missing_reason(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return cc->aux_.method_missing_reason; -} - -static inline bool -vm_cc_invalidated_p(const struct rb_callcache *cc) -{ - if (cc->klass && !METHOD_ENTRY_INVALIDATED(vm_cc_cme(cc))) { - return false; - } - else { - return true; - } -} - -// For RJIT. cc_cme is supposed to have inlined `vm_cc_cme(cc)`. -static inline bool -vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *cc_cme, VALUE klass) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - if (cc->klass == klass && !METHOD_ENTRY_INVALIDATED(cc_cme)) { - return 1; - } - else { - return 0; - } -} - -/* callcache: mutate */ - -static inline void -vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *(vm_call_handler *)&cc->call_ = call; -} - -static inline void -set_vm_cc_ivar(const struct rb_callcache *cc) -{ - *(VALUE *)&cc->flags |= VM_CALLCACHE_IVAR; -} - -static inline void -vm_cc_attr_index_set(const struct rb_callcache *cc, attr_index_t index, shape_id_t dest_shape_id) -{ - uintptr_t *attr_value = (uintptr_t *)&cc->aux_.attr.value; - if (!vm_cc_markable(cc)) { - *attr_value = (uintptr_t)INVALID_SHAPE_ID << SHAPE_FLAG_SHIFT; - return; - } - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *attr_value = (attr_index_t)(index + 1) | ((uintptr_t)(dest_shape_id) << SHAPE_FLAG_SHIFT); - set_vm_cc_ivar(cc); -} - -static inline bool -vm_cc_ivar_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_IVAR) != 0; -} - -static inline void -vm_ic_attr_index_set(const rb_iseq_t *iseq, const struct iseq_inline_iv_cache_entry *ic, attr_index_t index, shape_id_t dest_shape_id) -{ - *(uintptr_t *)&ic->value = ((uintptr_t)dest_shape_id << SHAPE_FLAG_SHIFT) | (attr_index_t)(index + 1); -} - -static inline void -vm_ic_attr_index_initialize(const struct iseq_inline_iv_cache_entry *ic, shape_id_t shape_id) -{ - *(uintptr_t *)&ic->value = (uintptr_t)shape_id << SHAPE_FLAG_SHIFT; -} - -static inline void -vm_cc_method_missing_reason_set(const struct rb_callcache *cc, enum method_missing_reason reason) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *(enum method_missing_reason *)&cc->aux_.method_missing_reason = reason; -} - -static inline void -vm_cc_bf_set(const struct rb_callcache *cc, const struct rb_builtin_function *bf) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - *(const struct rb_builtin_function **)&cc->aux_.bf = bf; - *(VALUE *)&cc->flags |= VM_CALLCACHE_BF; -} - -static inline bool -vm_cc_bf_p(const struct rb_callcache *cc) -{ - return (cc->flags & VM_CALLCACHE_BF) != 0; -} - -static inline void -vm_cc_invalidate(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - VM_ASSERT(cc != vm_cc_empty()); - VM_ASSERT(cc->klass != 0); // should be enable - - *(VALUE *)&cc->klass = 0; - RB_DEBUG_COUNTER_INC(cc_ent_invalidate); -} - -/* calldata */ - -struct rb_call_data { - const struct rb_callinfo *ci; - const struct rb_callcache *cc; -}; - -struct rb_class_cc_entries { -#if VM_CHECK_MODE > 0 - VALUE debug_sig; -#endif - int capa; - int len; - const struct rb_callable_method_entry_struct *cme; - struct rb_class_cc_entries_entry { - unsigned int argc; - unsigned int flag; - const struct rb_callcache *cc; - } *entries; -}; - -#if VM_CHECK_MODE > 0 - -const rb_callable_method_entry_t *rb_vm_lookup_overloaded_cme(const rb_callable_method_entry_t *cme); -void rb_vm_dump_overloaded_cme_table(void); - -static inline bool -vm_ccs_p(const struct rb_class_cc_entries *ccs) -{ - return ccs->debug_sig == ~(VALUE)ccs; -} - -static inline bool -vm_cc_check_cme(const struct rb_callcache *cc, const rb_callable_method_entry_t *cme) -{ - if (vm_cc_cme(cc) == cme || - (cme->def->iseq_overload && vm_cc_cme(cc) == rb_vm_lookup_overloaded_cme(cme))) { - return true; - } - else { -#if 1 - // debug print - - fprintf(stderr, "iseq_overload:%d\n", (int)cme->def->iseq_overload); - rp(cme); - rp(vm_cc_cme(cc)); - rb_vm_lookup_overloaded_cme(cme); -#endif - return false; - } -} - -#endif - -// gc.c -void rb_vm_ccs_free(struct rb_class_cc_entries *ccs); - -#endif /* RUBY_VM_CALLINFO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_core.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_core.h deleted file mode 100644 index bce5f35..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_core.h +++ /dev/null @@ -1,2222 +0,0 @@ -#ifndef RUBY_VM_CORE_H -#define RUBY_VM_CORE_H -/********************************************************************** - - vm_core.h - - - $Author$ - created at: 04/01/01 19:41:38 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -/* - * Enable check mode. - * 1: enable local assertions. - */ -#ifndef VM_CHECK_MODE - -// respect RUBY_DUBUG: if given n is 0, then use RUBY_DEBUG -#define N_OR_RUBY_DEBUG(n) (((n) > 0) ? (n) : RUBY_DEBUG) - -#define VM_CHECK_MODE N_OR_RUBY_DEBUG(0) -#endif - -/** - * VM Debug Level - * - * debug level: - * 0: no debug output - * 1: show instruction name - * 2: show stack frame when control stack frame is changed - * 3: show stack status - * 4: show register - * 5: - * 10: gc check - */ - -#ifndef VMDEBUG -#define VMDEBUG 0 -#endif - -#if 0 -#undef VMDEBUG -#define VMDEBUG 3 -#endif - -#include "ruby/internal/config.h" - -#include -#include -#include - -#include "ruby_assert.h" - -#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX])) - -#if VM_CHECK_MODE > 0 -#define VM_ASSERT(expr, ...) \ - RUBY_ASSERT_MESG_WHEN(VM_CHECK_MODE > 0, expr, #expr RBIMPL_VA_OPT_ARGS(__VA_ARGS__)) -#define VM_UNREACHABLE(func) rb_bug(#func ": unreachable") -#define RUBY_ASSERT_CRITICAL_SECTION -#define RUBY_DEBUG_THREAD_SCHEDULE() rb_thread_schedule() -#else -#define VM_ASSERT(/*expr, */...) ((void)0) -#define VM_UNREACHABLE(func) UNREACHABLE -#define RUBY_DEBUG_THREAD_SCHEDULE() -#endif - -#define RUBY_ASSERT_MUTEX_OWNED(mutex) VM_ASSERT(rb_mutex_owned_p(mutex)) - -#if defined(RUBY_ASSERT_CRITICAL_SECTION) -// TODO add documentation -extern int ruby_assert_critical_section_entered; -#define RUBY_ASSERT_CRITICAL_SECTION_ENTER() do{ruby_assert_critical_section_entered += 1;}while(false) -#define RUBY_ASSERT_CRITICAL_SECTION_LEAVE() do{VM_ASSERT(ruby_assert_critical_section_entered > 0);ruby_assert_critical_section_entered -= 1;}while(false) -#else -#define RUBY_ASSERT_CRITICAL_SECTION_ENTER() -#define RUBY_ASSERT_CRITICAL_SECTION_LEAVE() -#endif - -#if defined(__wasm__) && !defined(__EMSCRIPTEN__) -# include "wasm/setjmp.h" -#else -# include -#endif - -#if defined(__linux__) || defined(__FreeBSD__) -# define RB_THREAD_T_HAS_NATIVE_ID -#endif - -#include "ruby/internal/stdbool.h" -#include "ccan/list/list.h" -#include "id.h" -#include "internal.h" -#include "internal/array.h" -#include "internal/basic_operators.h" -#include "internal/sanitizers.h" -#include "internal/serial.h" -#include "internal/vm.h" -#include "method.h" -#include "node.h" -#include "ruby/ruby.h" -#include "ruby/st.h" -#include "ruby_atomic.h" -#include "vm_opts.h" - -#include "ruby/thread_native.h" -/* - * implementation selector of get_insn_info algorithm - * 0: linear search - * 1: binary search - * 2: succinct bitvector - */ -#ifndef VM_INSN_INFO_TABLE_IMPL -# define VM_INSN_INFO_TABLE_IMPL 2 -#endif - -#if defined(NSIG_MAX) /* POSIX issue 8 */ -# undef NSIG -# define NSIG NSIG_MAX -#elif defined(_SIG_MAXSIG) /* FreeBSD */ -# undef NSIG -# define NSIG _SIG_MAXSIG -#elif defined(_SIGMAX) /* QNX */ -# define NSIG (_SIGMAX + 1) -#elif defined(NSIG) /* 99% of everything else */ -# /* take it */ -#else /* Last resort */ -# define NSIG (sizeof(sigset_t) * CHAR_BIT + 1) -#endif - -#define RUBY_NSIG NSIG - -#if defined(SIGCLD) -# define RUBY_SIGCHLD (SIGCLD) -#elif defined(SIGCHLD) -# define RUBY_SIGCHLD (SIGCHLD) -#endif - -#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__) -# define USE_SIGALTSTACK -void *rb_allocate_sigaltstack(void); -void *rb_register_sigaltstack(void *); -# define RB_ALTSTACK_INIT(var, altstack) var = rb_register_sigaltstack(altstack) -# define RB_ALTSTACK_FREE(var) free(var) -# define RB_ALTSTACK(var) var -#else /* noop */ -# define RB_ALTSTACK_INIT(var, altstack) -# define RB_ALTSTACK_FREE(var) -# define RB_ALTSTACK(var) (0) -#endif - -#include THREAD_IMPL_H -#define RUBY_VM_THREAD_MODEL 2 - -/*****************/ -/* configuration */ -/*****************/ - -/* gcc ver. check */ -#if defined(__GNUC__) && __GNUC__ >= 2 - -#if OPT_TOKEN_THREADED_CODE -#if OPT_DIRECT_THREADED_CODE -#undef OPT_DIRECT_THREADED_CODE -#endif -#endif - -#else /* defined(__GNUC__) && __GNUC__ >= 2 */ - -/* disable threaded code options */ -#if OPT_DIRECT_THREADED_CODE -#undef OPT_DIRECT_THREADED_CODE -#endif -#if OPT_TOKEN_THREADED_CODE -#undef OPT_TOKEN_THREADED_CODE -#endif -#endif - -/* call threaded code */ -#if OPT_CALL_THREADED_CODE -#if OPT_DIRECT_THREADED_CODE -#undef OPT_DIRECT_THREADED_CODE -#endif /* OPT_DIRECT_THREADED_CODE */ -#endif /* OPT_CALL_THREADED_CODE */ - -void rb_vm_encoded_insn_data_table_init(void); -typedef unsigned long rb_num_t; -typedef signed long rb_snum_t; - -enum ruby_tag_type { - RUBY_TAG_NONE = 0x0, - RUBY_TAG_RETURN = 0x1, - RUBY_TAG_BREAK = 0x2, - RUBY_TAG_NEXT = 0x3, - RUBY_TAG_RETRY = 0x4, - RUBY_TAG_REDO = 0x5, - RUBY_TAG_RAISE = 0x6, - RUBY_TAG_THROW = 0x7, - RUBY_TAG_FATAL = 0x8, - RUBY_TAG_MASK = 0xf -}; - -#define TAG_NONE RUBY_TAG_NONE -#define TAG_RETURN RUBY_TAG_RETURN -#define TAG_BREAK RUBY_TAG_BREAK -#define TAG_NEXT RUBY_TAG_NEXT -#define TAG_RETRY RUBY_TAG_RETRY -#define TAG_REDO RUBY_TAG_REDO -#define TAG_RAISE RUBY_TAG_RAISE -#define TAG_THROW RUBY_TAG_THROW -#define TAG_FATAL RUBY_TAG_FATAL -#define TAG_MASK RUBY_TAG_MASK - -enum ruby_vm_throw_flags { - VM_THROW_NO_ESCAPE_FLAG = 0x8000, - VM_THROW_STATE_MASK = 0xff -}; - -/* forward declarations */ -struct rb_thread_struct; -struct rb_control_frame_struct; - -/* iseq data type */ -typedef struct rb_compile_option_struct rb_compile_option_t; - -union ic_serial_entry { - rb_serial_t raw; - VALUE data[2]; -}; - -// imemo_constcache -struct iseq_inline_constant_cache_entry { - VALUE flags; - - VALUE value; // v0 - VALUE _unused1; // v1 - VALUE _unused2; // v2 - const rb_cref_t *ic_cref; // v3 -}; -STATIC_ASSERT(sizeof_iseq_inline_constant_cache_entry, - (offsetof(struct iseq_inline_constant_cache_entry, ic_cref) + - sizeof(const rb_cref_t *)) <= RVALUE_SIZE); - -struct iseq_inline_constant_cache { - struct iseq_inline_constant_cache_entry *entry; - - /** - * A null-terminated list of ids, used to represent a constant's path - * idNULL is used to represent the :: prefix, and 0 is used to donate the end - * of the list. - * - * For example - * FOO {rb_intern("FOO"), 0} - * FOO::BAR {rb_intern("FOO"), rb_intern("BAR"), 0} - * ::FOO {idNULL, rb_intern("FOO"), 0} - * ::FOO::BAR {idNULL, rb_intern("FOO"), rb_intern("BAR"), 0} - */ - const ID *segments; -}; - -struct iseq_inline_iv_cache_entry { - uintptr_t value; // attr_index in lower bits, dest_shape_id in upper bits - ID iv_set_name; -}; - -struct iseq_inline_cvar_cache_entry { - struct rb_cvar_class_tbl_entry *entry; -}; - -union iseq_inline_storage_entry { - struct { - struct rb_thread_struct *running_thread; - VALUE value; - } once; - struct iseq_inline_constant_cache ic_cache; - struct iseq_inline_iv_cache_entry iv_cache; -}; - -struct rb_calling_info { - const struct rb_call_data *cd; - const struct rb_callcache *cc; - VALUE block_handler; - VALUE recv; - int argc; - bool kw_splat; - VALUE heap_argv; -}; - -#ifndef VM_ARGC_STACK_MAX -#define VM_ARGC_STACK_MAX 128 -#endif - -# define CALLING_ARGC(calling) ((calling)->heap_argv ? RARRAY_LENINT((calling)->heap_argv) : (calling)->argc) - -struct rb_execution_context_struct; - -#if 1 -#define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj) -#else -#define CoreDataFromValue(obj, type) (type*)rb_data_object_get(obj) -#endif -#define GetCoreDataFromValue(obj, type, ptr) ((ptr) = CoreDataFromValue((obj), type)) - -typedef struct rb_iseq_location_struct { - VALUE pathobj; /* String (path) or Array [path, realpath]. Frozen. */ - VALUE base_label; /* String */ - VALUE label; /* String */ - int first_lineno; - int node_id; - rb_code_location_t code_location; -} rb_iseq_location_t; - -#define PATHOBJ_PATH 0 -#define PATHOBJ_REALPATH 1 - -static inline VALUE -pathobj_path(VALUE pathobj) -{ - if (RB_TYPE_P(pathobj, T_STRING)) { - return pathobj; - } - else { - VM_ASSERT(RB_TYPE_P(pathobj, T_ARRAY)); - return RARRAY_AREF(pathobj, PATHOBJ_PATH); - } -} - -static inline VALUE -pathobj_realpath(VALUE pathobj) -{ - if (RB_TYPE_P(pathobj, T_STRING)) { - return pathobj; - } - else { - VM_ASSERT(RB_TYPE_P(pathobj, T_ARRAY)); - return RARRAY_AREF(pathobj, PATHOBJ_REALPATH); - } -} - -/* Forward declarations */ -struct rb_rjit_unit; - -typedef uintptr_t iseq_bits_t; - -#define ISEQ_IS_SIZE(body) (body->ic_size + body->ivc_size + body->ise_size + body->icvarc_size) - -/* [ TS_IVC | TS_ICVARC | TS_ISE | TS_IC ] */ -#define ISEQ_IS_IC_ENTRY(body, idx) (body->is_entries[(idx) + body->ise_size + body->icvarc_size + body->ivc_size].ic_cache); - -/* instruction sequence type */ -enum rb_iseq_type { - ISEQ_TYPE_TOP, - ISEQ_TYPE_METHOD, - ISEQ_TYPE_BLOCK, - ISEQ_TYPE_CLASS, - ISEQ_TYPE_RESCUE, - ISEQ_TYPE_ENSURE, - ISEQ_TYPE_EVAL, - ISEQ_TYPE_MAIN, - ISEQ_TYPE_PLAIN -}; - -// Attributes specified by Primitive.attr! -enum rb_builtin_attr { - // The iseq does not call methods. - BUILTIN_ATTR_LEAF = 0x01, - // This iseq only contains single `opt_invokebuiltin_delegate_leave` instruction with 0 arguments. - BUILTIN_ATTR_SINGLE_NOARG_LEAF = 0x02, - // This attribute signals JIT to duplicate the iseq for each block iseq so that its `yield` will be monomorphic. - BUILTIN_ATTR_INLINE_BLOCK = 0x04, -}; - -typedef VALUE (*rb_jit_func_t)(struct rb_execution_context_struct *, struct rb_control_frame_struct *); - -struct rb_iseq_constant_body { - enum rb_iseq_type type; - - unsigned int iseq_size; - VALUE *iseq_encoded; /* encoded iseq (insn addr and operands) */ - - /** - * parameter information - * - * def m(a1, a2, ..., aM, # mandatory - * b1=(...), b2=(...), ..., bN=(...), # optional - * *c, # rest - * d1, d2, ..., dO, # post - * e1:(...), e2:(...), ..., eK:(...), # keyword - * **f, # keyword_rest - * &g) # block - * => - * - * lead_num = M - * opt_num = N - * rest_start = M+N - * post_start = M+N+(*1) - * post_num = O - * keyword_num = K - * block_start = M+N+(*1)+O+K - * keyword_bits = M+N+(*1)+O+K+(&1) - * size = M+N+O+(*1)+K+(&1)+(**1) // parameter size. - */ - - struct { - struct { - unsigned int has_lead : 1; - unsigned int has_opt : 1; - unsigned int has_rest : 1; - unsigned int has_post : 1; - unsigned int has_kw : 1; - unsigned int has_kwrest : 1; - unsigned int has_block : 1; - - unsigned int ambiguous_param0 : 1; /* {|a|} */ - unsigned int accepts_no_kwarg : 1; - unsigned int ruby2_keywords: 1; - unsigned int anon_rest: 1; - unsigned int anon_kwrest: 1; - unsigned int use_block: 1; - unsigned int forwardable: 1; - } flags; - - unsigned int size; - - int lead_num; - int opt_num; - int rest_start; - int post_start; - int post_num; - int block_start; - - const VALUE *opt_table; /* (opt_num + 1) entries. */ - /* opt_num and opt_table: - * - * def foo o1=e1, o2=e2, ..., oN=eN - * #=> - * # prologue code - * A1: e1 - * A2: e2 - * ... - * AN: eN - * AL: body - * opt_num = N - * opt_table = [A1, A2, ..., AN, AL] - */ - - const struct rb_iseq_param_keyword { - int num; - int required_num; - int bits_start; - int rest_start; - const ID *table; - VALUE *default_values; - } *keyword; - } param; - - rb_iseq_location_t location; - - /* insn info, must be freed */ - struct iseq_insn_info { - const struct iseq_insn_info_entry *body; - unsigned int *positions; - unsigned int size; -#if VM_INSN_INFO_TABLE_IMPL == 2 - struct succ_index_table *succ_index_table; -#endif - } insns_info; - - const ID *local_table; /* must free */ - - /* catch table */ - struct iseq_catch_table *catch_table; - - /* for child iseq */ - const struct rb_iseq_struct *parent_iseq; - struct rb_iseq_struct *local_iseq; /* local_iseq->flip_cnt can be modified */ - - union iseq_inline_storage_entry *is_entries; /* [ TS_IVC | TS_ICVARC | TS_ISE | TS_IC ] */ - struct rb_call_data *call_data; //struct rb_call_data calls[ci_size]; - - struct { - rb_snum_t flip_count; - VALUE script_lines; - VALUE coverage; - VALUE pc2branchindex; - VALUE *original_iseq; - } variable; - - unsigned int local_table_size; - unsigned int ic_size; // Number of IC caches - unsigned int ise_size; // Number of ISE caches - unsigned int ivc_size; // Number of IVC caches - unsigned int icvarc_size; // Number of ICVARC caches - unsigned int ci_size; - unsigned int stack_max; /* for stack overflow check */ - - unsigned int builtin_attrs; // Union of rb_builtin_attr - - bool prism; // ISEQ was generated from prism compiler - - union { - iseq_bits_t * list; /* Find references for GC */ - iseq_bits_t single; - } mark_bits; - - struct rb_id_table *outer_variables; - - const rb_iseq_t *mandatory_only_iseq; - -#if USE_RJIT || USE_YJIT - // Function pointer for JIT code on jit_exec() - rb_jit_func_t jit_entry; - // Number of calls on jit_exec() - long unsigned jit_entry_calls; -#endif - -#if USE_YJIT - // Function pointer for JIT code on jit_exec_exception() - rb_jit_func_t jit_exception; - // Number of calls on jit_exec_exception() - long unsigned jit_exception_calls; -#endif - -#if USE_RJIT - // RJIT stores some data on each iseq. - VALUE rjit_blocks; -#endif - -#if USE_YJIT - // YJIT stores some data on each iseq. - void *yjit_payload; - // Used to estimate how frequently this ISEQ gets called - uint64_t yjit_calls_at_interv; -#endif -}; - -/* T_IMEMO/iseq */ -/* typedef rb_iseq_t is in method.h */ -struct rb_iseq_struct { - VALUE flags; /* 1 */ - VALUE wrapper; /* 2 */ - - struct rb_iseq_constant_body *body; /* 3 */ - - union { /* 4, 5 words */ - struct iseq_compile_data *compile_data; /* used at compile time */ - - struct { - VALUE obj; - int index; - } loader; - - struct { - struct rb_hook_list_struct *local_hooks; - rb_event_flag_t global_trace_events; - } exec; - } aux; -}; - -#define ISEQ_BODY(iseq) ((iseq)->body) - -#if !defined(USE_LAZY_LOAD) || !(USE_LAZY_LOAD+0) -#define USE_LAZY_LOAD 0 -#endif - -#if !USE_LAZY_LOAD -static inline const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq) {return 0;} -#endif -const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq); - -static inline const rb_iseq_t * -rb_iseq_check(const rb_iseq_t *iseq) -{ - if (USE_LAZY_LOAD && ISEQ_BODY(iseq) == NULL) { - rb_iseq_complete((rb_iseq_t *)iseq); - } - return iseq; -} - -static inline const rb_iseq_t * -def_iseq_ptr(rb_method_definition_t *def) -{ -//TODO: re-visit. to check the bug, enable this assertion. -#if VM_CHECK_MODE > 0 - if (def->type != VM_METHOD_TYPE_ISEQ) rb_bug("def_iseq_ptr: not iseq (%d)", def->type); -#endif - return rb_iseq_check(def->body.iseq.iseqptr); -} - -enum ruby_special_exceptions { - ruby_error_reenter, - ruby_error_nomemory, - ruby_error_sysstack, - ruby_error_stackfatal, - ruby_error_stream_closed, - ruby_special_error_count -}; - -#define GetVMPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_vm_t, (ptr)) - -struct rb_vm_struct; -typedef void rb_vm_at_exit_func(struct rb_vm_struct*); - -typedef struct rb_at_exit_list { - rb_vm_at_exit_func *func; - struct rb_at_exit_list *next; -} rb_at_exit_list; - -void *rb_objspace_alloc(void); -void rb_objspace_free(void *objspace); -void rb_objspace_call_finalizer(void); - -typedef struct rb_hook_list_struct { - struct rb_event_hook_struct *hooks; - rb_event_flag_t events; - unsigned int running; - bool need_clean; - bool is_local; -} rb_hook_list_t; - - -// see builtin.h for definition -typedef const struct rb_builtin_function *RB_BUILTIN; - -struct global_object_list { - VALUE *varptr; - struct global_object_list *next; -}; - -typedef struct rb_vm_struct { - VALUE self; - - struct { - struct ccan_list_head set; - unsigned int cnt; - unsigned int blocking_cnt; - - struct rb_ractor_struct *main_ractor; - struct rb_thread_struct *main_thread; // == vm->ractor.main_ractor->threads.main - - struct { - // monitor - rb_nativethread_lock_t lock; - struct rb_ractor_struct *lock_owner; - unsigned int lock_rec; - - // join at exit - rb_nativethread_cond_t terminate_cond; - bool terminate_waiting; - -#ifndef RUBY_THREAD_PTHREAD_H - bool barrier_waiting; - unsigned int barrier_cnt; - rb_nativethread_cond_t barrier_cond; -#endif - } sync; - - // ractor scheduling - struct { - rb_nativethread_lock_t lock; - struct rb_ractor_struct *lock_owner; - bool locked; - - rb_nativethread_cond_t cond; // GRQ - unsigned int snt_cnt; // count of shared NTs - unsigned int dnt_cnt; // count of dedicated NTs - - unsigned int running_cnt; - - unsigned int max_cpu; - struct ccan_list_head grq; // // Global Ready Queue - unsigned int grq_cnt; - - // running threads - struct ccan_list_head running_threads; - - // threads which switch context by timeslice - struct ccan_list_head timeslice_threads; - - struct ccan_list_head zombie_threads; - - // true if timeslice timer is not enable - bool timeslice_wait_inf; - - // barrier - rb_nativethread_cond_t barrier_complete_cond; - rb_nativethread_cond_t barrier_release_cond; - bool barrier_waiting; - unsigned int barrier_waiting_cnt; - unsigned int barrier_serial; - } sched; - } ractor; - -#ifdef USE_SIGALTSTACK - void *main_altstack; -#endif - - rb_serial_t fork_gen; - struct ccan_list_head waiting_fds; /* <=> struct waiting_fd */ - - /* set in single-threaded processes only: */ - volatile int ubf_async_safe; - - unsigned int running: 1; - unsigned int thread_abort_on_exception: 1; - unsigned int thread_report_on_exception: 1; - unsigned int thread_ignore_deadlock: 1; - - /* object management */ - VALUE mark_object_ary; - struct global_object_list *global_object_list; - const VALUE special_exceptions[ruby_special_error_count]; - - /* load */ - VALUE top_self; - VALUE load_path; - VALUE load_path_snapshot; - VALUE load_path_check_cache; - VALUE expanded_load_path; - VALUE loaded_features; - VALUE loaded_features_snapshot; - VALUE loaded_features_realpaths; - VALUE loaded_features_realpath_map; - struct st_table *loaded_features_index; - struct st_table *loading_table; - // For running the init function of statically linked - // extensions when they are loaded - struct st_table *static_ext_inits; - - /* signal */ - struct { - VALUE cmd[RUBY_NSIG]; - } trap_list; - - /* postponed_job (async-signal-safe, and thread-safe) */ - struct rb_postponed_job_queue *postponed_job_queue; - - int src_encoding_index; - - /* workqueue (thread-safe, NOT async-signal-safe) */ - struct ccan_list_head workqueue; /* <=> rb_workqueue_job.jnode */ - rb_nativethread_lock_t workqueue_lock; - - VALUE orig_progname, progname; - VALUE coverages, me2counter; - int coverage_mode; - - struct { - struct rb_objspace *objspace; - struct gc_mark_func_data_struct { - void *data; - void (*mark_func)(VALUE v, void *data); - } *mark_func_data; - } gc; - - rb_at_exit_list *at_exit; - - st_table *frozen_strings; - - const struct rb_builtin_function *builtin_function_table; - - st_table *ci_table; - struct rb_id_table *negative_cme_table; - st_table *overloaded_cme_table; // cme -> overloaded_cme - st_table *unused_block_warning_table; - bool unused_block_warning_strict; - - // This id table contains a mapping from ID to ICs. It does this with ID - // keys and nested st_tables as values. The nested tables have ICs as keys - // and Qtrue as values. It is used when inline constant caches need to be - // invalidated or ISEQs are being freed. - struct rb_id_table *constant_cache; - -#ifndef VM_GLOBAL_CC_CACHE_TABLE_SIZE -#define VM_GLOBAL_CC_CACHE_TABLE_SIZE 1023 -#endif - const struct rb_callcache *global_cc_cache_table[VM_GLOBAL_CC_CACHE_TABLE_SIZE]; // vm_eval.c - -#if defined(USE_VM_CLOCK) && USE_VM_CLOCK - uint32_t clock; -#endif - - /* params */ - struct { /* size in byte */ - size_t thread_vm_stack_size; - size_t thread_machine_stack_size; - size_t fiber_vm_stack_size; - size_t fiber_machine_stack_size; - } default_params; - -} rb_vm_t; - -/* default values */ - -#define RUBY_VM_SIZE_ALIGN 4096 - -#define RUBY_VM_THREAD_VM_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */ -#define RUBY_VM_THREAD_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */ -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */ -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ - -#define RUBY_VM_FIBER_VM_STACK_SIZE ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ -#define RUBY_VM_FIBER_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */ -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */ -#if defined(__powerpc64__) || defined(__ppc64__) // macOS has __ppc64__ -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 32 * 1024 * sizeof(VALUE)) /* 128 KB or 256 KB */ -#else -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ -#endif - -#if __has_feature(memory_sanitizer) || __has_feature(address_sanitizer) -/* It seems sanitizers consume A LOT of machine stacks */ -#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE (1024 * 1024 * sizeof(VALUE)) -#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN -#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 512 * 1024 * sizeof(VALUE)) -#undef RUBY_VM_FIBER_MACHINE_STACK_SIZE -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 256 * 1024 * sizeof(VALUE)) -#undef RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN -#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 128 * 1024 * sizeof(VALUE)) -#endif - -#ifndef VM_DEBUG_BP_CHECK -#define VM_DEBUG_BP_CHECK 0 -#endif - -#ifndef VM_DEBUG_VERIFY_METHOD_CACHE -#define VM_DEBUG_VERIFY_METHOD_CACHE (VMDEBUG != 0) -#endif - -struct rb_captured_block { - VALUE self; - const VALUE *ep; - union { - const rb_iseq_t *iseq; - const struct vm_ifunc *ifunc; - VALUE val; - } code; -}; - -enum rb_block_handler_type { - block_handler_type_iseq, - block_handler_type_ifunc, - block_handler_type_symbol, - block_handler_type_proc -}; - -enum rb_block_type { - block_type_iseq, - block_type_ifunc, - block_type_symbol, - block_type_proc -}; - -struct rb_block { - union { - struct rb_captured_block captured; - VALUE symbol; - VALUE proc; - } as; - enum rb_block_type type; -}; - -typedef struct rb_control_frame_struct { - const VALUE *pc; // cfp[0] - VALUE *sp; // cfp[1] - const rb_iseq_t *iseq; // cfp[2] - VALUE self; // cfp[3] / block[0] - const VALUE *ep; // cfp[4] / block[1] - const void *block_code; // cfp[5] / block[2] -- iseq, ifunc, or forwarded block handler - void *jit_return; // cfp[6] -- return address for JIT code -#if VM_DEBUG_BP_CHECK - VALUE *bp_check; // cfp[7] -#endif -} rb_control_frame_t; - -extern const rb_data_type_t ruby_threadptr_data_type; - -static inline struct rb_thread_struct * -rb_thread_ptr(VALUE thval) -{ - return (struct rb_thread_struct *)rb_check_typeddata(thval, &ruby_threadptr_data_type); -} - -enum rb_thread_status { - THREAD_RUNNABLE, - THREAD_STOPPED, - THREAD_STOPPED_FOREVER, - THREAD_KILLED -}; - -#ifdef RUBY_JMP_BUF -typedef RUBY_JMP_BUF rb_jmpbuf_t; -#else -typedef void *rb_jmpbuf_t[5]; -#endif - -/* - `rb_vm_tag_jmpbuf_t` type represents a buffer used to - long jump to a C frame associated with `rb_vm_tag`. - - Use-site of `rb_vm_tag_jmpbuf_t` is responsible for calling the - following functions: - - `rb_vm_tag_jmpbuf_init` once `rb_vm_tag_jmpbuf_t` is allocated. - - `rb_vm_tag_jmpbuf_deinit` once `rb_vm_tag_jmpbuf_t` is no longer necessary. - - `RB_VM_TAG_JMPBUF_GET` transforms a `rb_vm_tag_jmpbuf_t` into a - `rb_jmpbuf_t` to be passed to `rb_setjmp/rb_longjmp`. -*/ -#if defined(__wasm__) && !defined(__EMSCRIPTEN__) -/* - WebAssembly target with Asyncify-based SJLJ needs - to capture the execution context by unwind/rewind-ing - call frames into a jump buffer. The buffer space tends - to be considerably large unlike other architectures' - register-based buffers. - Therefore, we allocates the buffer on the heap on such - environments. -*/ -typedef rb_jmpbuf_t *rb_vm_tag_jmpbuf_t; - -#define RB_VM_TAG_JMPBUF_GET(buf) (*buf) - -static inline void -rb_vm_tag_jmpbuf_init(rb_vm_tag_jmpbuf_t *jmpbuf) -{ - *jmpbuf = ruby_xmalloc(sizeof(rb_jmpbuf_t)); -} - -static inline void -rb_vm_tag_jmpbuf_deinit(const rb_vm_tag_jmpbuf_t *jmpbuf) -{ - ruby_xfree(*jmpbuf); -} -#else -typedef rb_jmpbuf_t rb_vm_tag_jmpbuf_t; - -#define RB_VM_TAG_JMPBUF_GET(buf) (buf) - -static inline void -rb_vm_tag_jmpbuf_init(rb_vm_tag_jmpbuf_t *jmpbuf) -{ - // no-op -} - -static inline void -rb_vm_tag_jmpbuf_deinit(const rb_vm_tag_jmpbuf_t *jmpbuf) -{ - // no-op -} -#endif - -/* - the members which are written in EC_PUSH_TAG() should be placed at - the beginning and the end, so that entire region is accessible. -*/ -struct rb_vm_tag { - VALUE tag; - VALUE retval; - rb_vm_tag_jmpbuf_t buf; - struct rb_vm_tag *prev; - enum ruby_tag_type state; - unsigned int lock_rec; -}; - -STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0); -STATIC_ASSERT(rb_vm_tag_buf_end, - offsetof(struct rb_vm_tag, buf) + sizeof(rb_vm_tag_jmpbuf_t) < - sizeof(struct rb_vm_tag)); - -struct rb_unblock_callback { - rb_unblock_function_t *func; - void *arg; -}; - -struct rb_mutex_struct; - -typedef struct rb_fiber_struct rb_fiber_t; - -struct rb_waiting_list { - struct rb_waiting_list *next; - struct rb_thread_struct *thread; - struct rb_fiber_struct *fiber; -}; - -struct rb_execution_context_struct { - /* execution information */ - VALUE *vm_stack; /* must free, must mark */ - size_t vm_stack_size; /* size in word (byte size / sizeof(VALUE)) */ - rb_control_frame_t *cfp; - - struct rb_vm_tag *tag; - - /* interrupt flags */ - rb_atomic_t interrupt_flag; - rb_atomic_t interrupt_mask; /* size should match flag */ -#if defined(USE_VM_CLOCK) && USE_VM_CLOCK - uint32_t checked_clock; -#endif - - rb_fiber_t *fiber_ptr; - struct rb_thread_struct *thread_ptr; - - /* storage (ec (fiber) local) */ - struct rb_id_table *local_storage; - VALUE local_storage_recursive_hash; - VALUE local_storage_recursive_hash_for_trace; - - /* Inheritable fiber storage. */ - VALUE storage; - - /* eval env */ - const VALUE *root_lep; - VALUE root_svar; - - /* trace information */ - struct rb_trace_arg_struct *trace_arg; - - /* temporary places */ - VALUE errinfo; - VALUE passed_block_handler; /* for rb_iterate */ - - uint8_t raised_flag; /* only 3 bits needed */ - - /* n.b. only 7 bits needed, really: */ - BITFIELD(enum method_missing_reason, method_missing_reason, 8); - - VALUE private_const_reference; - - /* for GC */ - struct { - VALUE *stack_start; - VALUE *stack_end; - size_t stack_maxsize; - RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs; - -#ifdef RUBY_ASAN_ENABLED - void *asan_fake_stack_handle; -#endif - } machine; -}; - -#ifndef rb_execution_context_t -typedef struct rb_execution_context_struct rb_execution_context_t; -#define rb_execution_context_t rb_execution_context_t -#endif - -// for builtin.h -#define VM_CORE_H_EC_DEFINED 1 - -// Set the vm_stack pointer in the execution context. -void rb_ec_set_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size); - -// Initialize the vm_stack pointer in the execution context and push the initial stack frame. -// @param ec the execution context to update. -// @param stack a pointer to the stack to use. -// @param size the size of the stack, as in `VALUE stack[size]`. -void rb_ec_initialize_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size); - -// Clear (set to `NULL`) the vm_stack pointer. -// @param ec the execution context to update. -void rb_ec_clear_vm_stack(rb_execution_context_t *ec); - -struct rb_ext_config { - bool ractor_safe; -}; - -typedef struct rb_ractor_struct rb_ractor_t; - -struct rb_native_thread; - -typedef struct rb_thread_struct { - struct ccan_list_node lt_node; // managed by a ractor - VALUE self; - rb_ractor_t *ractor; - rb_vm_t *vm; - struct rb_native_thread *nt; - rb_execution_context_t *ec; - - struct rb_thread_sched_item sched; - bool mn_schedulable; - rb_atomic_t serial; // only for RUBY_DEBUG_LOG() - - VALUE last_status; /* $? */ - - /* for cfunc */ - struct rb_calling_info *calling; - - /* for load(true) */ - VALUE top_self; - VALUE top_wrapper; - - /* thread control */ - - BITFIELD(enum rb_thread_status, status, 2); - /* bit flags */ - unsigned int has_dedicated_nt : 1; - unsigned int to_kill : 1; - unsigned int abort_on_exception: 1; - unsigned int report_on_exception: 1; - unsigned int pending_interrupt_queue_checked: 1; - int8_t priority; /* -3 .. 3 (RUBY_THREAD_PRIORITY_{MIN,MAX}) */ - uint32_t running_time_us; /* 12500..800000 */ - - void *blocking_region_buffer; - - VALUE thgroup; - VALUE value; - - /* temporary place of retval on OPT_CALL_THREADED_CODE */ -#if OPT_CALL_THREADED_CODE - VALUE retval; -#endif - - /* async errinfo queue */ - VALUE pending_interrupt_queue; - VALUE pending_interrupt_mask_stack; - - /* interrupt management */ - rb_nativethread_lock_t interrupt_lock; - struct rb_unblock_callback unblock; - VALUE locking_mutex; - struct rb_mutex_struct *keeping_mutexes; - - struct rb_waiting_list *join_list; - - union { - struct { - VALUE proc; - VALUE args; - int kw_splat; - } proc; - struct { - VALUE (*func)(void *); - void *arg; - } func; - } invoke_arg; - - enum thread_invoke_type { - thread_invoke_type_none = 0, - thread_invoke_type_proc, - thread_invoke_type_ractor_proc, - thread_invoke_type_func - } invoke_type; - - /* statistics data for profiler */ - VALUE stat_insn_usage; - - /* fiber */ - rb_fiber_t *root_fiber; - - VALUE scheduler; - unsigned int blocking; - - /* misc */ - VALUE name; - void **specific_storage; - - struct rb_ext_config ext_config; -} rb_thread_t; - -static inline unsigned int -rb_th_serial(const rb_thread_t *th) -{ - return th ? (unsigned int)th->serial : 0; -} - -typedef enum { - VM_DEFINECLASS_TYPE_CLASS = 0x00, - VM_DEFINECLASS_TYPE_SINGLETON_CLASS = 0x01, - VM_DEFINECLASS_TYPE_MODULE = 0x02, - /* 0x03..0x06 is reserved */ - VM_DEFINECLASS_TYPE_MASK = 0x07 -} rb_vm_defineclass_type_t; - -#define VM_DEFINECLASS_TYPE(x) ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK) -#define VM_DEFINECLASS_FLAG_SCOPED 0x08 -#define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS 0x10 -#define VM_DEFINECLASS_SCOPED_P(x) ((x) & VM_DEFINECLASS_FLAG_SCOPED) -#define VM_DEFINECLASS_HAS_SUPERCLASS_P(x) \ - ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS) - -/* iseq.c */ -RUBY_SYMBOL_EXPORT_BEGIN - -/* node -> iseq */ -rb_iseq_t *rb_iseq_new (const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type); -rb_iseq_t *rb_iseq_new_top (const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent); -rb_iseq_t *rb_iseq_new_main (const VALUE ast_value, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt); -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); -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, - enum rb_iseq_type, const rb_compile_option_t*, - VALUE script_lines); - -struct iseq_link_anchor; -struct rb_iseq_new_with_callback_callback_func { - VALUE flags; - VALUE reserved; - void (*func)(rb_iseq_t *, struct iseq_link_anchor *, const void *); - const void *data; -}; -static inline struct rb_iseq_new_with_callback_callback_func * -rb_iseq_new_with_callback_new_callback( - void (*func)(rb_iseq_t *, struct iseq_link_anchor *, const void *), const void *ptr) -{ - struct rb_iseq_new_with_callback_callback_func *memo = - IMEMO_NEW(struct rb_iseq_new_with_callback_callback_func, imemo_ifunc, Qfalse); - memo->func = func; - memo->data = ptr; - - return memo; -} -rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_callback_func * ifunc, - VALUE name, VALUE path, VALUE realpath, int first_lineno, - const rb_iseq_t *parent, enum rb_iseq_type, const rb_compile_option_t*); - -VALUE rb_iseq_disasm(const rb_iseq_t *iseq); -int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child); - -VALUE rb_iseq_coverage(const rb_iseq_t *iseq); - -RUBY_EXTERN VALUE rb_cISeq; -RUBY_EXTERN VALUE rb_cRubyVM; -RUBY_EXTERN VALUE rb_mRubyVMFrozenCore; -RUBY_EXTERN VALUE rb_block_param_proxy; -RUBY_SYMBOL_EXPORT_END - -#define GetProcPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_proc_t, (ptr)) - -typedef struct { - const struct rb_block block; - unsigned int is_from_method: 1; /* bool */ - unsigned int is_lambda: 1; /* bool */ - unsigned int is_isolated: 1; /* bool */ -} rb_proc_t; - -RUBY_SYMBOL_EXPORT_BEGIN -VALUE rb_proc_isolate(VALUE self); -VALUE rb_proc_isolate_bang(VALUE self); -VALUE rb_proc_ractor_make_shareable(VALUE self); -RUBY_SYMBOL_EXPORT_END - -typedef struct { - VALUE flags; /* imemo header */ - rb_iseq_t *iseq; - const VALUE *ep; - const VALUE *env; - unsigned int env_size; -} rb_env_t; - -extern const rb_data_type_t ruby_binding_data_type; - -#define GetBindingPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_binding_t, (ptr)) - -typedef struct { - const struct rb_block block; - const VALUE pathobj; - int first_lineno; -} rb_binding_t; - -/* used by compile time and send insn */ - -enum vm_check_match_type { - VM_CHECKMATCH_TYPE_WHEN = 1, - VM_CHECKMATCH_TYPE_CASE = 2, - VM_CHECKMATCH_TYPE_RESCUE = 3 -}; - -#define VM_CHECKMATCH_TYPE_MASK 0x03 -#define VM_CHECKMATCH_ARRAY 0x04 - -enum vm_opt_newarray_send_type { - VM_OPT_NEWARRAY_SEND_MAX = 1, - VM_OPT_NEWARRAY_SEND_MIN = 2, - VM_OPT_NEWARRAY_SEND_HASH = 3, - VM_OPT_NEWARRAY_SEND_PACK = 4, - VM_OPT_NEWARRAY_SEND_PACK_BUFFER = 5, -}; - -enum vm_special_object_type { - VM_SPECIAL_OBJECT_VMCORE = 1, - VM_SPECIAL_OBJECT_CBASE, - VM_SPECIAL_OBJECT_CONST_BASE -}; - -enum vm_svar_index { - VM_SVAR_LASTLINE = 0, /* $_ */ - VM_SVAR_BACKREF = 1, /* $~ */ - - VM_SVAR_EXTRA_START = 2, - VM_SVAR_FLIPFLOP_START = 2 /* flipflop */ -}; - -/* inline cache */ -typedef struct iseq_inline_constant_cache *IC; -typedef struct iseq_inline_iv_cache_entry *IVC; -typedef struct iseq_inline_cvar_cache_entry *ICVARC; -typedef union iseq_inline_storage_entry *ISE; -typedef const struct rb_callinfo *CALL_INFO; -typedef const struct rb_callcache *CALL_CACHE; -typedef struct rb_call_data *CALL_DATA; - -typedef VALUE CDHASH; - -#ifndef FUNC_FASTCALL -#define FUNC_FASTCALL(x) x -#endif - -typedef rb_control_frame_t * - (FUNC_FASTCALL(*rb_insn_func_t))(rb_execution_context_t *, rb_control_frame_t *); - -#define VM_TAGGED_PTR_SET(p, tag) ((VALUE)(p) | (tag)) -#define VM_TAGGED_PTR_REF(v, mask) ((void *)((v) & ~mask)) - -#define GC_GUARDED_PTR(p) VM_TAGGED_PTR_SET((p), 0x01) -#define GC_GUARDED_PTR_REF(p) VM_TAGGED_PTR_REF((p), 0x03) -#define GC_GUARDED_PTR_P(p) (((VALUE)(p)) & 0x01) - -enum vm_frame_env_flags { - /* Frame/Environment flag bits: - * MMMM MMMM MMMM MMMM ____ FFFF FFFE EEEX (LSB) - * - * X : tag for GC marking (It seems as Fixnum) - * EEE : 4 bits Env flags - * FF..: 7 bits Frame flags - * MM..: 15 bits frame magic (to check frame corruption) - */ - - /* frame types */ - VM_FRAME_MAGIC_METHOD = 0x11110001, - VM_FRAME_MAGIC_BLOCK = 0x22220001, - VM_FRAME_MAGIC_CLASS = 0x33330001, - VM_FRAME_MAGIC_TOP = 0x44440001, - VM_FRAME_MAGIC_CFUNC = 0x55550001, - VM_FRAME_MAGIC_IFUNC = 0x66660001, - VM_FRAME_MAGIC_EVAL = 0x77770001, - VM_FRAME_MAGIC_RESCUE = 0x78880001, - VM_FRAME_MAGIC_DUMMY = 0x79990001, - - VM_FRAME_MAGIC_MASK = 0x7fff0001, - - /* frame flag */ - VM_FRAME_FLAG_FINISH = 0x0020, - VM_FRAME_FLAG_BMETHOD = 0x0040, - VM_FRAME_FLAG_CFRAME = 0x0080, - VM_FRAME_FLAG_LAMBDA = 0x0100, - VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM = 0x0200, - VM_FRAME_FLAG_CFRAME_KW = 0x0400, - VM_FRAME_FLAG_PASSED = 0x0800, - - /* env flag */ - VM_ENV_FLAG_LOCAL = 0x0002, - VM_ENV_FLAG_ESCAPED = 0x0004, - VM_ENV_FLAG_WB_REQUIRED = 0x0008, - VM_ENV_FLAG_ISOLATED = 0x0010, -}; - -#define VM_ENV_DATA_SIZE ( 3) - -#define VM_ENV_DATA_INDEX_ME_CREF (-2) /* ep[-2] */ -#define VM_ENV_DATA_INDEX_SPECVAL (-1) /* ep[-1] */ -#define VM_ENV_DATA_INDEX_FLAGS ( 0) /* ep[ 0] */ -#define VM_ENV_DATA_INDEX_ENV ( 1) /* ep[ 1] */ - -#define VM_ENV_INDEX_LAST_LVAR (-VM_ENV_DATA_SIZE) - -static inline void VM_FORCE_WRITE_SPECIAL_CONST(const VALUE *ptr, VALUE special_const_value); - -static inline void -VM_ENV_FLAGS_SET(const VALUE *ep, VALUE flag) -{ - VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS]; - VM_ASSERT(FIXNUM_P(flags)); - VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_FLAGS], flags | flag); -} - -static inline void -VM_ENV_FLAGS_UNSET(const VALUE *ep, VALUE flag) -{ - VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS]; - VM_ASSERT(FIXNUM_P(flags)); - VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_FLAGS], flags & ~flag); -} - -static inline unsigned long -VM_ENV_FLAGS(const VALUE *ep, long flag) -{ - VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS]; - VM_ASSERT(FIXNUM_P(flags)); - return flags & flag; -} - -static inline unsigned long -VM_FRAME_TYPE(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_MAGIC_MASK); -} - -static inline int -VM_FRAME_LAMBDA_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_LAMBDA) != 0; -} - -static inline int -VM_FRAME_CFRAME_KW_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME_KW) != 0; -} - -static inline int -VM_FRAME_FINISHED_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_FINISH) != 0; -} - -static inline int -VM_FRAME_BMETHOD_P(const rb_control_frame_t *cfp) -{ - return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_BMETHOD) != 0; -} - -static inline int -rb_obj_is_iseq(VALUE iseq) -{ - return imemo_type_p(iseq, imemo_iseq); -} - -#if VM_CHECK_MODE > 0 -#define RUBY_VM_NORMAL_ISEQ_P(iseq) rb_obj_is_iseq((VALUE)iseq) -#endif - -static inline int -VM_FRAME_CFRAME_P(const rb_control_frame_t *cfp) -{ - int cframe_p = VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME) != 0; - VM_ASSERT(RUBY_VM_NORMAL_ISEQ_P(cfp->iseq) != cframe_p || - (VM_FRAME_TYPE(cfp) & VM_FRAME_MAGIC_MASK) == VM_FRAME_MAGIC_DUMMY); - return cframe_p; -} - -static inline int -VM_FRAME_RUBYFRAME_P(const rb_control_frame_t *cfp) -{ - return !VM_FRAME_CFRAME_P(cfp); -} - -#define RUBYVM_CFUNC_FRAME_P(cfp) \ - (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC) - -#define VM_GUARDED_PREV_EP(ep) GC_GUARDED_PTR(ep) -#define VM_BLOCK_HANDLER_NONE 0 - -static inline int -VM_ENV_LOCAL_P(const VALUE *ep) -{ - return VM_ENV_FLAGS(ep, VM_ENV_FLAG_LOCAL) ? 1 : 0; -} - -static inline const VALUE * -VM_ENV_PREV_EP(const VALUE *ep) -{ - VM_ASSERT(VM_ENV_LOCAL_P(ep) == 0); - return GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]); -} - -static inline VALUE -VM_ENV_BLOCK_HANDLER(const VALUE *ep) -{ - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - return ep[VM_ENV_DATA_INDEX_SPECVAL]; -} - -#if VM_CHECK_MODE > 0 -int rb_vm_ep_in_heap_p(const VALUE *ep); -#endif - -static inline int -VM_ENV_ESCAPED_P(const VALUE *ep) -{ - VM_ASSERT(rb_vm_ep_in_heap_p(ep) == !!VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED)); - return VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED) ? 1 : 0; -} - -#if VM_CHECK_MODE > 0 -static inline int -vm_assert_env(VALUE obj) -{ - VM_ASSERT(imemo_type_p(obj, imemo_env)); - return 1; -} -#endif - -RBIMPL_ATTR_NONNULL((1)) -static inline VALUE -VM_ENV_ENVVAL(const VALUE *ep) -{ - VALUE envval = ep[VM_ENV_DATA_INDEX_ENV]; - VM_ASSERT(VM_ENV_ESCAPED_P(ep)); - VM_ASSERT(vm_assert_env(envval)); - return envval; -} - -RBIMPL_ATTR_NONNULL((1)) -static inline const rb_env_t * -VM_ENV_ENVVAL_PTR(const VALUE *ep) -{ - return (const rb_env_t *)VM_ENV_ENVVAL(ep); -} - -static inline const rb_env_t * -vm_env_new(VALUE *env_ep, VALUE *env_body, unsigned int env_size, const rb_iseq_t *iseq) -{ - rb_env_t *env = IMEMO_NEW(rb_env_t, imemo_env, (VALUE)iseq); - env->ep = env_ep; - env->env = env_body; - env->env_size = env_size; - env_ep[VM_ENV_DATA_INDEX_ENV] = (VALUE)env; - return env; -} - -static inline void -VM_FORCE_WRITE(const VALUE *ptr, VALUE v) -{ - *((VALUE *)ptr) = v; -} - -static inline void -VM_FORCE_WRITE_SPECIAL_CONST(const VALUE *ptr, VALUE special_const_value) -{ - VM_ASSERT(RB_SPECIAL_CONST_P(special_const_value)); - VM_FORCE_WRITE(ptr, special_const_value); -} - -static inline void -VM_STACK_ENV_WRITE(const VALUE *ep, int index, VALUE v) -{ - VM_ASSERT(VM_ENV_FLAGS(ep, VM_ENV_FLAG_WB_REQUIRED) == 0); - VM_FORCE_WRITE(&ep[index], v); -} - -const VALUE *rb_vm_ep_local_ep(const VALUE *ep); -const VALUE *rb_vm_proc_local_ep(VALUE proc); -void rb_vm_block_ep_update(VALUE obj, const struct rb_block *dst, const VALUE *ep); -void rb_vm_block_copy(VALUE obj, const struct rb_block *dst, const struct rb_block *src); - -VALUE rb_vm_frame_block_handler(const rb_control_frame_t *cfp); - -#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) ((cfp)+1) -#define RUBY_VM_NEXT_CONTROL_FRAME(cfp) ((cfp)-1) - -#define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \ - ((void *)(ecfp) > (void *)(cfp)) - -static inline const rb_control_frame_t * -RUBY_VM_END_CONTROL_FRAME(const rb_execution_context_t *ec) -{ - return (rb_control_frame_t *)(ec->vm_stack + ec->vm_stack_size); -} - -static inline int -RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(const rb_execution_context_t *ec, const rb_control_frame_t *cfp) -{ - return !RUBY_VM_VALID_CONTROL_FRAME_P(cfp, RUBY_VM_END_CONTROL_FRAME(ec)); -} - -static inline int -VM_BH_ISEQ_BLOCK_P(VALUE block_handler) -{ - if ((block_handler & 0x03) == 0x01) { -#if VM_CHECK_MODE > 0 - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(imemo_type_p(captured->code.val, imemo_iseq)); -#endif - return 1; - } - else { - return 0; - } -} - -static inline VALUE -VM_BH_FROM_ISEQ_BLOCK(const struct rb_captured_block *captured) -{ - VALUE block_handler = VM_TAGGED_PTR_SET(captured, 0x01); - VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler)); - return block_handler; -} - -static inline const struct rb_captured_block * -VM_BH_TO_ISEQ_BLOCK(VALUE block_handler) -{ - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler)); - return captured; -} - -static inline int -VM_BH_IFUNC_P(VALUE block_handler) -{ - if ((block_handler & 0x03) == 0x03) { -#if VM_CHECK_MODE > 0 - struct rb_captured_block *captured = (void *)(block_handler & ~0x03); - VM_ASSERT(imemo_type_p(captured->code.val, imemo_ifunc)); -#endif - return 1; - } - else { - return 0; - } -} - -static inline VALUE -VM_BH_FROM_IFUNC_BLOCK(const struct rb_captured_block *captured) -{ - VALUE block_handler = VM_TAGGED_PTR_SET(captured, 0x03); - VM_ASSERT(VM_BH_IFUNC_P(block_handler)); - return block_handler; -} - -static inline const struct rb_captured_block * -VM_BH_TO_IFUNC_BLOCK(VALUE block_handler) -{ - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(VM_BH_IFUNC_P(block_handler)); - return captured; -} - -static inline const struct rb_captured_block * -VM_BH_TO_CAPT_BLOCK(VALUE block_handler) -{ - struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03); - VM_ASSERT(VM_BH_IFUNC_P(block_handler) || VM_BH_ISEQ_BLOCK_P(block_handler)); - return captured; -} - -static inline enum rb_block_handler_type -vm_block_handler_type(VALUE block_handler) -{ - if (VM_BH_ISEQ_BLOCK_P(block_handler)) { - return block_handler_type_iseq; - } - else if (VM_BH_IFUNC_P(block_handler)) { - return block_handler_type_ifunc; - } - else if (SYMBOL_P(block_handler)) { - return block_handler_type_symbol; - } - else { - VM_ASSERT(rb_obj_is_proc(block_handler)); - return block_handler_type_proc; - } -} - -static inline void -vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler)) -{ - VM_ASSERT(block_handler == VM_BLOCK_HANDLER_NONE || - (vm_block_handler_type(block_handler), 1)); -} - -static inline enum rb_block_type -vm_block_type(const struct rb_block *block) -{ -#if VM_CHECK_MODE > 0 - switch (block->type) { - case block_type_iseq: - VM_ASSERT(imemo_type_p(block->as.captured.code.val, imemo_iseq)); - break; - case block_type_ifunc: - VM_ASSERT(imemo_type_p(block->as.captured.code.val, imemo_ifunc)); - break; - case block_type_symbol: - VM_ASSERT(SYMBOL_P(block->as.symbol)); - break; - case block_type_proc: - VM_ASSERT(rb_obj_is_proc(block->as.proc)); - break; - } -#endif - return block->type; -} - -static inline void -vm_block_type_set(const struct rb_block *block, enum rb_block_type type) -{ - struct rb_block *mb = (struct rb_block *)block; - mb->type = type; -} - -static inline const struct rb_block * -vm_proc_block(VALUE procval) -{ - VM_ASSERT(rb_obj_is_proc(procval)); - return &((rb_proc_t *)RTYPEDDATA_DATA(procval))->block; -} - -static inline const rb_iseq_t *vm_block_iseq(const struct rb_block *block); -static inline const VALUE *vm_block_ep(const struct rb_block *block); - -static inline const rb_iseq_t * -vm_proc_iseq(VALUE procval) -{ - return vm_block_iseq(vm_proc_block(procval)); -} - -static inline const VALUE * -vm_proc_ep(VALUE procval) -{ - return vm_block_ep(vm_proc_block(procval)); -} - -static inline const rb_iseq_t * -vm_block_iseq(const struct rb_block *block) -{ - switch (vm_block_type(block)) { - case block_type_iseq: return rb_iseq_check(block->as.captured.code.iseq); - case block_type_proc: return vm_proc_iseq(block->as.proc); - case block_type_ifunc: - case block_type_symbol: return NULL; - } - VM_UNREACHABLE(vm_block_iseq); - return NULL; -} - -static inline const VALUE * -vm_block_ep(const struct rb_block *block) -{ - switch (vm_block_type(block)) { - case block_type_iseq: - case block_type_ifunc: return block->as.captured.ep; - case block_type_proc: return vm_proc_ep(block->as.proc); - case block_type_symbol: return NULL; - } - VM_UNREACHABLE(vm_block_ep); - return NULL; -} - -static inline VALUE -vm_block_self(const struct rb_block *block) -{ - switch (vm_block_type(block)) { - case block_type_iseq: - case block_type_ifunc: - return block->as.captured.self; - case block_type_proc: - return vm_block_self(vm_proc_block(block->as.proc)); - case block_type_symbol: - return Qundef; - } - VM_UNREACHABLE(vm_block_self); - return Qundef; -} - -static inline VALUE -VM_BH_TO_SYMBOL(VALUE block_handler) -{ - VM_ASSERT(SYMBOL_P(block_handler)); - return block_handler; -} - -static inline VALUE -VM_BH_FROM_SYMBOL(VALUE symbol) -{ - VM_ASSERT(SYMBOL_P(symbol)); - return symbol; -} - -static inline VALUE -VM_BH_TO_PROC(VALUE block_handler) -{ - VM_ASSERT(rb_obj_is_proc(block_handler)); - return block_handler; -} - -static inline VALUE -VM_BH_FROM_PROC(VALUE procval) -{ - VM_ASSERT(rb_obj_is_proc(procval)); - return procval; -} - -/* VM related object allocate functions */ -VALUE rb_thread_alloc(VALUE klass); -VALUE rb_binding_alloc(VALUE klass); -VALUE rb_proc_alloc(VALUE klass); -VALUE rb_proc_dup(VALUE self); - -/* for debug */ -extern bool rb_vmdebug_stack_dump_raw(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *); -extern bool rb_vmdebug_debug_print_pre(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE *_pc, FILE *); -extern bool rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *); - -#define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp, stderr) -#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp), stderr) -bool rb_vm_bugreport(const void *, FILE *); -typedef void (*ruby_sighandler_t)(int); -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5) -NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...)); - -/* functions about thread/vm execution */ -RUBY_SYMBOL_EXPORT_BEGIN -VALUE rb_iseq_eval(const rb_iseq_t *iseq); -VALUE rb_iseq_eval_main(const rb_iseq_t *iseq); -VALUE rb_iseq_path(const rb_iseq_t *iseq); -VALUE rb_iseq_realpath(const rb_iseq_t *iseq); -RUBY_SYMBOL_EXPORT_END - -VALUE rb_iseq_pathobj_new(VALUE path, VALUE realpath); -void rb_iseq_pathobj_set(const rb_iseq_t *iseq, VALUE path, VALUE realpath); - -int rb_ec_frame_method_id_and_class(const rb_execution_context_t *ec, ID *idp, ID *called_idp, VALUE *klassp); -void rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause); - -VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, int kw_splat, VALUE block_handler); - -VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda); -static inline VALUE -rb_vm_make_proc(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass) -{ - return rb_vm_make_proc_lambda(ec, captured, klass, 0); -} - -static inline VALUE -rb_vm_make_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass) -{ - return rb_vm_make_proc_lambda(ec, captured, klass, 1); -} - -VALUE rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *src_cfp); -VALUE rb_vm_env_local_variables(const rb_env_t *env); -const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env); -const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars); -void rb_vm_inc_const_missing_count(void); -VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, - const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat); -void rb_vm_pop_frame_no_int(rb_execution_context_t *ec); -void rb_vm_pop_frame(rb_execution_context_t *ec); - -void rb_thread_start_timer_thread(void); -void rb_thread_stop_timer_thread(void); -void rb_thread_reset_timer_thread(void); -void rb_thread_wakeup_timer_thread(int); - -static inline void -rb_vm_living_threads_init(rb_vm_t *vm) -{ - ccan_list_head_init(&vm->waiting_fds); - ccan_list_head_init(&vm->workqueue); - ccan_list_head_init(&vm->ractor.set); - ccan_list_head_init(&vm->ractor.sched.zombie_threads); -} - -typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE); -rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -VALUE *rb_vm_svar_lep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -int rb_vm_get_sourceline(const rb_control_frame_t *); -void rb_vm_stack_to_heap(rb_execution_context_t *ec); -void ruby_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame); -rb_thread_t * ruby_thread_from_native(void); -int ruby_thread_set_native(rb_thread_t *th); -int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp); -void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp); -void rb_vm_env_write(const VALUE *ep, int index, VALUE v); -VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler); - -void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg); - -#define rb_vm_register_special_exception(sp, e, m) \ - rb_vm_register_special_exception_str(sp, e, rb_usascii_str_new_static((m), (long)rb_strlen_lit(m))) - -void rb_gc_mark_machine_context(const rb_execution_context_t *ec); - -void rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr); - -const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp); - -#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack] - -#define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) do { \ - STATIC_ASSERT(sizeof_sp, sizeof(*(sp)) == sizeof(VALUE)); \ - STATIC_ASSERT(sizeof_cfp, sizeof(*(cfp)) == sizeof(rb_control_frame_t)); \ - const struct rb_control_frame_struct *bound = (void *)&(sp)[(margin)]; \ - if (UNLIKELY((cfp) <= &bound[1])) { \ - vm_stackoverflow(); \ - } \ -} while (0) - -#define CHECK_VM_STACK_OVERFLOW(cfp, margin) \ - CHECK_VM_STACK_OVERFLOW0((cfp), (cfp)->sp, (margin)) - -VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr); - -rb_execution_context_t *rb_vm_main_ractor_ec(rb_vm_t *vm); // ractor.c - -/* for thread */ - -#if RUBY_VM_THREAD_MODEL == 2 - -RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c -RUBY_EXTERN rb_vm_t *ruby_current_vm_ptr; -RUBY_EXTERN rb_event_flag_t ruby_vm_event_flags; -RUBY_EXTERN rb_event_flag_t ruby_vm_event_enabled_global_flags; -RUBY_EXTERN unsigned int ruby_vm_event_local_num; - -#define GET_VM() rb_current_vm() -#define GET_RACTOR() rb_current_ractor() -#define GET_THREAD() rb_current_thread() -#define GET_EC() rb_current_execution_context(true) - -static inline rb_thread_t * -rb_ec_thread_ptr(const rb_execution_context_t *ec) -{ - return ec->thread_ptr; -} - -static inline rb_ractor_t * -rb_ec_ractor_ptr(const rb_execution_context_t *ec) -{ - const rb_thread_t *th = rb_ec_thread_ptr(ec); - if (th) { - VM_ASSERT(th->ractor != NULL); - return th->ractor; - } - else { - return NULL; - } -} - -static inline rb_vm_t * -rb_ec_vm_ptr(const rb_execution_context_t *ec) -{ - const rb_thread_t *th = rb_ec_thread_ptr(ec); - if (th) { - return th->vm; - } - else { - return NULL; - } -} - -static inline rb_execution_context_t * -rb_current_execution_context(bool expect_ec) -{ -#ifdef RB_THREAD_LOCAL_SPECIFIER - #ifdef __APPLE__ - rb_execution_context_t *ec = rb_current_ec(); - #else - rb_execution_context_t *ec = ruby_current_ec; - #endif - - /* On the shared objects, `__tls_get_addr()` is used to access the TLS - * and the address of the `ruby_current_ec` can be stored on a function - * frame. However, this address can be mis-used after native thread - * migration of a coroutine. - * 1) Get `ptr =&ruby_current_ec` op NT1 and store it on the frame. - * 2) Context switch and resume it on the NT2. - * 3) `ptr` is used on NT2 but it accesses to the TLS on NT1. - * This assertion checks such misusage. - * - * To avoid accidents, `GET_EC()` should be called once on the frame. - * Note that inlining can produce the problem. - */ - VM_ASSERT(ec == rb_current_ec_noinline()); -#else - rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key); -#endif - VM_ASSERT(!expect_ec || ec != NULL); - return ec; -} - -static inline rb_thread_t * -rb_current_thread(void) -{ - const rb_execution_context_t *ec = GET_EC(); - return rb_ec_thread_ptr(ec); -} - -static inline rb_ractor_t * -rb_current_ractor_raw(bool expect) -{ - if (ruby_single_main_ractor) { - return ruby_single_main_ractor; - } - else { - const rb_execution_context_t *ec = rb_current_execution_context(expect); - return (expect || ec) ? rb_ec_ractor_ptr(ec) : NULL; - } -} - -static inline rb_ractor_t * -rb_current_ractor(void) -{ - return rb_current_ractor_raw(true); -} - -static inline rb_vm_t * -rb_current_vm(void) -{ -#if 0 // TODO: reconsider the assertions - VM_ASSERT(ruby_current_vm_ptr == NULL || - ruby_current_execution_context_ptr == NULL || - rb_ec_thread_ptr(GET_EC()) == NULL || - rb_ec_thread_ptr(GET_EC())->status == THREAD_KILLED || - rb_ec_vm_ptr(GET_EC()) == ruby_current_vm_ptr); -#endif - - return ruby_current_vm_ptr; -} - -void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec, - unsigned int recorded_lock_rec, - unsigned int current_lock_rec); - -static inline unsigned int -rb_ec_vm_lock_rec(const rb_execution_context_t *ec) -{ - rb_vm_t *vm = rb_ec_vm_ptr(ec); - - if (vm->ractor.sync.lock_owner != rb_ec_ractor_ptr(ec)) { - return 0; - } - else { - return vm->ractor.sync.lock_rec; - } -} - -#else -#error "unsupported thread model" -#endif - -enum { - TIMER_INTERRUPT_MASK = 0x01, - PENDING_INTERRUPT_MASK = 0x02, - POSTPONED_JOB_INTERRUPT_MASK = 0x04, - TRAP_INTERRUPT_MASK = 0x08, - TERMINATE_INTERRUPT_MASK = 0x10, - VM_BARRIER_INTERRUPT_MASK = 0x20, -}; - -#define RUBY_VM_SET_TIMER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TIMER_INTERRUPT_MASK) -#define RUBY_VM_SET_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, PENDING_INTERRUPT_MASK) -#define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK) -#define RUBY_VM_SET_TRAP_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TRAP_INTERRUPT_MASK) -#define RUBY_VM_SET_TERMINATE_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TERMINATE_INTERRUPT_MASK) -#define RUBY_VM_SET_VM_BARRIER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, VM_BARRIER_INTERRUPT_MASK) -#define RUBY_VM_INTERRUPTED(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask & \ - (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK)) - -static inline bool -RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec) -{ -#if defined(USE_VM_CLOCK) && USE_VM_CLOCK - uint32_t current_clock = rb_ec_vm_ptr(ec)->clock; - - if (current_clock != ec->checked_clock) { - ec->checked_clock = current_clock; - RUBY_VM_SET_TIMER_INTERRUPT(ec); - } -#endif - return ec->interrupt_flag & ~(ec)->interrupt_mask; -} - -VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt); -int rb_signal_buff_size(void); -int rb_signal_exec(rb_thread_t *th, int sig); -void rb_threadptr_check_signal(rb_thread_t *mth); -void rb_threadptr_signal_raise(rb_thread_t *th, int sig); -void rb_threadptr_signal_exit(rb_thread_t *th); -int rb_threadptr_execute_interrupts(rb_thread_t *, int); -void rb_threadptr_interrupt(rb_thread_t *th); -void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th); -void rb_threadptr_pending_interrupt_clear(rb_thread_t *th); -void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v); -VALUE rb_ec_get_errinfo(const rb_execution_context_t *ec); -void rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo); -void rb_execution_context_update(rb_execution_context_t *ec); -void rb_execution_context_mark(const rb_execution_context_t *ec); -void rb_fiber_close(rb_fiber_t *fib); -void Init_native_thread(rb_thread_t *th); -int rb_vm_check_ints_blocking(rb_execution_context_t *ec); - -// vm_sync.h -void rb_vm_cond_wait(rb_vm_t *vm, rb_nativethread_cond_t *cond); -void rb_vm_cond_timedwait(rb_vm_t *vm, rb_nativethread_cond_t *cond, unsigned long msec); - -#define RUBY_VM_CHECK_INTS(ec) rb_vm_check_ints(ec) -static inline void -rb_vm_check_ints(rb_execution_context_t *ec) -{ -#ifdef RUBY_ASSERT_CRITICAL_SECTION - VM_ASSERT(ruby_assert_critical_section_entered == 0); -#endif - - VM_ASSERT(ec == GET_EC()); - - if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) { - rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0); - } -} - -/* tracer */ - -struct rb_trace_arg_struct { - rb_event_flag_t event; - rb_execution_context_t *ec; - const rb_control_frame_t *cfp; - VALUE self; - ID id; - ID called_id; - VALUE klass; - VALUE data; - - int klass_solved; - - /* calc from cfp */ - int lineno; - VALUE path; -}; - -void rb_hook_list_mark(rb_hook_list_t *hooks); -void rb_hook_list_mark_and_update(rb_hook_list_t *hooks); -void rb_hook_list_free(rb_hook_list_t *hooks); -void rb_hook_list_connect_tracepoint(VALUE target, rb_hook_list_t *list, VALUE tpval, unsigned int target_line); -void rb_hook_list_remove_tracepoint(rb_hook_list_t *list, VALUE tpval); - -void rb_exec_event_hooks(struct rb_trace_arg_struct *trace_arg, rb_hook_list_t *hooks, int pop_p); - -#define EXEC_EVENT_HOOK_ORIG(ec_, hooks_, flag_, self_, id_, called_id_, klass_, data_, pop_p_) do { \ - const rb_event_flag_t flag_arg_ = (flag_); \ - rb_hook_list_t *hooks_arg_ = (hooks_); \ - if (UNLIKELY((hooks_arg_)->events & (flag_arg_))) { \ - /* defer evaluating the other arguments */ \ - rb_exec_event_hook_orig(ec_, hooks_arg_, flag_arg_, self_, id_, called_id_, klass_, data_, pop_p_); \ - } \ -} while (0) - -static inline void -rb_exec_event_hook_orig(rb_execution_context_t *ec, rb_hook_list_t *hooks, rb_event_flag_t flag, - VALUE self, ID id, ID called_id, VALUE klass, VALUE data, int pop_p) -{ - struct rb_trace_arg_struct trace_arg; - - VM_ASSERT((hooks->events & flag) != 0); - - trace_arg.event = flag; - trace_arg.ec = ec; - trace_arg.cfp = ec->cfp; - trace_arg.self = self; - trace_arg.id = id; - trace_arg.called_id = called_id; - trace_arg.klass = klass; - trace_arg.data = data; - trace_arg.path = Qundef; - trace_arg.klass_solved = 0; - - rb_exec_event_hooks(&trace_arg, hooks, pop_p); -} - -struct rb_ractor_pub { - VALUE self; - uint32_t id; - rb_hook_list_t hooks; -}; - -static inline rb_hook_list_t * -rb_ec_ractor_hooks(const rb_execution_context_t *ec) -{ - struct rb_ractor_pub *cr_pub = (struct rb_ractor_pub *)rb_ec_ractor_ptr(ec); - return &cr_pub->hooks; -} - -#define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \ - EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0) - -#define EXEC_EVENT_HOOK_AND_POP_FRAME(ec_, flag_, self_, id_, called_id_, klass_, data_) \ - EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1) - -static inline void -rb_exec_event_hook_script_compiled(rb_execution_context_t *ec, const rb_iseq_t *iseq, VALUE eval_script) -{ - EXEC_EVENT_HOOK(ec, RUBY_EVENT_SCRIPT_COMPILED, ec->cfp->self, 0, 0, 0, - NIL_P(eval_script) ? (VALUE)iseq : - rb_ary_new_from_args(2, eval_script, (VALUE)iseq)); -} - -void rb_vm_trap_exit(rb_vm_t *vm); -void rb_vm_postponed_job_atfork(void); /* vm_trace.c */ -void rb_vm_postponed_job_free(void); /* vm_trace.c */ -size_t rb_vm_memsize_postponed_job_queue(void); /* vm_trace.c */ -void rb_vm_postponed_job_queue_init(rb_vm_t *vm); /* vm_trace.c */ - -RUBY_SYMBOL_EXPORT_BEGIN - -int rb_thread_check_trap_pending(void); - -/* #define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000 */ /* from vm_core.h */ -#define RUBY_EVENT_COVERAGE_LINE 0x010000 -#define RUBY_EVENT_COVERAGE_BRANCH 0x020000 - -extern VALUE rb_get_coverages(void); -extern void rb_set_coverages(VALUE, int, VALUE); -extern void rb_clear_coverages(void); -extern void rb_reset_coverages(void); -extern void rb_resume_coverages(void); -extern void rb_suspend_coverages(void); - -void rb_postponed_job_flush(rb_vm_t *vm); - -// ractor.c -RUBY_EXTERN VALUE rb_eRactorUnsafeError; -RUBY_EXTERN VALUE rb_eRactorIsolationError; - -RUBY_SYMBOL_EXPORT_END - -#endif /* RUBY_VM_CORE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h deleted file mode 100644 index d0bc815..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef RUBY_DEBUG_H -#define RUBY_DEBUG_H -/********************************************************************** - - vm_debug.h - YARV Debug function interface - - $Author$ - created at: 04/08/25 02:33:49 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -#include "ruby/ruby.h" - -RUBY_SYMBOL_EXPORT_BEGIN - -#define dpv(h,v) ruby_debug_print_value(-1, 0, (h), (v)) -#define dp(v) ruby_debug_print_value(-1, 0, "", (v)) -#define dpi(i) ruby_debug_print_id(-1, 0, "", (i)) -#define dpn(n) ruby_debug_print_node(-1, 0, "", (n)) - -struct RNode; - -VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v); -void ruby_debug_print_v(VALUE v); -ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id); -struct RNode *ruby_debug_print_node(int level, int debug_level, const char *header, const struct RNode *node); -void ruby_debug_print_n(const struct RNode *node); -int ruby_debug_print_indent(int level, int debug_level, int indent_level); -void ruby_debug_gc_check_func(void); -void ruby_set_debug_option(const char *str); - -RUBY_SYMBOL_EXPORT_END - -#ifndef USE_RUBY_DEBUG_LOG -#define USE_RUBY_DEBUG_LOG 0 -#endif - -/* RUBY_DEBUG_LOG: Logging debug information mechanism - * - * This feature provides a mechanism to store logging information - * to a file, stderr or memory space with simple macros. - * - * The following information will be stored. - * * (1) __FILE__, __LINE__ in C - * * (2) __FILE__, __LINE__ in Ruby - * * (3) __func__ in C (message title) - * * (4) given string with sprintf format - * * (5) Thread number (if multiple threads are running) - * - * This feature is enabled only USE_RUBY_DEBUG_LOG is enabled. - * Release version should not enable it. - * - * Running with the `RUBY_DEBUG_LOG` environment variable enables - * this feature. - * - * # logging into a file - * RUBY_DEBUG_LOG=/path/to/file STDERR - * - * # logging into STDERR - * RUBY_DEBUG_LOG=stderr - * - * # logging into memory space (check with a debugger) - * # It will help if the timing is important. - * RUBY_DEBUG_LOG=mem - * - * RUBY_DEBUG_LOG_FILTER environment variable can specify the filter string. - * If "(3) __func__ in C (message title)" contains the specified string, the - * information will be stored (example: RUBY_DEBUG_LOG_FILTER=str will enable - * only on str related information). - * - * In a MRI source code, you can use the following macros: - * * RUBY_DEBUG_LOG(fmt, ...): Above (1) to (4) will be logged. - * * RUBY_DEBUG_LOG2(file, line, fmt, ...): - * Same as RUBY_DEBUG_LOG(), but (1) will be replaced with given file, line. - */ - -extern enum ruby_debug_log_mode { - ruby_debug_log_disabled = 0x00, - ruby_debug_log_memory = 0x01, - ruby_debug_log_stderr = 0x02, - ruby_debug_log_file = 0x04, -} ruby_debug_log_mode; - -RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5) -void ruby_debug_log(const char *file, int line, const char *func_name, const char *fmt, ...); -void ruby_debug_log_print(unsigned int n); -bool ruby_debug_log_filter(const char *func_name, const char *file_name); - -#if RBIMPL_COMPILER_IS(GCC) && defined(__OPTIMIZE__) -# define ruby_debug_log(...) \ - RB_GNUC_EXTENSION_BLOCK( \ - RBIMPL_WARNING_PUSH(); \ - RBIMPL_WARNING_IGNORED(-Wformat-zero-length); \ - ruby_debug_log(__VA_ARGS__); \ - RBIMPL_WARNING_POP()) -#endif - -// convenient macro to log even if the USE_RUBY_DEBUG_LOG macro is not specified. -// You can use this macro for temporary usage (you should not commit it). -#define _RUBY_DEBUG_LOG(...) ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__) - -#if USE_RUBY_DEBUG_LOG -# define RUBY_DEBUG_LOG_ENABLED(func_name, file_name) \ - (ruby_debug_log_mode && ruby_debug_log_filter(func_name, file_name)) - -#define RUBY_DEBUG_LOG(...) do { \ - if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, __FILE__)) \ - ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \ -} while (0) - -#define RUBY_DEBUG_LOG2(file, line, ...) do { \ - if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, file)) \ - ruby_debug_log(file, line, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \ -} while (0) - -#else // USE_RUBY_DEBUG_LOG -// do nothing -#define RUBY_DEBUG_LOG(...) -#define RUBY_DEBUG_LOG2(file, line, ...) -#endif // USE_RUBY_DEBUG_LOG - -#endif /* RUBY_DEBUG_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h deleted file mode 100644 index c3b7d4e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h +++ /dev/null @@ -1,199 +0,0 @@ -#ifndef RUBY_VM_EXEC_H -#define RUBY_VM_EXEC_H -/********************************************************************** - - vm.h - - - $Author$ - created at: 04/01/01 16:56:59 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -typedef long OFFSET; -typedef unsigned long lindex_t; -typedef VALUE GENTRY; -typedef rb_iseq_t *ISEQ; - -#if VMDEBUG > 0 -#define debugs printf -#define DEBUG_ENTER_INSN(insn) \ - rb_vmdebug_debug_print_pre(ec, GET_CFP(), GET_PC()); - -#define SC_REGS() - -#define DEBUG_END_INSN() \ - rb_vmdebug_debug_print_post(ec, GET_CFP() SC_REGS()); - -#else - -#define debugs -#define DEBUG_ENTER_INSN(insn) -#define DEBUG_END_INSN() -#endif - -#define throwdebug if(0)ruby_debug_printf -/* #define throwdebug ruby_debug_printf */ - -/************************************************/ -#if defined(DISPATCH_XXX) -error ! -/************************************************/ -#elif OPT_CALL_THREADED_CODE - -#define LABEL(x) insn_func_##x -#define ELABEL(x) -#define LABEL_PTR(x) &LABEL(x) - -#define INSN_ENTRY(insn) \ - static rb_control_frame_t * \ - FUNC_FASTCALL(LABEL(insn))(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp) { - -#define END_INSN(insn) return reg_cfp;} - -#define NEXT_INSN() return reg_cfp; - -#define START_OF_ORIGINAL_INSN(x) /* ignore */ -#define DISPATCH_ORIGINAL_INSN(x) return LABEL(x)(ec, reg_cfp); - -/************************************************/ -#elif OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE -/* threaded code with gcc */ - -#define LABEL(x) INSN_LABEL_##x -#define ELABEL(x) INSN_ELABEL_##x -#define LABEL_PTR(x) RB_GNUC_EXTENSION(&&LABEL(x)) - -#define INSN_ENTRY_SIG(insn) \ - if (0) { \ - ruby_debug_printf("exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \ - (reg_pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded), \ - (reg_cfp->pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded), \ - RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \ - rb_iseq_line_no(reg_cfp->iseq, reg_pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded)); \ - } - -#define INSN_DISPATCH_SIG(insn) - -#define INSN_ENTRY(insn) \ - LABEL(insn): \ - INSN_ENTRY_SIG(insn); \ - -/**********************************/ -#if OPT_DIRECT_THREADED_CODE - -/* for GCC 3.4.x */ -#define TC_DISPATCH(insn) \ - INSN_DISPATCH_SIG(insn); \ - RB_GNUC_EXTENSION_BLOCK(goto *(void const *)GET_CURRENT_INSN()); \ - ; - -#else -/* token threaded code */ - -/* dispatcher */ -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3 -#define DISPATCH_ARCH_DEPEND_WAY(addr) \ - __asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr)) - -#else -#define DISPATCH_ARCH_DEPEND_WAY(addr) \ - /* do nothing */ -#endif -#define TC_DISPATCH(insn) \ - DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \ - INSN_DISPATCH_SIG(insn); \ - RB_GNUC_EXTENSION_BLOCK(goto *insns_address_table[GET_CURRENT_INSN()]); \ - rb_bug("tc error"); - -#endif /* OPT_DIRECT_THREADED_CODE */ - -#define END_INSN(insn) \ - DEBUG_END_INSN(); \ - TC_DISPATCH(insn); - -#define INSN_DISPATCH() \ - TC_DISPATCH(__START__) \ - { - -#define END_INSNS_DISPATCH() \ - rb_bug("unknown insn: %"PRIdVALUE, GET_CURRENT_INSN()); \ - } /* end of while loop */ \ - -#define NEXT_INSN() TC_DISPATCH(__NEXT_INSN__) - -/************************************************/ -#else /* no threaded code */ -/* most common method */ - -#define INSN_ENTRY(insn) \ -case BIN(insn): - -#define END_INSN(insn) \ - DEBUG_END_INSN(); \ - break; - -#define INSN_DISPATCH() \ - while (1) { \ - switch (GET_CURRENT_INSN()) { - -#define END_INSNS_DISPATCH() \ -default: \ - SDR(); \ - rb_bug("unknown insn: %ld", GET_CURRENT_INSN()); \ - } /* end of switch */ \ - } /* end of while loop */ \ - -#define NEXT_INSN() goto first - -#endif - -#ifndef START_OF_ORIGINAL_INSN -#define START_OF_ORIGINAL_INSN(x) if (0) goto start_of_##x; start_of_##x: -#define DISPATCH_ORIGINAL_INSN(x) goto start_of_##x; -#endif - -#define VM_SP_CNT(ec, sp) ((sp) - (ec)->vm_stack) - -#if OPT_CALL_THREADED_CODE -#define THROW_EXCEPTION(exc) do { \ - ec->errinfo = (VALUE)(exc); \ - return 0; \ -} while (0) -#else -#define THROW_EXCEPTION(exc) return (VALUE)(exc) -#endif - -// Run the interpreter from the JIT -#define VM_EXEC(ec, val) do { \ - if (UNDEF_P(val)) { \ - VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH); \ - val = vm_exec(ec); \ - } \ -} while (0) - -// Run the JIT from the interpreter -#define JIT_EXEC(ec, val) do { \ - rb_jit_func_t func; \ - /* don't run tailcalls since that breaks FINISH */ \ - if (UNDEF_P(val) && GET_CFP() != ec->cfp && (func = jit_compile(ec))) { \ - val = func(ec, ec->cfp); \ - if (ec->tag->state) THROW_EXCEPTION(val); \ - } \ -} while (0) - -#define SCREG(r) (reg_##r) - -#define VM_DEBUG_STACKOVERFLOW 0 - -#if VM_DEBUG_STACKOVERFLOW -#define CHECK_VM_STACK_OVERFLOW_FOR_INSN CHECK_VM_STACK_OVERFLOW -#else -#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin) -#endif - -#define INSN_LABEL2(insn, name) INSN_LABEL_ ## insn ## _ ## name -#define INSN_LABEL(x) INSN_LABEL2(NAME_OF_CURRENT_INSN, x) - -#endif /* RUBY_VM_EXEC_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_insnhelper.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_insnhelper.h deleted file mode 100644 index 3b0958d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_insnhelper.h +++ /dev/null @@ -1,277 +0,0 @@ -#ifndef RUBY_INSNHELPER_H -#define RUBY_INSNHELPER_H -/********************************************************************** - - insnhelper.h - helper macros to implement each instructions - - $Author$ - created at: 04/01/01 15:50:34 JST - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -RUBY_EXTERN VALUE ruby_vm_const_missing_count; -RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_invalidations; -RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_misses; -RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state; - -#if USE_YJIT || USE_RJIT // We want vm_insns_count on any JIT-enabled build. -// Increment vm_insns_count for --yjit-stats. We increment this even when -// --yjit or --yjit-stats is not used because branching to skip it is slower. -// We also don't use ATOMIC_INC for performance, allowing inaccuracy on Ractors. -#define JIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++ -#else -#define JIT_COLLECT_USAGE_INSN(insn) // none -#endif - -#if VM_COLLECT_USAGE_DETAILS -#define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) vm_collect_usage_operand((insn), (n), ((VALUE)(op))) -#define COLLECT_USAGE_REGISTER(reg, s) vm_collect_usage_register((reg), (s)) -#else -#define COLLECT_USAGE_INSN(insn) JIT_COLLECT_USAGE_INSN(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) // none -#define COLLECT_USAGE_REGISTER(reg, s) // none -#endif - -/**********************************************************/ -/* deal with stack */ -/**********************************************************/ - -#define PUSH(x) (SET_SV(x), INC_SP(1)) -#define TOPN(n) (*(GET_SP()-(n)-1)) -#define POPN(n) (DEC_SP(n)) -#define POP() (DEC_SP(1)) -#define STACK_ADDR_FROM_TOP(n) (GET_SP()-(n)) - -/**********************************************************/ -/* deal with registers */ -/**********************************************************/ - -#define VM_REG_CFP (reg_cfp) -#define VM_REG_PC (VM_REG_CFP->pc) -#define VM_REG_SP (VM_REG_CFP->sp) -#define VM_REG_EP (VM_REG_CFP->ep) - -#define RESTORE_REGS() do { \ - VM_REG_CFP = ec->cfp; \ -} while (0) - -typedef enum call_type { - CALL_PUBLIC, - CALL_FCALL, - CALL_VCALL, - CALL_PUBLIC_KW, - CALL_FCALL_KW -} call_type; - -struct rb_forwarding_call_data { - struct rb_call_data cd; - CALL_INFO caller_ci; -}; - -#if VM_COLLECT_USAGE_DETAILS -enum vm_regan_regtype { - VM_REGAN_PC = 0, - VM_REGAN_SP = 1, - VM_REGAN_EP = 2, - VM_REGAN_CFP = 3, - VM_REGAN_SELF = 4, - VM_REGAN_ISEQ = 5 -}; -enum vm_regan_acttype { - VM_REGAN_ACT_GET = 0, - VM_REGAN_ACT_SET = 1 -}; - -#define COLLECT_USAGE_REGISTER_HELPER(a, b, v) \ - (COLLECT_USAGE_REGISTER((VM_REGAN_##a), (VM_REGAN_ACT_##b)), (v)) -#else -#define COLLECT_USAGE_REGISTER_HELPER(a, b, v) (v) -#endif - -/* PC */ -#define GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, VM_REG_PC)) -#define SET_PC(x) (VM_REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x)))) -#define GET_CURRENT_INSN() (*GET_PC()) -#define GET_OPERAND(n) (GET_PC()[(n)]) -#define ADD_PC(n) (SET_PC(VM_REG_PC + (n))) -#define JUMP(dst) (SET_PC(VM_REG_PC + (dst))) - -/* frame pointer, environment pointer */ -#define GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, VM_REG_CFP)) -#define GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, VM_REG_EP)) -#define SET_EP(x) (VM_REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x)))) -#define GET_LEP() (VM_EP_LEP(GET_EP())) - -/* SP */ -#define GET_SP() (COLLECT_USAGE_REGISTER_HELPER(SP, GET, VM_REG_SP)) -#define SET_SP(x) (VM_REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) -#define INC_SP(x) (VM_REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) -#define DEC_SP(x) (VM_REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) -#define SET_SV(x) (*GET_SP() = rb_ractor_confirm_belonging(x)) - /* set current stack value as x */ - -/* instruction sequence C struct */ -#define GET_ISEQ() (GET_CFP()->iseq) - -/**********************************************************/ -/* deal with variables */ -/**********************************************************/ - -#define GET_PREV_EP(ep) ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03)) - -/**********************************************************/ -/* deal with values */ -/**********************************************************/ - -#define GET_SELF() (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self)) - -/**********************************************************/ -/* deal with control flow 2: method/iterator */ -/**********************************************************/ - -/* set fastpath when cached method is *NOT* protected - * because inline method cache does not care about receiver. - */ - -static inline void -CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enabled) -{ - if (LIKELY(enabled)) { - vm_cc_call_set(cc, func); - } -} - -#define GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL]) - -/**********************************************************/ -/* deal with control flow 3: exception */ -/**********************************************************/ - - -/**********************************************************/ -/* deal with stack canary */ -/**********************************************************/ - -#if VM_CHECK_MODE > 0 -#define SETUP_CANARY(cond) \ - VALUE *canary = 0; \ - if (cond) { \ - canary = GET_SP(); \ - SET_SV(vm_stack_canary); \ - } \ - else {\ - SET_SV(Qfalse); /* cleanup */ \ - } -#define CHECK_CANARY(cond, insn) \ - if (cond) { \ - if (*canary == vm_stack_canary) { \ - *canary = Qfalse; /* cleanup */ \ - } \ - else { \ - rb_vm_canary_is_found_dead(insn, *canary); \ - } \ - } -#else -#define SETUP_CANARY(cond) if (cond) {} else {} -#define CHECK_CANARY(cond, insn) if (cond) {(void)(insn);} -#endif - -/**********************************************************/ -/* others */ -/**********************************************************/ - -#define CALL_SIMPLE_METHOD() do { \ - rb_snum_t insn_width = attr_width_opt_send_without_block(0); \ - ADD_PC(-insn_width); \ - DISPATCH_ORIGINAL_INSN(opt_send_without_block); \ -} while (0) - -#define GET_GLOBAL_CVAR_STATE() (ruby_vm_global_cvar_state) -#define INC_GLOBAL_CVAR_STATE() (++ruby_vm_global_cvar_state) - -static inline struct vm_throw_data * -THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, int st) -{ - struct vm_throw_data *obj = IMEMO_NEW(struct vm_throw_data, imemo_throw_data, 0); - *((VALUE *)&obj->throw_obj) = val; - *((struct rb_control_frame_struct **)&obj->catch_frame) = (struct rb_control_frame_struct *)cf; - obj->throw_state = st; - - return obj; -} - -static inline VALUE -THROW_DATA_VAL(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->throw_obj; -} - -static inline const rb_control_frame_t * -THROW_DATA_CATCH_FRAME(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->catch_frame; -} - -static inline int -THROW_DATA_STATE(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->throw_state; -} - -static inline int -THROW_DATA_CONSUMED_P(const struct vm_throw_data *obj) -{ - VM_ASSERT(THROW_DATA_P(obj)); - return obj->flags & THROW_DATA_CONSUMED; -} - -static inline void -THROW_DATA_CATCH_FRAME_SET(struct vm_throw_data *obj, const rb_control_frame_t *cfp) -{ - VM_ASSERT(THROW_DATA_P(obj)); - obj->catch_frame = cfp; -} - -static inline void -THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st) -{ - VM_ASSERT(THROW_DATA_P(obj)); - obj->throw_state = st; -} - -static inline void -THROW_DATA_CONSUMED_SET(struct vm_throw_data *obj) -{ - if (THROW_DATA_P(obj) && - THROW_DATA_STATE(obj) == TAG_BREAK) { - obj->flags |= THROW_DATA_CONSUMED; - } -} - -#define IS_ARGS_SPLAT(ci) (vm_ci_flag(ci) & VM_CALL_ARGS_SPLAT) -#define IS_ARGS_KEYWORD(ci) (vm_ci_flag(ci) & VM_CALL_KWARG) -#define IS_ARGS_KW_SPLAT(ci) (vm_ci_flag(ci) & VM_CALL_KW_SPLAT) -#define IS_ARGS_KW_OR_KW_SPLAT(ci) (vm_ci_flag(ci) & (VM_CALL_KWARG | VM_CALL_KW_SPLAT)) -#define IS_ARGS_KW_SPLAT_MUT(ci) (vm_ci_flag(ci) & VM_CALL_KW_SPLAT_MUT) - -static inline bool -vm_call_cacheable(const struct rb_callinfo *ci, const struct rb_callcache *cc) -{ - return !(vm_ci_flag(ci) & VM_CALL_FORWARDING) && ((vm_ci_flag(ci) & VM_CALL_FCALL) || - METHOD_ENTRY_VISI(vm_cc_cme(cc)) != METHOD_VISI_PROTECTED); -} -/* If this returns true, an optimized function returned by `vm_call_iseq_setup_func` - can be used as a fastpath. */ -static inline bool -vm_call_iseq_optimizable_p(const struct rb_callinfo *ci, const struct rb_callcache *cc) -{ - return !IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && vm_call_cacheable(ci, cc); -} - -#endif /* RUBY_INSNHELPER_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h deleted file mode 100644 index ce47745..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef RUBY_VM_OPTS_H/*-*-c-*-*/ -#define RUBY_VM_OPTS_H -/********************************************************************** - - vm_opts.h - VM optimize option - - $Author$ - - Copyright (C) 2004-2007 Koichi Sasada - -**********************************************************************/ - -/* Compile options. - * You can change these options at runtime by VM::CompileOption. - * Following definitions are default values. - */ - -#define OPT_TAILCALL_OPTIMIZATION 0 -#define OPT_PEEPHOLE_OPTIMIZATION 1 -#define OPT_SPECIALISED_INSTRUCTION 1 -#define OPT_INLINE_CONST_CACHE 1 -#define OPT_FROZEN_STRING_LITERAL -1 -#define OPT_DEBUG_FROZEN_STRING_LITERAL 0 - -/* Build Options. - * You can't change these options at runtime. - */ - -/* C compiler dependent */ - -/* - * 0: direct (using labeled goto using GCC special) - * 1: token (switch/case) - * 2: call (function call for each insn dispatch) - */ -#ifndef OPT_THREADED_CODE -#define OPT_THREADED_CODE 0 -#endif - -#define OPT_DIRECT_THREADED_CODE (OPT_THREADED_CODE == 0) -#define OPT_TOKEN_THREADED_CODE (OPT_THREADED_CODE == 1) -#define OPT_CALL_THREADED_CODE (OPT_THREADED_CODE == 2) - -/* VM running option */ -#define OPT_CHECKED_RUN 1 -#define OPT_INLINE_METHOD_CACHE 1 -#define OPT_GLOBAL_METHOD_CACHE 1 - -#ifndef OPT_IC_FOR_IVAR -#define OPT_IC_FOR_IVAR 1 -#endif - -/* architecture independent, affects generated code */ -#define OPT_OPERANDS_UNIFICATION 1 -#define OPT_INSTRUCTIONS_UNIFICATION 0 -#define OPT_UNIFY_ALL_COMBINATION 0 - -/* misc */ -#ifndef OPT_SUPPORT_JOKE -#define OPT_SUPPORT_JOKE 0 -#endif - -#ifndef VM_COLLECT_USAGE_DETAILS -#define VM_COLLECT_USAGE_DETAILS 0 -#endif - -#endif /* RUBY_VM_OPTS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_sync.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_sync.h deleted file mode 100644 index 4d83b5e..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_sync.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef RUBY_VM_SYNC_H -#define RUBY_VM_SYNC_H - -#include "vm_debug.h" -#include "debug_counter.h" - -#if USE_RUBY_DEBUG_LOG -#define LOCATION_ARGS const char *file, int line -#define LOCATION_PARAMS file, line -#define APPEND_LOCATION_ARGS , const char *file, int line -#define APPEND_LOCATION_PARAMS , file, line -#else -#define LOCATION_ARGS void -#define LOCATION_PARAMS -#define APPEND_LOCATION_ARGS -#define APPEND_LOCATION_PARAMS -#endif - -bool rb_vm_locked_p(void); -void rb_vm_lock_body(LOCATION_ARGS); -void rb_vm_unlock_body(LOCATION_ARGS); - -struct rb_ractor_struct; -void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS); -void rb_vm_barrier(void); - -#if RUBY_DEBUG -// GET_VM() -#include "vm_core.h" -#endif - -RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c - -static inline bool -rb_multi_ractor_p(void) -{ - if (LIKELY(ruby_single_main_ractor)) { - // 0 on boot time. - RUBY_ASSERT(GET_VM()->ractor.cnt <= 1); - return false; - } - else { - // multi-ractor mode can run ractor.cnt == 1 - return true; - } -} - -static inline void -rb_vm_lock(const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock); - - if (rb_multi_ractor_p()) { - rb_vm_lock_body(LOCATION_PARAMS); - } -} - -static inline void -rb_vm_unlock(const char *file, int line) -{ - if (rb_multi_ractor_p()) { - rb_vm_unlock_body(LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_enter(unsigned int *lev, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock_enter); - - if (rb_multi_ractor_p()) { - rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb); - - if (rb_multi_ractor_p()) { - rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_leave(unsigned int *lev, const char *file, int line) -{ - if (rb_multi_ractor_p()) { - rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS); - } -} - -static inline void -rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line) -{ - RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr); - rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS); -} - -static inline void -rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line) -{ - rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS); -} - -#define RB_VM_LOCKED_P() rb_vm_locked_p() - -#define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__) -#define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__) - -#define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__) -#define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__) -#define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__) -#define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__) - -#define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev); -#define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); } - -#define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__) -#define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev); -#define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV(&_lev); } - -#if RUBY_DEBUG > 0 -void RUBY_ASSERT_vm_locking(void); -void RUBY_ASSERT_vm_unlocking(void); -#define ASSERT_vm_locking() RUBY_ASSERT_vm_locking() -#define ASSERT_vm_unlocking() RUBY_ASSERT_vm_unlocking() -#else -#define ASSERT_vm_locking() -#define ASSERT_vm_unlocking() -#endif - -#endif // RUBY_VM_SYNC_H diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vmtc.inc b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vmtc.inc deleted file mode 100644 index eb8bfdb..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vmtc.inc +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/vmtc.inc.erb" - or tool/insns2vm.rb - */ - -static const void *const insns_address_table[] = { - LABEL_PTR(nop), - LABEL_PTR(getlocal), - LABEL_PTR(setlocal), - LABEL_PTR(getblockparam), - LABEL_PTR(setblockparam), - LABEL_PTR(getblockparamproxy), - LABEL_PTR(getspecial), - LABEL_PTR(setspecial), - LABEL_PTR(getinstancevariable), - LABEL_PTR(setinstancevariable), - LABEL_PTR(getclassvariable), - LABEL_PTR(setclassvariable), - LABEL_PTR(opt_getconstant_path), - LABEL_PTR(getconstant), - LABEL_PTR(setconstant), - LABEL_PTR(getglobal), - LABEL_PTR(setglobal), - LABEL_PTR(putnil), - LABEL_PTR(putself), - LABEL_PTR(putobject), - LABEL_PTR(putspecialobject), - LABEL_PTR(putstring), - LABEL_PTR(putchilledstring), - LABEL_PTR(concatstrings), - LABEL_PTR(anytostring), - LABEL_PTR(toregexp), - LABEL_PTR(intern), - LABEL_PTR(newarray), - LABEL_PTR(pushtoarraykwsplat), - LABEL_PTR(duparray), - LABEL_PTR(duphash), - LABEL_PTR(expandarray), - LABEL_PTR(concatarray), - LABEL_PTR(concattoarray), - LABEL_PTR(pushtoarray), - LABEL_PTR(splatarray), - LABEL_PTR(splatkw), - LABEL_PTR(newhash), - LABEL_PTR(newrange), - LABEL_PTR(pop), - LABEL_PTR(dup), - LABEL_PTR(dupn), - LABEL_PTR(swap), - LABEL_PTR(opt_reverse), - LABEL_PTR(topn), - LABEL_PTR(setn), - LABEL_PTR(adjuststack), - LABEL_PTR(defined), - LABEL_PTR(definedivar), - LABEL_PTR(checkmatch), - LABEL_PTR(checkkeyword), - LABEL_PTR(checktype), - LABEL_PTR(defineclass), - LABEL_PTR(definemethod), - LABEL_PTR(definesmethod), - LABEL_PTR(send), - LABEL_PTR(sendforward), - LABEL_PTR(opt_send_without_block), - LABEL_PTR(objtostring), - LABEL_PTR(opt_ary_freeze), - LABEL_PTR(opt_hash_freeze), - LABEL_PTR(opt_str_freeze), - LABEL_PTR(opt_nil_p), - LABEL_PTR(opt_str_uminus), - LABEL_PTR(opt_newarray_send), - LABEL_PTR(invokesuper), - LABEL_PTR(invokesuperforward), - LABEL_PTR(invokeblock), - LABEL_PTR(leave), - LABEL_PTR(throw), - LABEL_PTR(jump), - LABEL_PTR(branchif), - LABEL_PTR(branchunless), - LABEL_PTR(branchnil), - LABEL_PTR(once), - LABEL_PTR(opt_case_dispatch), - LABEL_PTR(opt_plus), - LABEL_PTR(opt_minus), - LABEL_PTR(opt_mult), - LABEL_PTR(opt_div), - LABEL_PTR(opt_mod), - LABEL_PTR(opt_eq), - LABEL_PTR(opt_neq), - LABEL_PTR(opt_lt), - LABEL_PTR(opt_le), - LABEL_PTR(opt_gt), - LABEL_PTR(opt_ge), - LABEL_PTR(opt_ltlt), - LABEL_PTR(opt_and), - LABEL_PTR(opt_or), - LABEL_PTR(opt_aref), - LABEL_PTR(opt_aset), - LABEL_PTR(opt_aset_with), - LABEL_PTR(opt_aref_with), - LABEL_PTR(opt_length), - LABEL_PTR(opt_size), - LABEL_PTR(opt_empty_p), - LABEL_PTR(opt_succ), - LABEL_PTR(opt_not), - LABEL_PTR(opt_regexpmatch2), - LABEL_PTR(invokebuiltin), - LABEL_PTR(opt_invokebuiltin_delegate), - LABEL_PTR(opt_invokebuiltin_delegate_leave), - LABEL_PTR(getlocal_WC_0), - LABEL_PTR(getlocal_WC_1), - LABEL_PTR(setlocal_WC_0), - LABEL_PTR(setlocal_WC_1), - LABEL_PTR(putobject_INT2FIX_0_), - LABEL_PTR(putobject_INT2FIX_1_), - LABEL_PTR(trace_nop), - LABEL_PTR(trace_getlocal), - LABEL_PTR(trace_setlocal), - LABEL_PTR(trace_getblockparam), - LABEL_PTR(trace_setblockparam), - LABEL_PTR(trace_getblockparamproxy), - LABEL_PTR(trace_getspecial), - LABEL_PTR(trace_setspecial), - LABEL_PTR(trace_getinstancevariable), - LABEL_PTR(trace_setinstancevariable), - LABEL_PTR(trace_getclassvariable), - LABEL_PTR(trace_setclassvariable), - LABEL_PTR(trace_opt_getconstant_path), - LABEL_PTR(trace_getconstant), - LABEL_PTR(trace_setconstant), - LABEL_PTR(trace_getglobal), - LABEL_PTR(trace_setglobal), - LABEL_PTR(trace_putnil), - LABEL_PTR(trace_putself), - LABEL_PTR(trace_putobject), - LABEL_PTR(trace_putspecialobject), - LABEL_PTR(trace_putstring), - LABEL_PTR(trace_putchilledstring), - LABEL_PTR(trace_concatstrings), - LABEL_PTR(trace_anytostring), - LABEL_PTR(trace_toregexp), - LABEL_PTR(trace_intern), - LABEL_PTR(trace_newarray), - LABEL_PTR(trace_pushtoarraykwsplat), - LABEL_PTR(trace_duparray), - LABEL_PTR(trace_duphash), - LABEL_PTR(trace_expandarray), - LABEL_PTR(trace_concatarray), - LABEL_PTR(trace_concattoarray), - LABEL_PTR(trace_pushtoarray), - LABEL_PTR(trace_splatarray), - LABEL_PTR(trace_splatkw), - LABEL_PTR(trace_newhash), - LABEL_PTR(trace_newrange), - LABEL_PTR(trace_pop), - LABEL_PTR(trace_dup), - LABEL_PTR(trace_dupn), - LABEL_PTR(trace_swap), - LABEL_PTR(trace_opt_reverse), - LABEL_PTR(trace_topn), - LABEL_PTR(trace_setn), - LABEL_PTR(trace_adjuststack), - LABEL_PTR(trace_defined), - LABEL_PTR(trace_definedivar), - LABEL_PTR(trace_checkmatch), - LABEL_PTR(trace_checkkeyword), - LABEL_PTR(trace_checktype), - LABEL_PTR(trace_defineclass), - LABEL_PTR(trace_definemethod), - LABEL_PTR(trace_definesmethod), - LABEL_PTR(trace_send), - LABEL_PTR(trace_sendforward), - LABEL_PTR(trace_opt_send_without_block), - LABEL_PTR(trace_objtostring), - LABEL_PTR(trace_opt_ary_freeze), - LABEL_PTR(trace_opt_hash_freeze), - LABEL_PTR(trace_opt_str_freeze), - LABEL_PTR(trace_opt_nil_p), - LABEL_PTR(trace_opt_str_uminus), - LABEL_PTR(trace_opt_newarray_send), - LABEL_PTR(trace_invokesuper), - LABEL_PTR(trace_invokesuperforward), - LABEL_PTR(trace_invokeblock), - LABEL_PTR(trace_leave), - LABEL_PTR(trace_throw), - LABEL_PTR(trace_jump), - LABEL_PTR(trace_branchif), - LABEL_PTR(trace_branchunless), - LABEL_PTR(trace_branchnil), - LABEL_PTR(trace_once), - LABEL_PTR(trace_opt_case_dispatch), - LABEL_PTR(trace_opt_plus), - LABEL_PTR(trace_opt_minus), - LABEL_PTR(trace_opt_mult), - LABEL_PTR(trace_opt_div), - LABEL_PTR(trace_opt_mod), - LABEL_PTR(trace_opt_eq), - LABEL_PTR(trace_opt_neq), - LABEL_PTR(trace_opt_lt), - LABEL_PTR(trace_opt_le), - LABEL_PTR(trace_opt_gt), - LABEL_PTR(trace_opt_ge), - LABEL_PTR(trace_opt_ltlt), - LABEL_PTR(trace_opt_and), - LABEL_PTR(trace_opt_or), - LABEL_PTR(trace_opt_aref), - LABEL_PTR(trace_opt_aset), - LABEL_PTR(trace_opt_aset_with), - LABEL_PTR(trace_opt_aref_with), - LABEL_PTR(trace_opt_length), - LABEL_PTR(trace_opt_size), - LABEL_PTR(trace_opt_empty_p), - LABEL_PTR(trace_opt_succ), - LABEL_PTR(trace_opt_not), - LABEL_PTR(trace_opt_regexpmatch2), - LABEL_PTR(trace_invokebuiltin), - LABEL_PTR(trace_opt_invokebuiltin_delegate), - LABEL_PTR(trace_opt_invokebuiltin_delegate_leave), - LABEL_PTR(trace_getlocal_WC_0), - LABEL_PTR(trace_getlocal_WC_1), - LABEL_PTR(trace_setlocal_WC_0), - LABEL_PTR(trace_setlocal_WC_1), - LABEL_PTR(trace_putobject_INT2FIX_0_), - LABEL_PTR(trace_putobject_INT2FIX_1_), -}; - -ASSERT_VM_INSTRUCTION_SIZE(insns_address_table); diff --git a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/yjit.h b/lib/debase/ruby_core_source/ruby-3.4.0-preview2/yjit.h deleted file mode 100644 index 5d1de2d..0000000 --- a/lib/debase/ruby_core_source/ruby-3.4.0-preview2/yjit.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef YJIT_H -#define YJIT_H 1 -// -// This file contains definitions YJIT exposes to the CRuby codebase -// - -#include "ruby/internal/config.h" -#include "ruby_assert.h" // for RUBY_DEBUG -#include "vm_core.h" -#include "method.h" - -// YJIT_STATS controls whether to support runtime counters in generated code -// and in the interpreter. -#ifndef YJIT_STATS -# define YJIT_STATS RUBY_DEBUG -#endif - -#if USE_YJIT - -// We generate x86 or arm64 assembly -#if defined(_WIN32) ? defined(_M_AMD64) : (defined(__x86_64__) || defined(__aarch64__)) -// x86_64 platforms without mingw/msys or x64-mswin -#else -# error YJIT unsupported platform -#endif - -// Expose these as declarations since we are building YJIT. -extern uint64_t rb_yjit_call_threshold; -extern uint64_t rb_yjit_cold_threshold; -extern uint64_t rb_yjit_live_iseq_count; -extern uint64_t rb_yjit_iseq_alloc_count; -extern bool rb_yjit_enabled_p; -void rb_yjit_incr_counter(const char *counter_name); -void rb_yjit_invalidate_all_method_lookup_assumptions(void); -void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme); -void rb_yjit_collect_binding_alloc(void); -void rb_yjit_collect_binding_set(void); -void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception); -void rb_yjit_init(bool yjit_enabled); -void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -void rb_yjit_constant_state_changed(ID id); -void rb_yjit_iseq_mark(void *payload); -void rb_yjit_iseq_update_references(const rb_iseq_t *iseq); -void rb_yjit_iseq_free(const rb_iseq_t *iseq); -void rb_yjit_before_ractor_spawn(void); -void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); -void rb_yjit_tracing_invalidate_all(void); -void rb_yjit_show_usage(int help, int highlight, unsigned int width, int columns); -void rb_yjit_lazy_push_frame(const VALUE *pc); -void rb_yjit_invalidate_no_singleton_class(VALUE klass); -void rb_yjit_invalidate_ep_is_bp(const rb_iseq_t *iseq); - -#else -// !USE_YJIT -// In these builds, YJIT could never be turned on. Provide dummy implementations. - -#define rb_yjit_enabled_p false -static inline void rb_yjit_incr_counter(const char *counter_name) {} -static inline void rb_yjit_invalidate_all_method_lookup_assumptions(void) {} -static inline void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme) {} -static inline void rb_yjit_collect_binding_alloc(void) {} -static inline void rb_yjit_collect_binding_set(void) {} -static inline void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception) {} -static inline void rb_yjit_init(bool yjit_enabled) {} -static inline void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} -static inline void rb_yjit_constant_state_changed(ID id) {} -static inline void rb_yjit_iseq_mark(void *payload) {} -static inline void rb_yjit_iseq_update_references(const rb_iseq_t *iseq) {} -static inline void rb_yjit_iseq_free(const rb_iseq_t *iseq) {} -static inline void rb_yjit_before_ractor_spawn(void) {} -static inline void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {} -static inline void rb_yjit_tracing_invalidate_all(void) {} -static inline void rb_yjit_lazy_push_frame(const VALUE *pc) {} -static inline void rb_yjit_invalidate_no_singleton_class(VALUE klass) {} -static inline void rb_yjit_invalidate_ep_is_bp(const rb_iseq_t *iseq) {} - -#endif // #if USE_YJIT - -#endif // #ifndef YJIT_H