summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml (renamed from appveyor.yml)3
-rw-r--r--.cirrus.yml63
-rw-r--r--.document1
-rw-r--r--.github/codeql/codeql-config.yml3
-rw-r--r--.github/workflows/baseruby.yml3
-rw-r--r--.github/workflows/bundled_gems.yml66
-rw-r--r--.github/workflows/check_dependencies.yml8
-rw-r--r--.github/workflows/codeql-analysis.yml9
-rw-r--r--.github/workflows/compilers.yml75
-rw-r--r--.github/workflows/macos.yml11
-rw-r--r--.github/workflows/mingw.yml24
-rw-r--r--.github/workflows/mjit.yml2
-rw-r--r--.github/workflows/spec_guards.yml2
-rw-r--r--.github/workflows/ubuntu.yml8
-rw-r--r--.github/workflows/windows.yml60
-rw-r--r--.travis.yml28
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--LEGAL34
-rw-r--r--NEWS.md92
-rw-r--r--README.md3
-rw-r--r--addr2line.c198
-rw-r--r--array.c115
-rw-r--r--array.rb2
-rw-r--r--ast.c39
-rw-r--r--ast.rb12
-rw-r--r--benchmark/attr_accessor.yml29
-rw-r--r--benchmark/hash_aref_array.rb5
-rw-r--r--benchmark/time_new.yml4
-rw-r--r--benchmark/time_parse.yml8
-rw-r--r--bignum.c73
-rw-r--r--bootstraptest/test_ractor.rb37
-rw-r--r--class.c297
-rw-r--r--common.mk496
-rw-r--r--compar.c15
-rw-r--r--compile.c2418
-rw-r--r--complex.c66
-rw-r--r--configure.ac101
-rw-r--r--cont.c186
-rw-r--r--cygwin/GNUmakefile.in3
-rw-r--r--debug.c3
-rw-r--r--defs/gmake.mk29
-rw-r--r--defs/id.def1
-rw-r--r--dir.c6
-rw-r--r--dir.rb12
-rw-r--r--dln.c1
-rw-r--r--doc/NEWS-3.0.0.md2
-rw-r--r--doc/bsearch.rdoc120
-rw-r--r--doc/contributing.rdoc28
-rw-r--r--doc/extension.ja.rdoc36
-rw-r--r--doc/extension.rdoc30
-rw-r--r--doc/irb/irb.rd.ja11
-rw-r--r--doc/maintainers.rdoc21
-rw-r--r--doc/make_cheatsheet.md6
-rw-r--r--doc/marshal.rdoc2
-rw-r--r--doc/memory_view.md2
-rw-r--r--doc/ractor.md2
-rw-r--r--doc/syntax/pattern_matching.rdoc8
-rw-r--r--enc/depend1745
-rw-r--r--encoding.c47
-rw-r--r--enum.c1748
-rw-r--r--enumerator.c10
-rw-r--r--error.c123
-rw-r--r--eval.c241
-rw-r--r--eval_error.c4
-rw-r--r--eval_intern.h32
-rw-r--r--ext/-test-/array/concat/depend321
-rw-r--r--ext/-test-/array/concat/extconf.rb2
-rw-r--r--ext/-test-/array/concat/to_ary_conact.c34
-rw-r--r--ext/-test-/auto_ext.rb1
-rw-r--r--ext/-test-/exception/depend115
-rw-r--r--ext/-test-/file/depend100
-rw-r--r--ext/-test-/memory_status/memory_status.c19
-rw-r--r--ext/-test-/printf/depend37
-rw-r--r--ext/-test-/string/depend81
-rw-r--r--ext/-test-/time/leap_second.c1
-rw-r--r--ext/-test-/wait/depend9
-rw-r--r--ext/cgi/escape/depend37
-rw-r--r--ext/date/date.gemspec2
-rw-r--r--ext/date/date_core.c6
-rw-r--r--ext/date/date_strftime.c2
-rw-r--r--ext/date/depend137
-rw-r--r--ext/date/extconf.rb6
-rw-r--r--ext/date/prereq.mk7
-rw-r--r--ext/date/zonetab.h14
-rw-r--r--ext/digest/digest.gemspec40
-rw-r--r--ext/digest/lib/digest.rb21
-rw-r--r--ext/digest/lib/digest/loader.rb3
-rw-r--r--ext/digest/sha2/lib/sha2.rb2
-rw-r--r--ext/digest/sha2/lib/sha2/loader.rb3
-rw-r--r--ext/etc/depend9
-rw-r--r--ext/etc/etc.c13
-rw-r--r--ext/fcntl/fcntl.gemspec2
-rw-r--r--ext/fiddle/depend18
-rw-r--r--ext/fiddle/fiddle.gemspec4
-rw-r--r--ext/fiddle/lib/fiddle/struct.rb60
-rw-r--r--ext/io/console/depend9
-rw-r--r--ext/io/nonblock/depend37
-rw-r--r--ext/io/wait/depend37
-rw-r--r--ext/json/VERSION2
-rw-r--r--ext/json/generator/depend37
-rw-r--r--ext/json/parser/depend37
-rw-r--r--ext/nkf/depend37
-rw-r--r--ext/nkf/nkf.gemspec2
-rw-r--r--ext/objspace/depend18
-rw-r--r--ext/objspace/objspace.c3
-rw-r--r--ext/openssl/History.md53
-rw-r--r--ext/openssl/depend353
-rw-r--r--ext/openssl/extconf.rb3
-rw-r--r--ext/openssl/lib/openssl/buffering.rb12
-rw-r--r--ext/openssl/lib/openssl/ssl.rb12
-rw-r--r--ext/openssl/lib/openssl/version.rb2
-rw-r--r--ext/openssl/openssl.gemspec4
-rw-r--r--ext/openssl/ossl.c27
-rw-r--r--ext/openssl/ossl.h5
-rw-r--r--ext/openssl/ossl_asn1.c18
-rw-r--r--ext/openssl/ossl_cipher.c8
-rw-r--r--ext/openssl/ossl_config.c2
-rw-r--r--ext/openssl/ossl_digest.c8
-rw-r--r--ext/openssl/ossl_pkcs12.c24
-rw-r--r--ext/openssl/ossl_pkey.c5
-rw-r--r--ext/openssl/ossl_pkey_ec.c5
-rw-r--r--ext/openssl/ossl_ssl.c118
-rw-r--r--ext/openssl/ossl_ts.c42
-rw-r--r--ext/openssl/ossl_x509store.c51
-rw-r--r--ext/openssl/ruby_missing.h24
-rw-r--r--ext/pathname/depend37
-rw-r--r--ext/pathname/lib/pathname.rb8
-rw-r--r--ext/pathname/pathname.gemspec2
-rw-r--r--ext/psych/depend45
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb17
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb2
-rw-r--r--ext/pty/depend37
-rw-r--r--ext/readline/depend9
-rw-r--r--ext/ripper/depend9
-rw-r--r--ext/socket/ancdata.c12
-rw-r--r--ext/socket/basicsocket.c2
-rw-r--r--ext/socket/depend135
-rw-r--r--ext/socket/ifaddr.c1
-rw-r--r--ext/socket/mkconstants.rb33
-rw-r--r--ext/stringio/depend37
-rw-r--r--ext/strscan/depend37
-rw-r--r--ext/zlib/depend37
-rw-r--r--ext/zlib/zlib.c16
-rw-r--r--file.c126
-rw-r--r--gc.c1664
-rw-r--r--gc.h10
-rw-r--r--gc.rb86
-rw-r--r--gem_prelude.rb4
-rw-r--r--gems/bundled_gems11
-rw-r--r--hash.c162
-rw-r--r--id_table.c2
-rw-r--r--include/ruby.h1
-rw-r--r--include/ruby/assert.h2
-rw-r--r--include/ruby/atomic.h990
-rw-r--r--include/ruby/backward.h1
-rw-r--r--include/ruby/backward/2/assume.h25
-rw-r--r--include/ruby/backward/2/attributes.h3
-rw-r--r--include/ruby/backward/2/bool.h5
-rw-r--r--include/ruby/backward/2/gcc_version_since.h5
-rw-r--r--include/ruby/backward/2/inttypes.h3
-rw-r--r--include/ruby/backward/2/limits.h5
-rw-r--r--include/ruby/backward/2/long_long.h12
-rw-r--r--include/ruby/backward/2/r_cast.h5
-rw-r--r--include/ruby/backward/2/rmodule.h3
-rw-r--r--include/ruby/backward/2/stdalign.h6
-rw-r--r--include/ruby/backward/2/stdarg.h24
-rw-r--r--include/ruby/backward/cxxanyargs.hpp69
-rw-r--r--include/ruby/debug.h555
-rw-r--r--include/ruby/defines.h11
-rw-r--r--include/ruby/encoding.h410
-rw-r--r--include/ruby/fiber/scheduler.h185
-rw-r--r--include/ruby/internal/anyargs.h8
-rw-r--r--include/ruby/internal/arithmetic.h2
-rw-r--r--include/ruby/internal/arithmetic/char.h31
-rw-r--r--include/ruby/internal/arithmetic/double.h49
-rw-r--r--include/ruby/internal/arithmetic/fixnum.h32
-rw-r--r--include/ruby/internal/arithmetic/gid_t.h5
-rw-r--r--include/ruby/internal/arithmetic/int.h129
-rw-r--r--include/ruby/internal/arithmetic/intptr_t.h38
-rw-r--r--include/ruby/internal/arithmetic/long.h158
-rw-r--r--include/ruby/internal/arithmetic/long_long.h85
-rw-r--r--include/ruby/internal/arithmetic/mode_t.h5
-rw-r--r--include/ruby/internal/arithmetic/off_t.h5
-rw-r--r--include/ruby/internal/arithmetic/pid_t.h5
-rw-r--r--include/ruby/internal/arithmetic/short.h85
-rw-r--r--include/ruby/internal/arithmetic/size_t.h24
-rw-r--r--include/ruby/internal/arithmetic/st_data_t.h24
-rw-r--r--include/ruby/internal/arithmetic/uid_t.h5
-rw-r--r--include/ruby/internal/assume.h2
-rw-r--r--include/ruby/internal/attr/alloc_size.h2
-rw-r--r--include/ruby/internal/attr/artificial.h2
-rw-r--r--include/ruby/internal/attr/cold.h2
-rw-r--r--include/ruby/internal/attr/const.h2
-rw-r--r--include/ruby/internal/attr/constexpr.h2
-rw-r--r--include/ruby/internal/attr/deprecated.h12
-rw-r--r--include/ruby/internal/attr/diagnose_if.h2
-rw-r--r--include/ruby/internal/attr/enum_extensibility.h2
-rw-r--r--include/ruby/internal/attr/error.h2
-rw-r--r--include/ruby/internal/attr/flag_enum.h2
-rw-r--r--include/ruby/internal/attr/forceinline.h2
-rw-r--r--include/ruby/internal/attr/format.h2
-rw-r--r--include/ruby/internal/attr/maybe_unused.h2
-rw-r--r--include/ruby/internal/attr/noalias.h15
-rw-r--r--include/ruby/internal/attr/nodiscard.h2
-rw-r--r--include/ruby/internal/attr/noexcept.h2
-rw-r--r--include/ruby/internal/attr/noinline.h2
-rw-r--r--include/ruby/internal/attr/nonnull.h4
-rw-r--r--include/ruby/internal/attr/noreturn.h2
-rw-r--r--include/ruby/internal/attr/pure.h2
-rw-r--r--include/ruby/internal/attr/restrict.h2
-rw-r--r--include/ruby/internal/attr/returns_nonnull.h2
-rw-r--r--include/ruby/internal/attr/warning.h2
-rw-r--r--include/ruby/internal/attr/weakref.h2
-rw-r--r--include/ruby/internal/cast.h5
-rw-r--r--include/ruby/internal/compiler_is.h2
-rw-r--r--include/ruby/internal/compiler_is/apple.h5
-rw-r--r--include/ruby/internal/compiler_is/clang.h5
-rw-r--r--include/ruby/internal/compiler_is/gcc.h5
-rw-r--r--include/ruby/internal/compiler_is/intel.h5
-rw-r--r--include/ruby/internal/compiler_is/msvc.h5
-rw-r--r--include/ruby/internal/compiler_is/sunpro.h5
-rw-r--r--include/ruby/internal/compiler_since.h2
-rw-r--r--include/ruby/internal/config.h9
-rw-r--r--include/ruby/internal/constant_p.h3
-rw-r--r--include/ruby/internal/core.h2
-rw-r--r--include/ruby/internal/core/rarray.h342
-rw-r--r--include/ruby/internal/core/rbasic.h88
-rw-r--r--include/ruby/internal/core/rbignum.h33
-rw-r--r--include/ruby/internal/core/rclass.h99
-rw-r--r--include/ruby/internal/core/rdata.h231
-rw-r--r--include/ruby/internal/core/rfile.h17
-rw-r--r--include/ruby/internal/core/rhash.h112
-rw-r--r--include/ruby/internal/core/rmatch.h85
-rw-r--r--include/ruby/internal/core/robject.h99
-rw-r--r--include/ruby/internal/core/rregexp.h88
-rw-r--r--include/ruby/internal/core/rstring.h381
-rw-r--r--include/ruby/internal/core/rstruct.h58
-rw-r--r--include/ruby/internal/core/rtypeddata.h428
-rw-r--r--include/ruby/internal/ctype.h382
-rw-r--r--include/ruby/internal/dllexport.h28
-rw-r--r--include/ruby/internal/dosish.h28
-rw-r--r--include/ruby/internal/encoding/coderange.h202
-rw-r--r--include/ruby/internal/encoding/ctype.h243
-rw-r--r--include/ruby/internal/encoding/encoding.h1058
-rw-r--r--include/ruby/internal/encoding/pathname.h184
-rw-r--r--include/ruby/internal/encoding/re.h46
-rw-r--r--include/ruby/internal/encoding/sprintf.h78
-rw-r--r--include/ruby/internal/encoding/string.h346
-rw-r--r--include/ruby/internal/encoding/symbol.h100
-rw-r--r--include/ruby/internal/encoding/transcode.h558
-rw-r--r--include/ruby/internal/error.h568
-rw-r--r--include/ruby/internal/eval.h355
-rw-r--r--include/ruby/internal/event.h157
-rw-r--r--include/ruby/internal/fl_type.h659
-rw-r--r--include/ruby/internal/gc.h2
-rw-r--r--include/ruby/internal/glob.h88
-rw-r--r--include/ruby/internal/globals.h225
-rw-r--r--include/ruby/internal/has/attribute.h2
-rw-r--r--include/ruby/internal/has/builtin.h2
-rw-r--r--include/ruby/internal/has/c_attribute.h2
-rw-r--r--include/ruby/internal/has/cpp_attribute.h2
-rw-r--r--include/ruby/internal/has/declspec_attribute.h2
-rw-r--r--include/ruby/internal/has/extension.h2
-rw-r--r--include/ruby/internal/has/feature.h2
-rw-r--r--include/ruby/internal/has/warning.h2
-rw-r--r--include/ruby/internal/intern/array.h659
-rw-r--r--include/ruby/internal/intern/bignum.h815
-rw-r--r--include/ruby/internal/intern/class.h339
-rw-r--r--include/ruby/internal/intern/compar.h34
-rw-r--r--include/ruby/internal/intern/complex.h203
-rw-r--r--include/ruby/internal/intern/cont.h222
-rw-r--r--include/ruby/internal/intern/dir.h11
-rw-r--r--include/ruby/internal/intern/enum.h44
-rw-r--r--include/ruby/internal/intern/enumerator.h201
-rw-r--r--include/ruby/internal/intern/error.h255
-rw-r--r--include/ruby/internal/intern/eval.h183
-rw-r--r--include/ruby/internal/intern/file.h170
-rw-r--r--include/ruby/internal/intern/gc.h373
-rw-r--r--include/ruby/internal/intern/hash.h300
-rw-r--r--include/ruby/internal/intern/io.h635
-rw-r--r--include/ruby/internal/intern/load.h194
-rw-r--r--include/ruby/internal/intern/marshal.h83
-rw-r--r--include/ruby/internal/intern/numeric.h188
-rw-r--r--include/ruby/internal/intern/object.h565
-rw-r--r--include/ruby/internal/intern/parse.h155
-rw-r--r--include/ruby/internal/intern/proc.h336
-rw-r--r--include/ruby/internal/intern/process.h239
-rw-r--r--include/ruby/internal/intern/random.h74
-rw-r--r--include/ruby/internal/intern/range.h60
-rw-r--r--include/ruby/internal/intern/rational.h138
-rw-r--r--include/ruby/internal/intern/re.h227
-rw-r--r--include/ruby/internal/intern/ruby.h46
-rw-r--r--include/ruby/internal/intern/select.h38
-rw-r--r--include/ruby/internal/intern/select/largesize.h138
-rw-r--r--include/ruby/internal/intern/select/posix.h67
-rw-r--r--include/ruby/internal/intern/select/win32.h153
-rw-r--r--include/ruby/internal/intern/signal.h121
-rw-r--r--include/ruby/internal/intern/sprintf.h132
-rw-r--r--include/ruby/internal/intern/string.h1697
-rw-r--r--include/ruby/internal/intern/struct.h184
-rw-r--r--include/ruby/internal/intern/thread.h452
-rw-r--r--include/ruby/internal/intern/time.h122
-rw-r--r--include/ruby/internal/intern/variable.h630
-rw-r--r--include/ruby/internal/intern/vm.h403
-rw-r--r--include/ruby/internal/interpreter.h235
-rw-r--r--include/ruby/internal/iterator.h481
-rw-r--r--include/ruby/internal/memory.h429
-rw-r--r--include/ruby/internal/method.h180
-rw-r--r--include/ruby/internal/module.h154
-rw-r--r--include/ruby/internal/newobj.h152
-rw-r--r--include/ruby/internal/rgengc.h286
-rw-r--r--include/ruby/internal/scan_args.h157
-rw-r--r--include/ruby/internal/special_consts.h141
-rw-r--r--include/ruby/internal/static_assert.h2
-rw-r--r--include/ruby/internal/stdalign.h8
-rw-r--r--include/ruby/internal/stdbool.h2
-rw-r--r--include/ruby/internal/symbol.h256
-rw-r--r--include/ruby/internal/value.h71
-rw-r--r--include/ruby/internal/value_type.h199
-rw-r--r--include/ruby/internal/variable.h301
-rw-r--r--include/ruby/internal/warning_push.h41
-rw-r--r--include/ruby/internal/xmalloc.h110
-rw-r--r--include/ruby/io.h837
-rw-r--r--include/ruby/memory_view.h196
-rw-r--r--include/ruby/missing.h43
-rw-r--r--include/ruby/ractor.h210
-rw-r--r--include/ruby/random.h226
-rw-r--r--include/ruby/re.h129
-rw-r--r--include/ruby/regex.h1
-rw-r--r--include/ruby/ruby.h177
-rw-r--r--include/ruby/subst.h1
-rw-r--r--include/ruby/thread.h157
-rw-r--r--include/ruby/thread_native.h141
-rw-r--r--include/ruby/util.h193
-rw-r--r--include/ruby/version.h106
-rw-r--r--include/ruby/vm.h19
-rw-r--r--include/ruby/win32.h10
-rw-r--r--inits.c1
-rw-r--r--insns.def6
-rw-r--r--internal.h8
-rw-r--r--internal/array.h5
-rw-r--r--internal/bignum.h1
-rw-r--r--internal/bits.h1
-rw-r--r--internal/class.h6
-rw-r--r--internal/compar.h1
-rw-r--r--internal/compile.h1
-rw-r--r--internal/compilers.h1
-rw-r--r--internal/complex.h1
-rw-r--r--internal/cont.h1
-rw-r--r--internal/dir.h1
-rw-r--r--internal/enc.h1
-rw-r--r--internal/encoding.h1
-rw-r--r--internal/enum.h1
-rw-r--r--internal/enumerator.h1
-rw-r--r--internal/error.h37
-rw-r--r--internal/eval.h1
-rw-r--r--internal/file.h1
-rw-r--r--internal/fixnum.h1
-rw-r--r--internal/gc.h7
-rw-r--r--internal/hash.h4
-rw-r--r--internal/imemo.h1
-rw-r--r--internal/inits.h1
-rw-r--r--internal/io.h5
-rw-r--r--internal/load.h1
-rw-r--r--internal/loadpath.h1
-rw-r--r--internal/math.h1
-rw-r--r--internal/missing.h1
-rw-r--r--internal/numeric.h2
-rw-r--r--internal/object.h1
-rw-r--r--internal/parse.h3
-rw-r--r--internal/proc.h1
-rw-r--r--internal/process.h3
-rw-r--r--internal/random.h1
-rw-r--r--internal/range.h1
-rw-r--r--internal/rational.h2
-rw-r--r--internal/re.h1
-rw-r--r--internal/sanitizers.h1
-rw-r--r--internal/serial.h1
-rw-r--r--internal/signal.h1
-rw-r--r--internal/static_assert.h1
-rw-r--r--internal/string.h2
-rw-r--r--internal/struct.h1
-rw-r--r--internal/symbol.h1
-rw-r--r--internal/thread.h1
-rw-r--r--internal/time.h1
-rw-r--r--internal/transcode.h1
-rw-r--r--internal/util.h4
-rw-r--r--internal/variable.h2
-rw-r--r--internal/vm.h1
-rw-r--r--internal/warnings.h1
-rw-r--r--io.c115
-rw-r--r--iseq.c52
-rw-r--r--iseq.h2
-rw-r--r--lib/base64.gemspec2
-rw-r--r--lib/base64.rb6
-rw-r--r--lib/benchmark/version.rb2
-rw-r--r--lib/bundler.rb32
-rw-r--r--lib/bundler/cli.rb15
-rw-r--r--lib/bundler/cli/exec.rb7
-rw-r--r--lib/bundler/cli/gem.rb36
-rw-r--r--lib/bundler/cli/info.rb15
-rw-r--r--lib/bundler/cli/install.rb12
-rw-r--r--lib/bundler/cli/list.rb8
-rw-r--r--lib/bundler/cli/remove.rb3
-rw-r--r--lib/bundler/definition.rb66
-rw-r--r--lib/bundler/dsl.rb2
-rw-r--r--lib/bundler/endpoint_specification.rb8
-rw-r--r--lib/bundler/errors.rb2
-rw-r--r--lib/bundler/fetcher.rb3
-rw-r--r--lib/bundler/gem_helper.rb21
-rw-r--r--lib/bundler/gemdeps.rb29
-rw-r--r--lib/bundler/installer.rb4
-rw-r--r--lib/bundler/installer/standalone.rb21
-rw-r--r--lib/bundler/lockfile_parser.rb1
-rw-r--r--lib/bundler/man/bundle-add.12
-rw-r--r--lib/bundler/man/bundle-binstubs.12
-rw-r--r--lib/bundler/man/bundle-cache.12
-rw-r--r--lib/bundler/man/bundle-check.12
-rw-r--r--lib/bundler/man/bundle-clean.12
-rw-r--r--lib/bundler/man/bundle-config.14
-rw-r--r--lib/bundler/man/bundle-config.1.ronn4
-rw-r--r--lib/bundler/man/bundle-doctor.12
-rw-r--r--lib/bundler/man/bundle-exec.12
-rw-r--r--lib/bundler/man/bundle-gem.12
-rw-r--r--lib/bundler/man/bundle-info.12
-rw-r--r--lib/bundler/man/bundle-init.12
-rw-r--r--lib/bundler/man/bundle-inject.12
-rw-r--r--lib/bundler/man/bundle-install.14
-rw-r--r--lib/bundler/man/bundle-install.1.ronn4
-rw-r--r--lib/bundler/man/bundle-list.12
-rw-r--r--lib/bundler/man/bundle-lock.12
-rw-r--r--lib/bundler/man/bundle-open.12
-rw-r--r--lib/bundler/man/bundle-outdated.12
-rw-r--r--lib/bundler/man/bundle-platform.12
-rw-r--r--lib/bundler/man/bundle-pristine.12
-rw-r--r--lib/bundler/man/bundle-remove.12
-rw-r--r--lib/bundler/man/bundle-show.12
-rw-r--r--lib/bundler/man/bundle-update.14
-rw-r--r--lib/bundler/man/bundle-update.1.ronn3
-rw-r--r--lib/bundler/man/bundle-viz.12
-rw-r--r--lib/bundler/man/bundle.12
-rw-r--r--lib/bundler/man/gemfile.52
-rw-r--r--lib/bundler/plugin.rb29
-rw-r--r--lib/bundler/plugin/installer.rb2
-rw-r--r--lib/bundler/psyched_yaml.rb14
-rw-r--r--lib/bundler/resolver.rb27
-rw-r--r--lib/bundler/rubygems_ext.rb4
-rw-r--r--lib/bundler/rubygems_integration.rb18
-rw-r--r--lib/bundler/runtime.rb23
-rw-r--r--lib/bundler/settings.rb14
-rw-r--r--lib/bundler/setup.rb4
-rw-r--r--lib/bundler/source.rb4
-rw-r--r--lib/bundler/source/git.rb22
-rw-r--r--lib/bundler/source/rubygems.rb35
-rw-r--r--lib/bundler/source/rubygems_aggregate.rb4
-rw-r--r--lib/bundler/source_list.rb15
-rw-r--r--lib/bundler/spec_set.rb48
-rw-r--r--lib/bundler/templates/newgem/github/workflows/main.yml.tt15
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt4
-rw-r--r--lib/cgi.rb2
-rw-r--r--lib/cgi/util.rb11
-rw-r--r--lib/debug.gemspec22
-rw-r--r--lib/debug.rb1106
-rw-r--r--lib/drb/drb.gemspec4
-rw-r--r--lib/drb/version.rb2
-rw-r--r--lib/error_highlight/core_ext.rb2
-rw-r--r--lib/fileutils.rb12
-rw-r--r--lib/find.gemspec2
-rw-r--r--lib/ipaddr.rb132
-rw-r--r--lib/irb.rb17
-rw-r--r--lib/irb/cmd/help.rb3
-rw-r--r--lib/irb/cmd/show_source.rb5
-rw-r--r--lib/irb/completion.rb74
-rw-r--r--lib/irb/context.rb46
-rw-r--r--lib/irb/init.rb9
-rw-r--r--lib/irb/input-method.rb99
-rw-r--r--lib/irb/irb.gemspec2
-rw-r--r--lib/irb/lc/help-message11
-rw-r--r--lib/irb/lc/ja/help-message2
-rw-r--r--lib/irb/ruby-lex.rb38
-rw-r--r--lib/irb/version.rb4
-rw-r--r--lib/irb/workspace.rb3
-rw-r--r--lib/logger/logger.gemspec2
-rw-r--r--lib/mkmf.rb29
-rw-r--r--lib/open-uri.gemspec2
-rw-r--r--lib/ostruct.rb12
-rw-r--r--lib/racc/racc.gemspec2
-rw-r--r--lib/rdoc/any_method.rb5
-rw-r--r--lib/rdoc/cross_reference.rb2
-rw-r--r--lib/rdoc/generator/darkfish.rb4
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml4
-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttfbin71200 -> 138268 bytes
-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttfbin71692 -> 138680 bytes
-rw-r--r--lib/rdoc/markdown.rb79
-rw-r--r--lib/rdoc/markdown/literals.rb15
-rw-r--r--lib/rdoc/markup/pre_process.rb2
-rw-r--r--lib/rdoc/options.rb31
-rw-r--r--lib/rdoc/parser/c.rb30
-rw-r--r--lib/rdoc/rd/block_parser.rb2
-rw-r--r--lib/rdoc/rd/inline_parser.rb2
-rw-r--r--lib/rdoc/rdoc.gemspec1
-rw-r--r--lib/rdoc/rdoc.rb33
-rw-r--r--lib/rdoc/text.rb16
-rw-r--r--lib/reline.rb138
-rw-r--r--lib/reline/ansi.rb23
-rw-r--r--lib/reline/config.rb32
-rw-r--r--lib/reline/general_io.rb1
-rw-r--r--lib/reline/key_stroke.rb77
-rw-r--r--lib/reline/line_editor.rb640
-rw-r--r--lib/reline/terminfo.rb30
-rw-r--r--lib/reline/unicode.rb35
-rw-r--r--lib/reline/version.rb2
-rw-r--r--lib/reline/windows.rb88
-rw-r--r--lib/rubygems.rb72
-rw-r--r--lib/rubygems/command_manager.rb6
-rw-r--r--lib/rubygems/commands/build_command.rb6
-rw-r--r--lib/rubygems/commands/cert_command.rb4
-rw-r--r--lib/rubygems/commands/check_command.rb8
-rw-r--r--lib/rubygems/commands/cleanup_command.rb6
-rw-r--r--lib/rubygems/commands/contents_command.rb4
-rw-r--r--lib/rubygems/commands/dependency_command.rb6
-rw-r--r--lib/rubygems/commands/environment_command.rb2
-rw-r--r--lib/rubygems/commands/fetch_command.rb6
-rw-r--r--lib/rubygems/commands/generate_index_command.rb4
-rw-r--r--lib/rubygems/commands/help_command.rb2
-rw-r--r--lib/rubygems/commands/info_command.rb4
-rw-r--r--lib/rubygems/commands/install_command.rb23
-rw-r--r--lib/rubygems/commands/list_command.rb4
-rw-r--r--lib/rubygems/commands/lock_command.rb2
-rw-r--r--lib/rubygems/commands/mirror_command.rb2
-rw-r--r--lib/rubygems/commands/open_command.rb4
-rw-r--r--lib/rubygems/commands/outdated_command.rb8
-rw-r--r--lib/rubygems/commands/owner_command.rb8
-rw-r--r--lib/rubygems/commands/pristine_command.rb10
-rw-r--r--lib/rubygems/commands/push_command.rb8
-rw-r--r--lib/rubygems/commands/query_command.rb6
-rw-r--r--lib/rubygems/commands/rdoc_command.rb6
-rw-r--r--lib/rubygems/commands/search_command.rb4
-rw-r--r--lib/rubygems/commands/server_command.rb6
-rw-r--r--lib/rubygems/commands/setup_command.rb28
-rw-r--r--lib/rubygems/commands/signin_command.rb4
-rw-r--r--lib/rubygems/commands/signout_command.rb2
-rw-r--r--lib/rubygems/commands/sources_command.rb8
-rw-r--r--lib/rubygems/commands/specification_command.rb8
-rw-r--r--lib/rubygems/commands/stale_command.rb2
-rw-r--r--lib/rubygems/commands/uninstall_command.rb6
-rw-r--r--lib/rubygems/commands/unpack_command.rb10
-rw-r--r--lib/rubygems/commands/update_command.rb18
-rw-r--r--lib/rubygems/commands/which_command.rb2
-rw-r--r--lib/rubygems/commands/yank_command.rb8
-rw-r--r--lib/rubygems/config_file.rb2
-rw-r--r--lib/rubygems/defaults.rb24
-rw-r--r--lib/rubygems/dependency_installer.rb16
-rw-r--r--lib/rubygems/dependency_list.rb2
-rw-r--r--lib/rubygems/doctor.rb4
-rw-r--r--lib/rubygems/errors.rb3
-rw-r--r--lib/rubygems/exceptions.rb4
-rw-r--r--lib/rubygems/gem_runner.rb6
-rw-r--r--lib/rubygems/gemcutter_utilities.rb4
-rw-r--r--lib/rubygems/indexer.rb4
-rw-r--r--lib/rubygems/install_default_message.rb4
-rw-r--r--lib/rubygems/install_message.rb4
-rw-r--r--lib/rubygems/install_update_options.rb4
-rw-r--r--lib/rubygems/installer.rb25
-rw-r--r--lib/rubygems/local_remote_options.rb2
-rw-r--r--lib/rubygems/mock_gem_ui.rb2
-rw-r--r--lib/rubygems/name_tuple.rb5
-rw-r--r--lib/rubygems/package.rb82
-rw-r--r--lib/rubygems/package/tar_reader.rb2
-rw-r--r--lib/rubygems/package_task.rb4
-rw-r--r--lib/rubygems/path_support.rb7
-rw-r--r--lib/rubygems/platform.rb7
-rw-r--r--lib/rubygems/query_utils.rb8
-rw-r--r--lib/rubygems/rdoc.rb2
-rw-r--r--lib/rubygems/remote_fetcher.rb33
-rw-r--r--lib/rubygems/request.rb12
-rw-r--r--lib/rubygems/request_set.rb8
-rw-r--r--lib/rubygems/request_set/lockfile.rb2
-rw-r--r--lib/rubygems/request_set/lockfile/tokenizer.rb2
-rw-r--r--lib/rubygems/requirement.rb2
-rw-r--r--lib/rubygems/resolver.rb62
-rw-r--r--lib/rubygems/resolver/git_specification.rb2
-rw-r--r--lib/rubygems/resolver/installer_set.rb8
-rw-r--r--lib/rubygems/resolver/molinillo.rb2
-rw-r--r--lib/rubygems/resolver/set.rb1
-rw-r--r--lib/rubygems/resolver/specification.rb2
-rw-r--r--lib/rubygems/s3_uri_signer.rb6
-rw-r--r--lib/rubygems/security.rb10
-rw-r--r--lib/rubygems/security/policy.rb2
-rw-r--r--lib/rubygems/security/signer.rb2
-rw-r--r--lib/rubygems/security_option.rb4
-rw-r--r--lib/rubygems/server.rb4
-rw-r--r--lib/rubygems/source.rb14
-rw-r--r--lib/rubygems/spec_fetcher.rb10
-rw-r--r--lib/rubygems/specification.rb26
-rw-r--r--lib/rubygems/specification_policy.rb4
-rw-r--r--lib/rubygems/uninstaller.rb12
-rw-r--r--lib/rubygems/uri.rb111
-rw-r--r--lib/rubygems/uri_parser.rb42
-rw-r--r--lib/rubygems/user_interaction.rb4
-rw-r--r--lib/rubygems/util.rb2
-rw-r--r--lib/rubygems/util/licenses.rb2
-rw-r--r--lib/rubygems/validator.rb4
-rw-r--r--lib/rubygems/version_option.rb2
-rw-r--r--lib/securerandom.rb2
-rw-r--r--lib/set.rb11
-rw-r--r--lib/tempfile.rb6
-rw-r--r--lib/time.gemspec2
-rw-r--r--lib/timeout.rb2
-rw-r--r--lib/un.gemspec5
-rw-r--r--lib/un.rb39
-rw-r--r--lib/yaml/yaml.gemspec2
-rw-r--r--load.c220
-rw-r--r--man/irb.124
-rw-r--r--marshal.c216
-rw-r--r--marshal.rb21
-rw-r--r--math.c14
-rw-r--r--memory_view.c4
-rwxr-xr-xmisc/lldb_cruby.py16
-rw-r--r--missing/erf.c15
-rw-r--r--missing/finite.c9
-rw-r--r--missing/isinf.c69
-rw-r--r--missing/isnan.c32
-rw-r--r--missing/signbit.c19
-rw-r--r--missing/tgamma.c15
-rw-r--r--mjit.c15
-rw-r--r--mjit.h2
-rw-r--r--mjit_compile.c51
-rw-r--r--numeric.c666
-rw-r--r--numeric.rb20
-rw-r--r--object.c357
-rw-r--r--pack.c2
-rw-r--r--parse.y156
-rw-r--r--proc.c36
-rw-r--r--process.c198
-rw-r--r--ractor.c14
-rw-r--r--ractor.rb6
-rw-r--r--ractor_core.h15
-rw-r--r--random.c51
-rw-r--r--range.c1204
-rw-r--r--rational.c33
-rw-r--r--re.c185
-rw-r--r--regcomp.c2
-rw-r--r--regerror.c4
-rw-r--r--regint.h8
-rw-r--r--regparse.c6
-rw-r--r--ruby.c44
-rw-r--r--ruby_assert.h1
-rw-r--r--sample/exyacc.rb2
-rw-r--r--scheduler.c21
-rw-r--r--signal.c12
-rw-r--r--spec/bundler/bundler/bundler_spec.rb30
-rw-r--r--spec/bundler/bundler/cli_spec.rb16
-rw-r--r--spec/bundler/bundler/definition_spec.rb3
-rw-r--r--spec/bundler/bundler/dsl_spec.rb2
-rw-r--r--spec/bundler/bundler/endpoint_specification_spec.rb16
-rw-r--r--spec/bundler/bundler/env_spec.rb14
-rw-r--r--spec/bundler/bundler/gem_helper_spec.rb2
-rw-r--r--spec/bundler/bundler/plugin_spec.rb7
-rw-r--r--spec/bundler/bundler/psyched_yaml_spec.rb9
-rw-r--r--spec/bundler/bundler/source/git_spec.rb45
-rw-r--r--spec/bundler/cache/gems_spec.rb24
-rw-r--r--spec/bundler/commands/binstubs_spec.rb6
-rw-r--r--spec/bundler/commands/check_spec.rb52
-rw-r--r--spec/bundler/commands/clean_spec.rb14
-rw-r--r--spec/bundler/commands/config_spec.rb32
-rw-r--r--spec/bundler/commands/exec_spec.rb12
-rw-r--r--spec/bundler/commands/info_spec.rb10
-rw-r--r--spec/bundler/commands/install_spec.rb130
-rw-r--r--spec/bundler/commands/lock_spec.rb2
-rw-r--r--spec/bundler/commands/newgem_spec.rb52
-rw-r--r--spec/bundler/commands/post_bundle_message_spec.rb1
-rw-r--r--spec/bundler/commands/remove_spec.rb3
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb4
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb18
-rw-r--r--spec/bundler/install/gems/standalone_spec.rb71
-rw-r--r--spec/bundler/install/gemspecs_spec.rb4
-rw-r--r--spec/bundler/install/yanked_spec.rb31
-rw-r--r--spec/bundler/lock/lockfile_spec.rb3
-rw-r--r--spec/bundler/other/major_deprecation_spec.rb31
-rw-r--r--spec/bundler/plugins/command_spec.rb6
-rw-r--r--spec/bundler/plugins/install_spec.rb21
-rw-r--r--spec/bundler/runtime/platform_spec.rb3
-rw-r--r--spec/bundler/spec_helper.rb1
-rw-r--r--spec/bundler/support/builders.rb19
-rw-r--r--spec/bundler/support/hax.rb5
-rw-r--r--spec/bundler/support/indexes.rb2
-rw-r--r--spec/bundler/support/path.rb18
-rw-r--r--spec/bundler/support/platforms.rb6
-rw-r--r--spec/bundler/update/git_spec.rb4
-rw-r--r--spec/mspec/lib/mspec/helpers/ruby_exe.rb10
-rw-r--r--spec/mspec/spec/helpers/ruby_exe_spec.rb2
-rw-r--r--spec/ruby/README.md1
-rw-r--r--spec/ruby/core/array/intersect_spec.rb17
-rw-r--r--spec/ruby/core/dir/fixtures/common.rb2
-rw-r--r--spec/ruby/core/dir/glob_spec.rb2
-rw-r--r--spec/ruby/core/dir/shared/glob.rb9
-rw-r--r--spec/ruby/core/encoding/default_external_spec.rb8
-rw-r--r--spec/ruby/core/enumerable/shared/collect.rb14
-rw-r--r--spec/ruby/core/enumerable/tally_spec.rb2
-rw-r--r--spec/ruby/core/file/utime_spec.rb7
-rw-r--r--spec/ruby/core/float/comparison_spec.rb3
-rw-r--r--spec/ruby/core/gc/stat_spec.rb6
-rw-r--r--spec/ruby/core/io/external_encoding_spec.rb8
-rw-r--r--spec/ruby/core/io/internal_encoding_spec.rb8
-rw-r--r--spec/ruby/core/kernel/nil_spec.rb10
-rw-r--r--spec/ruby/core/kernel/shared/sprintf.rb26
-rw-r--r--spec/ruby/core/marshal/shared/load.rb221
-rw-r--r--spec/ruby/core/matchdata/match_length_spec.rb34
-rw-r--r--spec/ruby/core/matchdata/match_spec.rb34
-rw-r--r--spec/ruby/core/module/allocate_spec.rb14
-rw-r--r--spec/ruby/core/module/autoload_spec.rb100
-rw-r--r--spec/ruby/core/module/const_set_spec.rb3
-rw-r--r--spec/ruby/core/module/define_method_spec.rb51
-rw-r--r--spec/ruby/core/objectspace/garbage_collect_spec.rb4
-rw-r--r--spec/ruby/core/process/spawn_spec.rb20
-rw-r--r--spec/ruby/core/rational/rational_spec.rb4
-rw-r--r--spec/ruby/core/string/lstrip_spec.rb3
-rw-r--r--spec/ruby/core/string/partition_spec.rb3
-rw-r--r--spec/ruby/core/string/reverse_spec.rb17
-rw-r--r--spec/ruby/core/string/rpartition_spec.rb3
-rw-r--r--spec/ruby/core/string/rstrip_spec.rb3
-rw-r--r--spec/ruby/core/string/scrub_spec.rb32
-rw-r--r--spec/ruby/core/string/shared/partition.rb36
-rw-r--r--spec/ruby/core/string/shared/strip.rb20
-rw-r--r--spec/ruby/core/string/strip_spec.rb3
-rw-r--r--spec/ruby/core/tracepoint/inspect_spec.rb8
-rw-r--r--spec/ruby/language/defined_spec.rb53
-rw-r--r--spec/ruby/language/numbers_spec.rb4
-rw-r--r--spec/ruby/language/pattern_matching_spec.rb14
-rw-r--r--spec/ruby/language/predefined_spec.rb49
-rw-r--r--spec/ruby/language/regexp/grouping_spec.rb28
-rw-r--r--spec/ruby/library/base64/decode64_spec.rb4
-rw-r--r--spec/ruby/library/date/strftime_spec.rb15
-rw-r--r--spec/ruby/library/datetime/strftime_spec.rb15
-rw-r--r--spec/ruby/library/ipaddr/new_spec.rb41
-rw-r--r--spec/ruby/library/net/http/http/fixtures/http_server.rb149
-rw-r--r--spec/ruby/library/net/http/http/post_spec.rb2
-rw-r--r--spec/ruby/library/net/http/http/send_request_spec.rb2
-rw-r--r--spec/ruby/library/objectspace/memsize_of_all_spec.rb7
-rw-r--r--spec/ruby/library/rbconfig/rbconfig_spec.rb13
-rw-r--r--spec/ruby/library/set/pretty_print_spec.rb20
-rw-r--r--spec/ruby/library/socket/basicsocket/local_address_spec.rb10
-rw-r--r--spec/ruby/library/socket/basicsocket/remote_address_spec.rb10
-rw-r--r--spec/ruby/library/socket/shared/address.rb249
-rw-r--r--spec/ruby/library/stringio/ungetbyte_spec.rb38
-rw-r--r--spec/ruby/library/stringscanner/check_spec.rb11
-rw-r--r--spec/ruby/optional/capi/ext/fiber_spec.c11
-rw-r--r--spec/ruby/optional/capi/ext/integer_spec.c2
-rw-r--r--spec/ruby/optional/capi/ext/object_spec.c18
-rw-r--r--spec/ruby/optional/capi/ext/rbasic_spec.c28
-rw-r--r--spec/ruby/optional/capi/ext/string_spec.c63
-rw-r--r--spec/ruby/optional/capi/fiber_spec.rb38
-rw-r--r--spec/ruby/optional/capi/rbasic_spec.rb20
-rw-r--r--spec/ruby/optional/capi/shared/rbasic.rb20
-rw-r--r--spec/ruby/optional/capi/spec_helper.rb7
-rw-r--r--spec/ruby/optional/capi/string_spec.rb55
-rw-r--r--spec/ruby/security/cve_2017_17742_spec.rb57
-rw-r--r--sprintf.c4
-rw-r--r--strftime.c4
-rw-r--r--string.c179
-rw-r--r--struct.c632
-rw-r--r--symbol.c28
-rw-r--r--template/Doxyfile.tmpl2542
-rw-r--r--template/GNUmakefile.in2
-rw-r--r--template/Makefile.in25
-rw-r--r--template/configure-ext.mk.tmpl2
-rw-r--r--template/ruby.pc.in16
-rw-r--r--test/-ext-/array/test_to_ary_concat.rb20
-rw-r--r--test/-ext-/float/test_nextafter.rb2
-rw-r--r--test/date/test_date_strftime.rb2
-rw-r--r--test/did_you_mean/test_verbose_formatter.rb15
-rw-r--r--test/did_you_mean/tree_spell/test_change_word.rb2
-rw-r--r--test/drb/drbtest.rb6
-rw-r--r--test/error_highlight/test_error_highlight.rb2
-rw-r--r--test/excludes/TestArray.rb1
-rw-r--r--test/fiber/scheduler.rb38
-rw-r--r--test/fiber/test_io.rb43
-rw-r--r--test/fiber/test_thread.rb39
-rw-r--r--test/fiddle/helper.rb20
-rw-r--r--test/fiddle/test_c_struct_builder.rb33
-rw-r--r--test/fiddle/test_cparser.rb2
-rw-r--r--test/fiddle/test_func.rb25
-rw-r--r--test/fiddle/test_function.rb36
-rw-r--r--test/fiddle/test_handle.rb11
-rw-r--r--test/fiddle/test_memory_view.rb8
-rw-r--r--test/fiddle/test_pointer.rb21
-rw-r--r--test/fileutils/test_fileutils.rb2
-rw-r--r--test/io/console/test_io_console.rb2
-rw-r--r--test/irb/test_cmd.rb24
-rw-r--r--test/irb/test_color.rb2
-rw-r--r--test/irb/test_color_printer.rb2
-rw-r--r--test/irb/test_completion.rb37
-rw-r--r--test/irb/test_context.rb79
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb6
-rw-r--r--test/irb/test_ruby_lex.rb46
-rw-r--r--test/irb/test_workspace.rb21
-rw-r--r--test/irb/yamatanooroti/test_rendering.rb69
-rw-r--r--test/logger/helper.rb13
-rw-r--r--test/logger/test_logdevice.rb2
-rw-r--r--test/logger/test_logger.rb2
-rw-r--r--test/logger/test_logperiod.rb2
-rw-r--r--test/logger/test_severity.rb2
-rw-r--r--test/mkmf/test_have_var.rb17
-rw-r--r--test/net/http/test_httpresponse.rb2
-rw-r--r--test/openssl/test_config.rb16
-rw-r--r--test/openssl/test_ssl.rb25
-rw-r--r--test/openssl/test_ts.rb18
-rw-r--r--test/openssl/utils.rb15
-rw-r--r--test/ostruct/test_ostruct.rb12
-rw-r--r--test/pathname/test_pathname.rb30
-rw-r--r--test/pathname/test_ractor.rb2
-rw-r--r--test/psych/test_scalar_scanner.rb49
-rw-r--r--test/psych/test_string.rb13
-rw-r--r--test/racc/assets/mof.y6
-rw-r--r--test/racc/case.rb (renamed from test/racc/helper.rb)7
-rw-r--r--test/racc/regress/mof6
-rw-r--r--test/racc/test_chk_y.rb2
-rw-r--r--test/racc/test_grammar_file_parser.rb2
-rw-r--r--test/racc/test_racc_command.rb2
-rw-r--r--test/racc/test_scan_y.rb2
-rw-r--r--test/rdoc/support/test_case.rb17
-rw-r--r--test/rdoc/test_rdoc_any_method.rb48
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb2
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb24
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb2
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb2
-rw-r--r--test/rdoc/test_rdoc_options.rb73
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb66
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb58
-rw-r--r--test/rdoc/test_rdoc_servlet.rb4
-rw-r--r--test/rdoc/test_rdoc_text.rb10
-rw-r--r--test/readline/test_readline.rb111
-rw-r--r--test/reline/helper.rb3
-rw-r--r--test/reline/test_key_actor_emacs.rb22
-rw-r--r--test/reline/test_key_actor_vi.rb30
-rw-r--r--test/reline/test_key_stroke.rb32
-rw-r--r--test/reline/test_reline.rb69
-rw-r--r--test/reline/test_reline_key.rb53
-rw-r--r--test/reline/test_terminfo.rb8
-rw-r--r--test/reline/test_unicode.rb5
-rw-r--r--test/reline/windows/test_key_event_record.rb2
-rwxr-xr-xtest/reline/yamatanooroti/multiline_repl107
-rw-r--r--test/reline/yamatanooroti/termination_checker.rb2
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb439
-rw-r--r--test/ripper/test_ripper.rb9
-rw-r--r--test/ripper/test_sexp.rb14
-rw-r--r--test/ruby/enc/test_emoji_breaks.rb8
-rw-r--r--test/ruby/test_argf.rb19
-rw-r--r--test/ruby/test_array.rb30
-rw-r--r--test/ruby/test_ast.rb17
-rw-r--r--test/ruby/test_autoload.rb27
-rw-r--r--test/ruby/test_backtrace.rb28
-rw-r--r--test/ruby/test_enumerator.rb2
-rw-r--r--test/ruby/test_env.rb14
-rw-r--r--test/ruby/test_exception.rb2
-rw-r--r--test/ruby/test_file_exhaustive.rb20
-rw-r--r--test/ruby/test_gc_compact.rb5
-rw-r--r--test/ruby/test_hash.rb18
-rw-r--r--test/ruby/test_io.rb12
-rw-r--r--test/ruby/test_iseq.rb10
-rw-r--r--test/ruby/test_jit.rb17
-rw-r--r--test/ruby/test_keyword.rb17
-rw-r--r--test/ruby/test_literal.rb24
-rw-r--r--test/ruby/test_m17n.rb4
-rw-r--r--test/ruby/test_marshal.rb106
-rw-r--r--test/ruby/test_method.rb4
-rw-r--r--test/ruby/test_module.rb70
-rw-r--r--test/ruby/test_numeric.rb8
-rw-r--r--test/ruby/test_objectspace.rb2
-rw-r--r--test/ruby/test_optimization.rb58
-rw-r--r--test/ruby/test_pack.rb4
-rw-r--r--test/ruby/test_parse.rb12
-rw-r--r--test/ruby/test_pattern_matching.rb141
-rw-r--r--test/ruby/test_process.rb15
-rw-r--r--test/ruby/test_refinement.rb35
-rw-r--r--test/ruby/test_regexp.rb62
-rw-r--r--test/ruby/test_require.rb69
-rw-r--r--test/ruby/test_settracefunc.rb58
-rw-r--r--test/ruby/test_string.rb12
-rw-r--r--test/ruby/test_syntax.rb11
-rw-r--r--test/ruby/test_thread.rb8
-rw-r--r--test/ruby/test_thread_cv.rb3
-rw-r--r--test/ruby/test_time.rb4
-rw-r--r--test/rubygems/bogussources.rb9
-rw-r--r--test/rubygems/helper.rb20
-rw-r--r--test/rubygems/test_gem.rb497
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb25
-rw-r--r--test/rubygems/test_gem_installer.rb2
-rw-r--r--test/rubygems/test_gem_package.rb39
-rw-r--r--test/rubygems/test_gem_path_support.rb8
-rw-r--r--test/rubygems/test_gem_platform.rb1
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb30
-rw-r--r--test/rubygems/test_gem_request.rb44
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb18
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb10
-rw-r--r--test/rubygems/test_gem_specification.rb460
-rw-r--r--test/rubygems/test_gem_uri.rb39
-rw-r--r--test/rubygems/test_rubygems.rb44
-rw-r--r--test/socket/test_addrinfo.rb2
-rw-r--r--test/socket/test_basicsocket.rb2
-rw-r--r--test/test_ipaddr.rb59
-rw-r--r--test/test_timeout.rb11
-rw-r--r--test/zlib/test_zlib.rb4
-rw-r--r--thread.c170
-rw-r--r--thread_pthread.c8
-rw-r--r--thread_sync.c27
-rw-r--r--thread_win32.c2
-rw-r--r--thread_win32.h4
-rw-r--r--time.c67
-rw-r--r--timev.rb11
-rw-r--r--tool/bundler/rubocop_gems.rb.lock21
-rw-r--r--tool/bundler/standard_gems.rb.lock31
-rwxr-xr-xtool/disable_ipv6.sh9
-rw-r--r--tool/downloader.rb17
-rw-r--r--tool/fake.rb2
-rw-r--r--tool/lib/core_assertions.rb130
-rw-r--r--tool/lib/gc_checker.rb36
-rw-r--r--tool/lib/gc_compact_checker.rb10
-rw-r--r--tool/lib/leakchecker.rb4
-rw-r--r--tool/lib/memory_status.rb6
-rw-r--r--tool/lib/minitest/README.txt457
-rw-r--r--tool/lib/minitest/unit.rb1479
-rw-r--r--tool/lib/profile_test_all.rb2
-rw-r--r--tool/lib/test/unit.rb685
-rw-r--r--tool/lib/test/unit/assertions.rb560
-rw-r--r--tool/lib/test/unit/parallel.rb45
-rw-r--r--tool/lib/test/unit/testcase.rb296
-rw-r--r--tool/lib/vcs.rb25
-rw-r--r--tool/m4/ruby_define_if.m410
-rw-r--r--tool/m4/ruby_universal_arch.m432
-rw-r--r--tool/mk_builtin_loader.rb2
-rwxr-xr-xtool/mkrunnable.rb18
-rwxr-xr-xtool/rbinstall.rb38
-rw-r--r--tool/ruby_vm/views/_insn_len_info.erb23
-rw-r--r--tool/ruby_vm/views/_insn_name_info.erb30
-rw-r--r--tool/ruby_vm/views/_insn_operand_info.erb29
-rw-r--r--tool/ruby_vm/views/_trace_instruction.erb7
-rwxr-xr-xtool/strip-rdoc.rb30
-rwxr-xr-x[-rw-r--r--]tool/sync_default_gems.rb33
-rw-r--r--tool/test-bundled-gems.rb21
-rw-r--r--tool/test/runner.rb2
-rw-r--r--tool/test/testunit/metametameta.rb (renamed from tool/test/minitest/metametameta.rb)16
-rw-r--r--tool/test/testunit/test_assertion.rb2
-rw-r--r--tool/test/testunit/test_minitest_unit.rb (renamed from tool/test/minitest/test_minitest_unit.rb)547
-rw-r--r--tool/test/testunit/test_parallel.rb31
-rw-r--r--tool/test/testunit/test_redefinition.rb13
-rw-r--r--tool/test/testunit/test_sorting.rb57
-rw-r--r--tool/test/testunit/tests_for_parallel/test4test_hungup.rb15
-rw-r--r--tool/test/webrick/utils.rb2
-rw-r--r--transcode.c12
-rw-r--r--util.c7
-rw-r--r--variable.c54
-rw-r--r--variable.h1
-rw-r--r--version.c2
-rw-r--r--version.h5
-rw-r--r--vm.c97
-rw-r--r--vm_args.c4
-rw-r--r--vm_backtrace.c489
-rw-r--r--vm_callinfo.h7
-rw-r--r--vm_core.h5
-rw-r--r--vm_debug.h1
-rw-r--r--vm_dump.c50
-rw-r--r--vm_eval.c107
-rw-r--r--vm_exec.c1
-rw-r--r--vm_exec.h25
-rw-r--r--vm_insnhelper.c162
-rw-r--r--vm_method.c54
-rw-r--r--vm_trace.c54
-rw-r--r--win32/Makefile.sub17
-rwxr-xr-xwin32/configure.bat22
-rw-r--r--win32/win32.c23
972 files changed, 48739 insertions, 17102 deletions
diff --git a/appveyor.yml b/.appveyor.yml
index 351b7c70f0..9bc135873c 100644
--- a/appveyor.yml
+++ b/.appveyor.yml
@@ -6,6 +6,7 @@ init:
- git config --global core.autocrlf false
- git config --global core.eol lf
- git config --global advice.detachedHead 0
+shallow_clone: true
clone_depth: 10
platform:
- x64
@@ -48,7 +49,7 @@ for:
- echo>> Makefile RT_VER=0
- echo>> Makefile BUILTIN_ENCOBJS=nul
- type win32\Makefile.sub >> Makefile
- - nmake %mflags% up
+ - nmake %mflags% up VCSUP="echo Update OK"
- nmake %mflags% extract-extlibs
- del Makefile
- mkdir \usr\local\bin
diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644
index 0000000000..01897e986e
--- /dev/null
+++ b/.cirrus.yml
@@ -0,0 +1,63 @@
+# This CI is used to test Arm cases. We can set the maximum 16 tasks.
+# The entire testing design is inspired from .github/workflows/compilers.yml.
+
+# By default, Cirrus mounts an empty volume to `/tmp`
+# which triggers all sorts of warnings like "system temporary path is world-writable: /tmp".
+# Lets workaround it by specifying a custom volume mount point.
+env:
+ CIRRUS_VOLUME: /cirrus-ci-volume
+ LANG: C.UTF-8
+
+task:
+ name: Arm64 Graviton2 / $CC
+ arm_container:
+ # We use the arm64 images at http://ghcr.io/ruby/ruby-ci-image .
+ image: ghcr.io/ruby/ruby-ci-image:$CC
+ # Define the used cpu core in each matrix task. We can use total 16 cpu
+ # cores in entire matrix. [cpu] = [total cpu: 16] / [number of tasks]
+ cpu: 8
+ # We can request maximum 4 GB per cpu.
+ # [memory per task] = [memory per cpu: 4 GB] * [cpu]
+ memory: 32G
+ env:
+ CIRRUS_CLONE_DEPTH: 50
+ optflags: '-O1'
+ debugflags: '-ggdb3'
+ RUBY_PREFIX: /tmp/ruby-prefix
+ RUBY_DEBUG: ci rgengc
+ RUBY_TESTOPTS: >-
+ -q
+ --color=always
+ --tty=no
+ matrix:
+ CC: clang-12
+ CC: gcc-11
+ id_script: id
+ set_env_script:
+ # Set `GNUMAKEFLAGS`, because the flags are GNU make specific. Note using
+ # the `make` environment variable used in compilers.yml causes some rubygems
+ # tests to fail.
+ # https://github.com/rubygems/rubygems/issues/4921
+ - echo "GNUMAKEFLAGS=-s -j$((1 + $CIRRUS_CPU))" >> $CIRRUS_ENV
+ print_env_script:
+ - echo "GNUMAKEFLAGS=$GNUMAKEFLAGS"
+ # Arm containers are executed in AWS's EKS, and it's not yet supporting IPv6
+ # See https://github.com/aws/containers-roadmap/issues/835
+ disable_ipv6_script: sudo ./tool/disable_ipv6.sh
+ autogen_script: ./autogen.sh
+ configure_script: >-
+ ./configure -C
+ --enable-debug-env
+ --disable-install-doc
+ --with-ext=-test-/cxxanyargs,+
+ --prefix="$RUBY_PREFIX"
+ make_extract-extlibs_script: make extract-extlibs
+ make_incs_script: make incs
+ make_script: make
+ make_leaked-globals_script: make leaked-globals
+ make_test_script: make test
+ make_install_script: make install
+ install_gems_for_test_script: $RUBY_PREFIX/bin/gem install --no-doc timezone tzinfo
+ make_test-tool_script: make test-tool
+ make_test-all_script: make test-all
+ make_test-spec_script: make test-spec
diff --git a/.document b/.document
index 2c68af227d..6e08f42698 100644
--- a/.document
+++ b/.document
@@ -17,6 +17,7 @@ dir.rb
gc.rb
io.rb
kernel.rb
+marshal.rb
numeric.rb
nilclass.rb
pack.rb
diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml
index 7196708b21..91f82b842b 100644
--- a/.github/codeql/codeql-config.yml
+++ b/.github/codeql/codeql-config.yml
@@ -1,4 +1,3 @@
name: "CodeQL config for the Ruby language"
-paths-ignore:
- - '/ext/**/*/conftest.c'
+languages: cpp
diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml
index 11f71e0cdb..788ca8f474 100644
--- a/.github/workflows/baseruby.yml
+++ b/.github/workflows/baseruby.yml
@@ -15,6 +15,7 @@ jobs:
# - ruby-2.5
# - ruby-2.6
- ruby-2.7
+ - ruby-3.0
steps:
- uses: actions/checkout@v2
@@ -42,4 +43,4 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml
new file mode 100644
index 0000000000..d46c0704cd
--- /dev/null
+++ b/.github/workflows/bundled_gems.yml
@@ -0,0 +1,66 @@
+name: bundled_gems
+
+on:
+ schedule:
+ - cron: '45 6 * * *'
+
+jobs:
+ update:
+ if: ${{ github.repository == 'ruby/ruby' }}
+ name: update ${{ github.workflow }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: git config
+ run: |
+ git config --global advice.detachedHead 0
+ git config --global init.defaultBranch garbage
+
+ - name: Set ENV
+ run: |
+ echo "JOBS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
+
+ - uses: actions/checkout@v2
+
+ - name: Update ${{ github.workflow }}
+ run: |
+ ruby -i~ tool/update-bundled_gems.rb gems/${{ github.workflow }}
+
+ - name: Check diffs
+ id: diff
+ run: |
+ git diff --no-ext-diff --ignore-submodules --exit-code
+ continue-on-error: true
+
+ - name: Install libraries
+ run: |
+ set -x
+ sudo apt-get update -q || :
+ sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby
+ if: ${{ steps.diff.outcome == 'failure' }}
+
+ - name: Build
+ run: |
+ ./autogen.sh
+ ./configure -C --disable-install-doc
+ make $JOBS
+ if: ${{ steps.diff.outcome == 'failure' }}
+
+ - name: Test bundled gems
+ run: |
+ make $JOBS -s test-bundled-gems
+ timeout-minutes: 30
+ env:
+ RUBY_TESTOPTS: "-q --tty=no"
+ TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
+ if: ${{ steps.diff.outcome == 'failure' }}
+
+ - name: Commit
+ run: |
+ git commit --message="Update ${{ github.workflow }} at $(date +%F)" gems/${{ github.workflow }}
+ git pull --ff-only origin ${GITHUB_REF#refs/heads/}
+ git push origin ${GITHUB_REF#refs/heads/}
+ env:
+ EMAIL: svn-admin@ruby-lang.org
+ GIT_AUTHOR_NAME: git
+ GIT_COMMITTER_NAME: git
+ if: ${{ steps.diff.outcome == 'failure' }}
diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml
index 77227bb7f9..e6b4abbe98 100644
--- a/.github/workflows/check_dependencies.yml
+++ b/.github/workflows/check_dependencies.yml
@@ -4,7 +4,7 @@ jobs:
update-deps:
strategy:
matrix:
- os: [ubuntu-20.04, macos-latest]
+ os: [ubuntu-20.04, macos-11]
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
@@ -13,12 +13,12 @@ jobs:
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby
- if: "contains(matrix.os, 'ubuntu')"
+ if: ${{ contains(matrix.os, 'ubuntu') }}
- name: Install libraries
run: |
brew upgrade
brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline
- if: "contains(matrix.os, 'macos')"
+ if: ${{ contains(matrix.os, 'macos') }}
- name: git config
run: |
git config --global advice.detachedHead 0
@@ -42,4 +42,4 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index cffb12b2de..5897c5d37e 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -12,6 +12,9 @@ jobs:
# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest
+ env:
+ enable_install_doc: no
+
steps:
- name: Install libraries
run: |
@@ -21,8 +24,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- with:
- fetch-depth: 2
- name: Remove an obsolete rubygems vendored file
run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
@@ -30,9 +31,11 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
- languages: cpp
config-file: ./.github/codeql/codeql-config.yml
+ - name: Set ENV
+ run: echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
+
- name: Autobuild
uses: github/codeql-action/autobuild@v1
diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml
index ea19c016fa..6ddfba05db 100644
--- a/.github/workflows/compilers.yml
+++ b/.github/workflows/compilers.yml
@@ -3,15 +3,15 @@ name: Compilations
on: [push, pull_request]
# Github actions does not support YAML anchors. This creative use of
-# environment variables (plus the "echo ::set-env" hack) is to reroute that
+# environment variables (plus the "echo $GITHUB_ENV" hack) is to reroute that
# restriction.
env:
- default_cc: clang-13
+ default_cc: clang-14
append_cc: ''
crosshost: ''
# -O1 is faster than -O3 in our tests... Majority of time are consumed trying
- # to optimize binaries. Also Github Actions runs on a relatively modern CPU
+ # to optimize binaries. Also Github Actions run on relatively modern CPUs
# compared to, say, GCC 4 or Clang 3. We don't specify `-march=native`
# because compilers tend not understand what the CPU is.
optflags: '-O1'
@@ -55,6 +55,13 @@ jobs:
- { key: default_cc, name: gcc-6, value: gcc-6, container: gcc-6 }
- { key: default_cc, name: gcc-5, value: gcc-5, container: gcc-5 }
- { key: default_cc, name: gcc-4.8, value: gcc-4.8, container: gcc-4.8 }
+ - key: default_cc
+ name: 'gcc-11 LTO'
+ value: 'gcc-11 -O2 -flto=auto -ffat-lto-objects'
+ container: gcc-11
+ shared: '--disable-shared'
+ # check: true
+ - { key: default_cc, name: clang-14, value: clang-14, container: clang-14 }
- { key: default_cc, name: clang-13, value: clang-13, container: clang-13 }
- { key: default_cc, name: clang-12, value: clang-12, container: clang-12 }
- { key: default_cc, name: clang-11, value: clang-11, container: clang-11 }
@@ -66,6 +73,12 @@ jobs:
- { key: default_cc, name: clang-5.0, value: clang-5.0, container: clang-5.0 }
- { key: default_cc, name: clang-4.0, value: clang-4.0, container: clang-4.0 }
- { key: default_cc, name: clang-3.9, value: clang-3.9, container: clang-3.9 }
+ - key: default_cc
+ name: 'clang-14 LTO'
+ value: 'clang-14 -O2 -flto=auto'
+ container: clang-14
+ shared: '--disable-shared'
+ # check: true
- { key: crosshost, name: aarch64-linux-gnu, value: aarch64-linux-gnu, container: crossbuild-essential-arm64 }
# - { key: crosshost, name: arm-linux-gnueabi, value: arm-linux-gnueabi }
@@ -87,7 +100,7 @@ jobs:
- { key: CXXFLAGS, name: c++2a, value: '-std=c++2a -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }
- { key: optflags, name: '-O0', value: '-O0 -march=x86-64 -mtune=generic' }
-# - { key: optflags, name: '-O3', value: '-O3 -march=x86-64 -mtune=generic' }
+# - { key: optflags, name: '-O3', value: '-O3 -march=x86-64 -mtune=generic', check: true }
- { key: append_configure, name: gmp, value: '--with-gmp' }
- { key: append_configure, name: jemalloc, value: '--with-jemalloc' }
@@ -157,47 +170,43 @@ jobs:
name: ${{ matrix.entry.name }}
runs-on: ubuntu-latest
- container: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-13' }}
+ container:
+ image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-14' }}
+ options: --user root
steps:
+ - run: id
+ working-directory:
- run: mkdir build
working-directory:
- name: setenv
run: |
echo "${{ matrix.entry.key }}=${{ matrix.entry.value }}" >> $GITHUB_ENV
- echo "make=make -sj$((1 + $(nproc --all)))" >> $GITHUB_ENV
+ echo "GNUMAKEFLAGS=-sj$((1 + $(nproc --all)))" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
path: src
- run: ./autogen.sh
working-directory: src
- name: Run configure
- run: |
- if [ -n "${crosshost}" ]; then
- ../src/configure -C \
- ${default_configure} \
- ${append_configure} \
- --host="${crosshost}"
- else
- ../src/configure -C \
- ${default_configure} \
- ${append_configure} \
- --with-gcc="${default_cc} ${append_cc}"
- fi
- - run: $make extract-extlibs
- - run: $make incs
- - run: $make
- - run: $make leaked-globals
- - run: $make test
- - run: $make install
- if: "matrix.entry.name == '-O3'"
+ run: >
+ ../src/configure -C ${default_configure} ${append_configure}
+ ${{ matrix.entry.key == 'crosshost' && '--host="${crosshost}"' || '--with-gcc="${default_cc} ${append_cc}"' }}
+ ${{ matrix.entry.shared || '--enable-shared' }}
+ - run: make extract-extlibs
+ - run: make incs
+ - run: make
+ - run: make leaked-globals
+ - run: make test
+ - run: make install
+ if: ${{ matrix.entry.check }}
- run: /usr/local/bin/gem install --no-doc timezone tzinfo
- if: "matrix.entry.name == '-O3'"
- - run: $make test-tool
- if: "matrix.entry.name == '-O3'"
- - run: $make test-all TESTS='-- ruby -ext-'
- if: "matrix.entry.name == '-O3'"
- - run: $make test-spec
- if: "matrix.entry.name == '-O3'"
+ if: ${{ matrix.entry.check }}
+ - run: make test-tool
+ if: ${{ matrix.entry.check }}
+ - run: make test-all TESTS='-- ruby -ext-'
+ if: ${{ matrix.entry.check }}
+ - run: make test-spec
+ if: ${{ matrix.entry.check }}
- uses: k0kubun/action-slack@v2.0.0
with:
@@ -211,7 +220,7 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
defaults:
run:
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index b69b0fbe25..7c3f19f55b 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -2,13 +2,14 @@ name: macOS
on: [push, pull_request]
jobs:
make:
- runs-on: macos-latest
strategy:
matrix:
+ os: [macos-10.15, macos-11]
test_task: [ "check", "test-bundler-parallel" ] #, "test-bundled-gems" ] matrix tests has unknown issues
fail-fast: false
env:
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ runs-on: ${{ matrix.os }}
steps:
- run: mkdir build
working-directory:
@@ -34,11 +35,11 @@ jobs:
- run: make $JOBS incs
- run: make $JOBS
- run: make leaked-globals
- if: matrix.test_task == 'check'
+ if: ${{ matrix.test_task == 'check' }}
- run: make prepare-gems
- if: matrix.test_task == 'check'
+ if: ${{ matrix.test_task == 'check' }}
- run: make $JOBS -s ${{ matrix.test_task }}
- timeout-minutes: 60
+ timeout-minutes: ${{ matrix.test_task == 'check' && 15 || 40 }}
env:
RUBY_TESTOPTS: "-q --tty=no"
TEST_BUNDLED_GEMS_ALLOW_FAILURES: "rexml"
@@ -54,7 +55,7 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
defaults:
run:
diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index 6787f96b6d..7ccf5f0b61 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -8,8 +8,7 @@ jobs:
make:
runs-on: windows-2019
env:
- MSYSTEM: MINGW64
- MSYSTEM_PREFIX: /mingw64
+ MSYSTEM: ${{ matrix.msystem }}
MSYS2_ARCH: x86_64
CHOST: "x86_64-w64-mingw32"
CFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong"
@@ -20,7 +19,13 @@ jobs:
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
strategy:
matrix:
- test_task: [ "check" ] # to make job names consistent
+ include:
+ - msystem: "MINGW64"
+ base_ruby: 2.6
+ test_task: [ "check" ] # to make job names consistent
+ - msystem: "UCRT64"
+ base_ruby: head
+ test_task: [ "check" ] # to make job names consistent
fail-fast: false
steps:
- run: mkdir build
@@ -35,10 +40,11 @@ jobs:
with:
path: src
- name: Set up Ruby & MSYS2
- uses: MSP-Greg/setup-ruby-pkgs@v1
+ uses: MSP-Greg/setup-ruby-pkgs@ucrt
with:
- ruby-version: 2.6
- mingw: _upgrade_ gmp libffi libyaml openssl ragel readline
+ ruby-version: ${{ matrix.base_ruby }}
+ setup-ruby-ref: MSP-Greg/ruby-setup-ruby/00-win-ucrt
+ mingw: _upgrade_ gmp libffi libyaml openssl ragel readline gcc
msys2: automake1.16 bison
- name: where check
run: |
@@ -81,7 +87,7 @@ jobs:
make -j $jobs update-gems
- name: make all
- timeout-minutes: 40
+ timeout-minutes: 20
run: |
$jobs = [int](2 * $env:NUMBER_OF_PROCESSORS)
make -j $jobs
@@ -102,7 +108,7 @@ jobs:
make test
- name: test-all
- timeout-minutes: 60
+ timeout-minutes: 30
run: |
# Actions uses UTF8, causes test failures, similar to normal OS setup
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
@@ -136,7 +142,7 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
defaults:
run:
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index 99282cf591..63011e78d0 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -70,7 +70,7 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
defaults:
run:
diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml
index f921d66c75..61ebeb33c1 100644
--- a/.github/workflows/spec_guards.yml
+++ b/.github/workflows/spec_guards.yml
@@ -35,4 +35,4 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index f7b07ca80b..e148b76cbe 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -48,13 +48,13 @@ jobs:
- run: make $JOBS incs
- run: make $JOBS
- run: make leaked-globals
- if: matrix.test_task == 'check'
+ if: ${{ matrix.test_task == 'check' }}
- run: make prepare-gems
- if: matrix.test_task == 'check'
+ if: ${{ matrix.test_task == 'check' }}
- name: Create dummy files in build dir
run: |
./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
- if: matrix.test_task == 'check'
+ if: ${{ matrix.test_task == 'check' }}
- run: make $JOBS -s ${{ matrix.test_task }}
timeout-minutes: 30
env:
@@ -72,7 +72,7 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
defaults:
run:
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index fdcccff11a..66b2992049 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -4,18 +4,34 @@ jobs:
make:
strategy:
matrix:
- test_task: [check] # to make job names consistent
- os: [windows-2019]
- vs: [2019]
+ include:
+ - vs: 2019
+ os: windows-2019
+ vcvars: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"'
+ # - vs: 2022
+ # os: windows-2022
+ # vcvars: '"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvars64.bat"'
fail-fast: false
runs-on: ${{ matrix.os }}
+ name: VisualStudio ${{ matrix.vs }}
env:
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
- VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat
+ VCVARS: ${{ matrix.vcvars }}
PATCH: C:\msys64\usr\bin\patch.exe
steps:
- run: md build
working-directory:
+ - uses: msys2/setup-msys2@v2
+ id: setup-msys2
+ with:
+ update: true
+ install: >-
+ patch
+ if: ${{ matrix.os != 'windows-2019' }}
+ - name: patch path
+ shell: msys2 {0}
+ run: echo PATCH=$(cygpath -wa $(command -v patch)) >> $GITHUB_ENV
+ if: ${{ steps.setup-msys2.outcome == 'success' }}
- uses: actions/cache@v2
with:
path: C:\vcpkg\downloads
@@ -49,50 +65,58 @@ jobs:
- uses: actions/checkout@v2
with:
path: src
+ - name: setup env
+ # %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
+ # https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
+ run: |
+ set | C:\msys64\usr\bin\sort > old.env
+ call %VCVARS%
+ set TMP=%USERPROFILE%\AppData\Local\Temp
+ set TEMP=%USERPROFILE%\AppData\Local\Temp
+ set | C:\msys64\usr\bin\sort > new.env
+ C:\msys64\usr\bin\comm -13 old.env new.env >> %GITHUB_ENV%
+ del *.env
- name: Configure
run: |
- call "%VCVARS%"
../src/win32/configure.bat --disable-install-doc --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows --with-openssl-dir="C:/Program Files/OpenSSL-Win64"
- name: nmake
run: |
- call "%VCVARS%"
- set YACC=win_bison
- echo on
+ echo ^#^#[group]incs
nmake incs
+ echo ^#^#[endgroup]
+ echo ^#^#[group]extract-extlibs
nmake extract-extlibs
+ echo ^#^#[endgroup]
nmake
+ env:
+ YACC: win_bison
- name: nmake test
timeout-minutes: 5
run: |
- call "%VCVARS%"
nmake test
- name: nmake test-all
timeout-minutes: 60
run: |
- call "%VCVARS%"
- ::- %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
- ::- https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
- set TMP=%USERPROFILE%\AppData\Local\Temp
- set TEMP=%USERPROFILE%\AppData\Local\Temp
- nmake test-all
+ nmake test-all TESTOPTS="-j%NUMBER_OF_PROCESSORS% --job-status=normal"
+ continue-on-error: ${{ matrix.continue-on-error || false }}
- name: nmake test-spec
timeout-minutes: 10
run: |
- call "%VCVARS%"
nmake test-spec
+ continue-on-error: ${{ matrix.continue-on-error || false }}
- uses: k0kubun/action-slack@v2.0.0
with:
payload: |
{
"ci": "GitHub Actions",
- "env": "${{ matrix.os }} / ${{ matrix.test_task }}",
+ "env": "VS${{ matrix.vs }} / ${{ matrix.test_task || 'check' }}",
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"commit": "${{ github.sha }}",
"branch": "${{ github.ref }}".split('/').reverse()[0]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: failure() && github.event_name == 'push'
+ if: ${{ failure() && github.event_name == 'push' }}
defaults:
run:
diff --git a/.travis.yml b/.travis.yml
index ff0ce6911e..c47de4b80a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,10 @@ cache:
env:
global:
+ # The tests skipped in `make test-all`.
+ - TEST_ALL_SKIPPED_TESTS=
+ # The tests executed separately by `make test-all`.
+ - TEST_ALL_SEPARATED_TESTS=
# Reset timestamps early
- _=$(touch NEWS && find . -type f -exec touch -r NEWS {} +)
- CONFIGURE_TTY=no
@@ -38,12 +42,6 @@ env:
- SETARCH=
- RUBY_PREFIX=/tmp/ruby-prefix
- GEMS_FOR_TEST='timezone tzinfo'
- # The tests skipped in `make test-all`.
- - TEST_ALL_SKIPPED_TESTS=
- # Run the separated tests with allowing failures.
- - RUN_SEPARATED_TESTS=true
- # The tests executed separately by `make test-all`.
- - TEST_ALL_SEPARATED_TESTS=
# https://github.com/travis-ci/travis-build/blob/e411371dda21430a60f61b8f3f57943d2fe4d344/lib/travis/build/bash/travis_apt_get_options.bash#L7
- travis_apt_get_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages'
- travis_apt_get_options="-yq --no-install-suggests --no-install-recommends $travis_apt_get_options"
@@ -97,6 +95,9 @@ env:
compiler: arm-linux-gnueabihf-gcc
env:
- SETARCH='setarch linux32 --verbose --32bit'
+ # The "TestReadline#test_interrupt_in_other_thread" started failing on arm32
+ # from https://www.travis-ci.com/github/ruby/ruby/jobs/529005145
+ - TEST_ALL_SKIPPED_TESTS=test_interrupt_in_other_thread
before_install:
- sudo dpkg --add-architecture armhf
- tool/travis_retry.sh sudo bash -c "rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && exec apt-get update -yq"
@@ -119,15 +120,16 @@ matrix:
include:
# Build every commit (Allowed Failures):
- <<: *arm32-linux
- - <<: *arm64-linux
+ # Comment out as the 2nd arm64 pipeline is unstable.
+ # - <<: *arm64-linux
- <<: *ppc64le-linux
- <<: *s390x-linux
allow_failures:
- # An arm64 job sometimes does not start right now.
- # https://travis-ci.community/t/11629
- - name: arm32-linux
- - name: arm64-linux
- # - name: ppc64le-linux
+ # - name: arm32-linux
+ # - name: arm64-linux
+ # We see "Some worker was crashed." in about 40% of recent ppc64le-linux jobs
+ # e.g. https://app.travis-ci.com/github/ruby/ruby/jobs/530959548
+ - name: ppc64le-linux
# - name: s390x-linux
fast_finish: true
@@ -197,7 +199,7 @@ script:
# Run the failing tests separately returning ok status to check if it works,
# visualize them.
- |
- if [ "${RUN_SEPARATED_TESTS}" = true -a -n "${TEST_ALL_OPTS_SEPARATED}" ]; then
+ if [ -n "${TEST_ALL_OPTS_SEPARATED}" ]; then
$SETARCH make -s test-all -o exts TESTOPTS="$JOBS -v --tty=no ${TEST_ALL_OPTS_SEPARATED}" RUBYOPT="-w" || :
fi
- $SETARCH make -s test-spec MSPECOPT=-ff # not using `-j` because sometimes `mspec -j` silently dies
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c112806acf..7363c106a2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,5 +1,5 @@
Please see the [official issue tracker], [doc/contributing.rdoc] and wiki [HowToContribute].
[official issue tracker]: https://bugs.ruby-lang.org
-[doc/contributing.rdoc]: doc/contributing.rdoc
+[doc/contributing.rdoc]: contributing.rdoc
[HowToContribute]: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute
diff --git a/LEGAL b/LEGAL
index ecd1e16050..57804508eb 100644
--- a/LEGAL
+++ b/LEGAL
@@ -343,6 +343,34 @@ mentioned below.
program. This Exception is an additional permission under section 7
of the GNU General Public License, version 3 ("GPLv3").
+[tool/lib/test/*]
+[tool/lib/core_assertions.rb]
+
+ Some of methods on these files are based on MiniTest 4. MiniTest 4 is
+ distributed under the MIT License.
+
+ >>>
+ Copyright (c) Ryan Davis, seattle.rb
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
[parse.c]
[parse.h]
@@ -440,7 +468,8 @@ mentioned below.
>>>
A C-program for MT19937, with initialization improved 2002/2/10.::
- Coded by Takuji Nishimura and Makoto Matsumoto.
+ Coded by Takuji Nishimura and Makoto Matsumoto.
+
This is a faster version by taking Shawn Cokus's optimization,
Matthe Bellew's simplification, Isaku Wada's real version.
@@ -532,10 +561,7 @@ mentioned below.
[missing/acosh.c]
[missing/alloca.c]
[missing/erf.c]
-[missing/finite.c]
[missing/hypot.c]
-[missing/isinf.c]
-[missing/isnan.c]
[missing/lgamma_r.c]
[missing/memcmp.c]
[missing/memmove.c]
diff --git a/NEWS.md b/NEWS.md
index 7d8089524c..2b71603ea5 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -33,41 +33,54 @@ Note that each entry is kept to a minimum, see links for details.
foo[0] = bar
```
- The following evaluation order is used:
+ The following evaluation order is used:
- 1. `foo`
- 2. `bar`
- 3. `[]=` called on the result of `foo`
+ 1. `foo`
+ 2. `bar`
+ 3. `[]=` called on the result of `foo`
- In Ruby before 3.1.0, multiple assignment did not follow this
- evaluation order. With this code:
+ In Ruby before 3.1.0, multiple assignment did not follow this
+ evaluation order. With this code:
- ```ruby
- foo[0], bar.baz = a, b
- ```
+ ```ruby
+ foo[0], bar.baz = a, b
+ ```
+
+ Versions of Ruby before 3.1.0 would evaluate in the following
+ order
+
+ 1. `a`
+ 2. `b`
+ 3. `foo`
+ 4. `[]=` called on the result of `foo`
+ 5. `bar`
+ 6. `baz=` called on the result of `bar`
- Versions of Ruby before 3.1.0 would evaluate in the following
- order
+ Starting in Ruby 3.1.0, evaluation order is now consistent with
+ single assignment, with the left hand side being evaluated before
+ the right hand side:
- 1. `a`
- 2. `b`
- 3. `foo`
- 4. `[]=` called on the result of `foo`
- 5. `bar`
- 6. `baz=` called on the result of `bar`
+ 1. `foo`
+ 2. `bar`
+ 3. `a`
+ 4. `b`
+ 5. `[]=` called on the result of `foo`
+ 6. `baz=` called on the result of `bar`
- Starting in Ruby 3.1.0, evaluation order is now consistent with
- single assignment, with the left hand side being evaluated before
- the right hand side:
+ [[Bug #4443]]
- 1. `foo`
- 2. `bar`
- 3. `a`
- 4. `b`
- 5. `[]=` called on the result of `foo`
- 6. `baz=` called on the result of `bar`
+* Values in Hash literals and keyword arguments can be omitted.
+ [[Feature #14579]]
- [[Bug #4443]]
+ For example,
+
+ * `{x:, y:}` is a syntax sugar of `{x: x, y: y}`.
+ * `foo(x:, y:)` is a syntax sugar of `foo(x: x, y: y)`.
+
+ Constant names, local variable names, and method names are allowed as
+ key names. Note that a reserved word is considered as a local
+ variable or method name even if it's a pseudo variable name such as
+ `self`.
## Command line options
@@ -98,6 +111,12 @@ Outstanding ones only.
* Integer.try_convert is added. [[Feature #15211]]
+* MatchData
+
+ * MatchData#match is added [[Feature #18172]]
+
+ * MatchData#match_length is added [[Feature #18172]]
+
* Module
* Module#prepend now modifies the ancestor chain if the receiver
@@ -113,6 +132,11 @@ Outstanding ones only.
* StructClass#keyword_init? is added [[Feature #18008]]
+* String
+
+ * Update Unicode version to 13.0.0 [[Feature #17750]]
+ and Emoji version to 13.0 [[Feature #18029]]
+
* Queue
* Queue#initialize now accepts an Enumerable of initial values.
@@ -167,15 +191,23 @@ Excluding feature bug fixes.
## C API updates
+* Documented. [[GH-4815]]
+
## Implementation improvements
### JIT
* The default `--jit-max-cache` is changed from 100 to 10000.
+* JIT-ed code is no longer cancelled when a TracePoint for class events
+ is enabled.
+
* The JIT compiler no longer skips compilation of methods longer than
1000 instructions.
+* `--jit-verbose` and `--jit-warning` output "JIT cancel" when JIT-ed
+ code is disabled because TracePoint or GC.compact is used.
+
* `RubyVM::MJIT` is renamed to `RubyVM::JIT`. [[Feature #17490]]
## Static analysis
@@ -199,6 +231,7 @@ Excluding feature bug fixes.
[Bug #4443]: https://bugs.ruby-lang.org/issues/4443
[Feature #12194]: https://bugs.ruby-lang.org/issues/12194
[Feature #14256]: https://bugs.ruby-lang.org/issues/14256
+[Feature #14579]: https://bugs.ruby-lang.org/issues/14579
[Feature #15198]: https://bugs.ruby-lang.org/issues/15198
[Feature #15211]: https://bugs.ruby-lang.org/issues/15211
[Feature #16043]: https://bugs.ruby-lang.org/issues/16043
@@ -216,6 +249,11 @@ Excluding feature bug fixes.
[Bug #18003]: https://bugs.ruby-lang.org/issues/18003
[Feature #17370]: https://bugs.ruby-lang.org/issues/17370
[Feature #17470]: https://bugs.ruby-lang.org/issues/17470
+[Feature #17750]: https://bugs.ruby-lang.org/issues/17750
[Feature #17853]: https://bugs.ruby-lang.org/issues/17853
[Bug #17827]: https://bugs.ruby-lang.org/issues/17827
+[Feature #18008]: https://bugs.ruby-lang.org/issues/18008
[Feature #18015]: https://bugs.ruby-lang.org/issues/18015
+[Feature #18029]: https://bugs.ruby-lang.org/issues/18029
+[Feature #18172]: https://bugs.ruby-lang.org/issues/18172
+[GH-4815]: https://github.com/ruby/ruby/pull/4815
diff --git a/README.md b/README.md
index 5d225fdfa1..8d23de8b7a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,8 @@
[![Actions Status: Ubuntu](https://github.com/ruby/ruby/workflows/Ubuntu/badge.svg)](https://github.com/ruby/ruby/actions?query=workflow%3A"Ubuntu")
[![Actions Status: Windows](https://github.com/ruby/ruby/workflows/Windows/badge.svg)](https://github.com/ruby/ruby/actions?query=workflow%3A"Windows")
[![AppVeyor status](https://ci.appveyor.com/api/projects/status/0sy8rrxut4o0k960/branch/master?svg=true)](https://ci.appveyor.com/project/ruby/ruby/branch/master)
-[![Travis Status](https://www.travis-ci.com/ruby/ruby.svg?branch=master)](https://www.travis-ci.com/ruby/ruby)
+[![Travis Status](https://app.travis-ci.com/ruby/ruby.svg?branch=master)](https://app.travis-ci.com/ruby/ruby)
+[![Cirrus Status](https://api.cirrus-ci.com/github/ruby/ruby.svg)](https://cirrus-ci.com/github/ruby/ruby/master)
# What's Ruby
diff --git a/addr2line.c b/addr2line.c
index 8ee4416650..d99102407d 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -192,12 +192,12 @@ struct debug_section_definition {
static char binary_filename[PATH_MAX + 1];
static unsigned long
-uleb128(char **p)
+uleb128(const char **p)
{
unsigned long r = 0;
int s = 0;
for (;;) {
- unsigned char b = *(unsigned char *)(*p)++;
+ unsigned char b = (unsigned char)*(*p)++;
if (b < 0x80) {
r += (unsigned long)b << s;
break;
@@ -209,12 +209,12 @@ uleb128(char **p)
}
static long
-sleb128(char **p)
+sleb128(const char **p)
{
long r = 0;
int s = 0;
for (;;) {
- unsigned char b = *(unsigned char *)(*p)++;
+ unsigned char b = (unsigned char)*(*p)++;
if (b < 0x80) {
if (b & 0x40) {
r -= (0x80 - b) << s;
@@ -231,7 +231,7 @@ sleb128(char **p)
}
static const char *
-get_nth_dirname(unsigned long dir, char *p)
+get_nth_dirname(unsigned long dir, const char *p)
{
if (!dir--) {
return "";
@@ -249,11 +249,11 @@ get_nth_dirname(unsigned long dir, char *p)
}
static void
-fill_filename(int file, char *include_directories, char *filenames, line_info_t *line, obj_info_t *obj)
+fill_filename(int file, const char *include_directories, const char *filenames, line_info_t *line, obj_info_t *obj)
{
int i;
- char *p = filenames;
- char *filename;
+ const char *p = filenames;
+ const char *filename;
unsigned long dir;
for (i = 1; i <= file; i++) {
filename = p;
@@ -280,7 +280,7 @@ fill_filename(int file, char *include_directories, char *filenames, line_info_t
static void
fill_line(int num_traces, void **traces, uintptr_t addr, int file, int line,
- char *include_directories, char *filenames,
+ const char *include_directories, const char *filenames,
obj_info_t *obj, line_info_t *lines, int offset)
{
int i;
@@ -374,7 +374,7 @@ parse_debug_line_header(const char **pp, struct LineNumberProgramHeader *header)
}
static int
-parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
+parse_debug_line_cu(int num_traces, void **traces, const char **debug_line,
obj_info_t *obj, line_info_t *lines, int offset)
{
const char *p = (const char *)*debug_line;
@@ -399,8 +399,8 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
#define FILL_LINE() \
do { \
fill_line(num_traces, traces, addr, file, line, \
- (char *)header.include_directories, \
- (char *)header.filenames, \
+ header.include_directories, \
+ header.filenames, \
obj, lines, offset); \
/*basic_block = prologue_end = epilogue_begin = 0;*/ \
} while (0)
@@ -413,19 +413,19 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
FILL_LINE();
break;
case DW_LNS_advance_pc:
- a = uleb128((char **)&p) * header.minimum_instruction_length;
+ a = uleb128(&p) * header.minimum_instruction_length;
addr += a;
break;
case DW_LNS_advance_line: {
- long a = sleb128((char **)&p);
+ long a = sleb128(&p);
line += a;
break;
}
case DW_LNS_set_file:
- file = (unsigned int)uleb128((char **)&p);
+ file = (unsigned int)uleb128(&p);
break;
case DW_LNS_set_column:
- /*column = (unsigned int)*/(void)uleb128((char **)&p);
+ /*column = (unsigned int)*/(void)uleb128(&p);
break;
case DW_LNS_negate_stmt:
is_stmt = !is_stmt;
@@ -450,10 +450,10 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
/* epilogue_begin = 1; */
break;
case DW_LNS_set_isa:
- /* isa = (unsigned int)*/(void)uleb128((char **)&p);
+ /* isa = (unsigned int)*/(void)uleb128(&p);
break;
case 0:
- a = uleb128((char **)&p);
+ a = uleb128(&p);
op = *p++;
switch (op) {
case DW_LNE_end_sequence:
@@ -477,7 +477,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
break;
case DW_LNE_set_discriminator:
/* TODO:currently ignore */
- uleb128((char **)&p);
+ uleb128(&p);
break;
default:
kprintf("Unknown extended opcode: %d in %s\n",
@@ -500,10 +500,10 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
static int
parse_debug_line(int num_traces, void **traces,
- char *debug_line, unsigned long size,
+ const char *debug_line, unsigned long size,
obj_info_t *obj, line_info_t *lines, int offset)
{
- char *debug_line_end = debug_line + size;
+ const char *debug_line_end = debug_line + size;
while (debug_line < debug_line_end) {
if (parse_debug_line_cu(num_traces, traces, &debug_line, obj, lines, offset))
return -1;
@@ -833,21 +833,21 @@ enum {
# define ABBREV_TABLE_SIZE 256
typedef struct {
obj_info_t *obj;
- char *file;
- char *current_cu;
+ const char *file;
+ const char *current_cu;
uint64_t current_low_pc;
- char *debug_line_cu_end;
- char *debug_line_files;
- char *debug_line_directories;
- char *p;
- char *cu_end;
- char *pend;
- char *q0;
- char *q;
+ const char *debug_line_cu_end;
+ const char *debug_line_files;
+ const char *debug_line_directories;
+ const char *p;
+ const char *cu_end;
+ const char *pend;
+ const char *q0;
+ const char *q;
int format; // 4 or 8
uint8_t address_size;
int level;
- char *abbrev_table[ABBREV_TABLE_SIZE];
+ const char *abbrev_table[ABBREV_TABLE_SIZE];
} DebugInfoReader;
typedef struct {
@@ -858,7 +858,7 @@ typedef struct {
typedef struct {
union {
- char *ptr;
+ const char *ptr;
uint64_t uint64;
int64_t int64;
} as;
@@ -891,39 +891,39 @@ get_uint64(const uint8_t *p)
}
static uint8_t
-read_uint8(char **ptr)
+read_uint8(const char **ptr)
{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 1);
- return *p;
+ const char *p = *ptr;
+ *ptr = (p + 1);
+ return (uint8_t)*p;
}
static uint16_t
-read_uint16(char **ptr)
+read_uint16(const char **ptr)
{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 2);
- return get_uint16(p);
+ const char *p = *ptr;
+ *ptr = (p + 2);
+ return get_uint16((const uint8_t *)p);
}
static uint32_t
-read_uint24(char **ptr)
+read_uint24(const char **ptr)
{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 3);
- return (*p << 16) | get_uint16(p+1);
+ const char *p = *ptr;
+ *ptr = (p + 3);
+ return ((uint8_t)*p << 16) | get_uint16((const uint8_t *)p+1);
}
static uint32_t
-read_uint32(char **ptr)
+read_uint32(const char **ptr)
{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 4);
- return get_uint32(p);
+ const char *p = *ptr;
+ *ptr = (p + 4);
+ return get_uint32((const uint8_t *)p);
}
static uint64_t
-read_uint64(char **ptr)
+read_uint64(const char **ptr)
{
const unsigned char *p = (const unsigned char *)*ptr;
*ptr = (char *)(p + 8);
@@ -931,7 +931,7 @@ read_uint64(char **ptr)
}
static uintptr_t
-read_uintptr(char **ptr)
+read_uintptr(const char **ptr)
{
const unsigned char *p = (const unsigned char *)*ptr;
*ptr = (char *)(p + SIZEOF_VOIDP);
@@ -976,7 +976,7 @@ debug_info_reader_init(DebugInfoReader *reader, obj_info_t *obj)
}
static void
-di_skip_die_attributes(char **p)
+di_skip_die_attributes(const char **p)
{
for (;;) {
uint64_t at = uleb128(p);
@@ -996,7 +996,7 @@ static void
di_read_debug_abbrev_cu(DebugInfoReader *reader)
{
uint64_t prev = 0;
- char *p = reader->q0;
+ const char *p = reader->q0;
for (;;) {
uint64_t abbrev_number = uleb128(&p);
if (abbrev_number <= prev) break;
@@ -1042,7 +1042,7 @@ set_int_value(DebugInfoValue *v, int64_t n)
}
static void
-set_cstr_value(DebugInfoValue *v, char *s)
+set_cstr_value(DebugInfoValue *v, const char *s)
{
v->as.ptr = s;
v->off = 0;
@@ -1050,7 +1050,7 @@ set_cstr_value(DebugInfoValue *v, char *s)
}
static void
-set_cstrp_value(DebugInfoValue *v, char *s, uint64_t off)
+set_cstrp_value(DebugInfoValue *v, const char *s, uint64_t off)
{
v->as.ptr = s;
v->off = off;
@@ -1058,7 +1058,7 @@ set_cstrp_value(DebugInfoValue *v, char *s, uint64_t off)
}
static void
-set_data_value(DebugInfoValue *v, char *s)
+set_data_value(DebugInfoValue *v, const char *s)
{
v->as.ptr = s;
v->type = VAL_data;
@@ -1138,12 +1138,12 @@ debug_info_reader_read_value(DebugInfoReader *reader, uint64_t form, DebugInfoVa
set_uint_value(v, read_uleb128(reader));
break;
case DW_FORM_ref_addr:
- if (reader->address_size == 4) {
+ if (reader->format == 4) {
set_uint_value(v, read_uint32(&reader->p));
- } else if (reader->address_size == 8) {
+ } else if (reader->format == 8) {
set_uint_value(v, read_uint64(&reader->p));
} else {
- fprintf(stderr,"unknown address_size:%d", reader->address_size);
+ fprintf(stderr,"unknown format:%d", reader->format);
abort();
}
break;
@@ -1259,10 +1259,10 @@ debug_info_reader_read_value(DebugInfoReader *reader, uint64_t form, DebugInfoVa
}
/* find abbrev in current compilation unit */
-static char *
+static const char *
di_find_abbrev(DebugInfoReader *reader, uint64_t abbrev_number)
{
- char *p;
+ const char *p;
if (abbrev_number < ABBREV_TABLE_SIZE) {
return reader->abbrev_table[abbrev_number];
}
@@ -1313,10 +1313,10 @@ div_inspect(DebugInfoValue *v)
{
switch (v->type) {
case VAL_uint:
- fprintf(stderr,"%d: type:%d size:%zx v:%lx\n",__LINE__,v->type,v->size,v->as.uint64);
+ fprintf(stderr,"%d: type:%d size:%zx v:%"PRIx64"\n",__LINE__,v->type,v->size,v->as.uint64);
break;
case VAL_int:
- fprintf(stderr,"%d: type:%d size:%zx v:%ld\n",__LINE__,v->type,v->size,(int64_t)v->as.uint64);
+ fprintf(stderr,"%d: type:%d size:%zx v:%"PRId64"\n",__LINE__,v->type,v->size,(int64_t)v->as.uint64);
break;
case VAL_cstr:
fprintf(stderr,"%d: type:%d size:%zx v:'%s'\n",__LINE__,v->type,v->size,v->as.ptr);
@@ -1407,13 +1407,13 @@ ranges_set(ranges_t *ptr, DebugInfoValue *v)
}
static uint64_t
-read_dw_form_addr(DebugInfoReader *reader, char **ptr)
+read_dw_form_addr(DebugInfoReader *reader, const char **ptr)
{
- char *p = *ptr;
- *ptr = p + reader->format;
- if (reader->format == 4) {
+ const char *p = *ptr;
+ *ptr = p + reader->address_size;
+ if (reader->address_size == 4) {
return read_uint32(&p);
- } else if (reader->format == 8) {
+ } else if (reader->address_size == 8) {
return read_uint64(&p);
} else {
fprintf(stderr,"unknown address_size:%d", reader->address_size);
@@ -1434,18 +1434,19 @@ ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
}
else if (ptr->ranges_set) {
/* TODO: support base address selection entry */
- char *p;
+ const char *p;
uint64_t base = ptr->low_pc_set ? ptr->low_pc : reader->current_low_pc;
+ bool base_valid = true;
if (reader->obj->debug_rnglists.ptr) {
p = reader->obj->debug_rnglists.ptr + ptr->ranges;
for (;;) {
uint8_t rle = read_uint8(&p);
- uintptr_t base_address = 0;
- uintptr_t from, to;
+ uintptr_t from = 0, to = 0;
if (rle == DW_RLE_end_of_list) break;
switch (rle) {
case DW_RLE_base_addressx:
uleb128(&p);
+ base_valid = false; /* not supported yet */
break;
case DW_RLE_startx_endx:
uleb128(&p);
@@ -1456,24 +1457,26 @@ ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
uleb128(&p);
break;
case DW_RLE_offset_pair:
- from = base_address + uleb128(&p);
- to = base_address + uleb128(&p);
- if (base + from <= addr && addr < base + to) {
- return from;
- }
+ if (!base_valid) break;
+ from = (uintptr_t)base + uleb128(&p);
+ to = (uintptr_t)base + uleb128(&p);
break;
case DW_RLE_base_address:
- base_address = (uintptr_t)read_dw_form_addr(reader, &p);
+ base = read_dw_form_addr(reader, &p);
+ base_valid = true;
break;
case DW_RLE_start_end:
- read_dw_form_addr(reader, &p);
- read_dw_form_addr(reader, &p);
+ from = (uintptr_t)read_dw_form_addr(reader, &p);
+ to = (uintptr_t)read_dw_form_addr(reader, &p);
break;
case DW_RLE_start_length:
- read_dw_form_addr(reader, &p);
- uleb128(&p);
+ from = (uintptr_t)read_dw_form_addr(reader, &p);
+ to = from + uleb128(&p);
break;
}
+ if (from <= addr && addr < to) {
+ return from;
+ }
}
return false;
}
@@ -1487,7 +1490,7 @@ ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
base = to;
}
else if (base + from <= addr && addr < base + to) {
- return from;
+ return (uintptr_t)base + from;
}
}
}
@@ -1593,14 +1596,31 @@ di_read_cu(DebugInfoReader *reader)
}
static void
-read_abstract_origin(DebugInfoReader *reader, uint64_t abstract_origin, line_info_t *line)
+read_abstract_origin(DebugInfoReader *reader, uint64_t form, uint64_t abstract_origin, line_info_t *line)
{
- char *p = reader->p;
- char *q = reader->q;
+ const char *p = reader->p;
+ const char *q = reader->q;
int level = reader->level;
DIE die;
- reader->p = reader->current_cu + abstract_origin;
+ switch (form) {
+ case DW_FORM_ref1:
+ case DW_FORM_ref2:
+ case DW_FORM_ref4:
+ case DW_FORM_ref8:
+ case DW_FORM_ref_udata:
+ reader->p = reader->current_cu + abstract_origin;
+ break;
+ case DW_FORM_ref_addr:
+ goto finish; /* not supported yet */
+ case DW_FORM_ref_sig8:
+ goto finish; /* not supported yet */
+ case DW_FORM_ref_sup4:
+ case DW_FORM_ref_sup8:
+ goto finish; /* not supported yet */
+ default:
+ goto finish;
+ }
if (!di_read_die(reader, &die)) goto finish;
/* enumerate abbrev */
@@ -1665,7 +1685,7 @@ debug_info_read(DebugInfoReader *reader, int num_traces, void **traces,
/* 1 or 3 */
break; /* goto skip_die; */
case DW_AT_abstract_origin:
- read_abstract_origin(reader, v.as.uint64, &line);
+ read_abstract_origin(reader, v.form, v.as.uint64, &line);
break; /* goto skip_die; */
}
}
@@ -2170,7 +2190,7 @@ fail:
#endif
#define HAVE_MAIN_EXE_PATH
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
# include <sys/sysctl.h>
#endif
/* ssize_t main_exe_path(void)
@@ -2193,7 +2213,7 @@ main_exe_path(void)
binary_filename[len] = 0;
return len;
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
static ssize_t
main_exe_path(void)
{
diff --git a/array.c b/array.c
index 36f712bcac..cef48d3336 100644
--- a/array.c
+++ b/array.c
@@ -2234,14 +2234,6 @@ rb_ary_set_len(VALUE ary, long len)
ARY_SET_LEN(ary, len);
}
-/*!
- * expands or shrinks \a ary to \a len elements.
- * expanded region will be filled with Qnil.
- * \param ary an array
- * \param len new size
- * \return \a ary
- * \post the size of \a ary is \a len.
- */
VALUE
rb_ary_resize(VALUE ary, long len)
{
@@ -2668,9 +2660,7 @@ rb_ary_length(VALUE ary)
static VALUE
rb_ary_empty_p(VALUE ary)
{
- if (RARRAY_LEN(ary) == 0)
- return Qtrue;
- return Qfalse;
+ return RBOOL(RARRAY_LEN(ary) == 0);
}
VALUE
@@ -3432,89 +3422,8 @@ static VALUE rb_ary_bsearch_index(VALUE ary);
* array.bsearch -> new_enumerator
*
* Returns an element from +self+ selected by a binary search.
- * +self+ should be sorted, but this is not checked.
- *
- * By using binary search, finds a value from this array which meets
- * the given condition in <tt>O(log n)</tt> where +n+ is the size of the array.
- *
- * There are two search modes:
- * - <b>Find-minimum mode</b>: the block should return +true+ or +false+.
- * - <b>Find-any mode</b>: the block should return a numeric value.
- *
- * The block should not mix the modes by and sometimes returning +true+ or +false+
- * and sometimes returning a numeric value, but this is not checked.
- *
- * <b>Find-Minimum Mode</b>
*
- * In find-minimum mode, the block always returns +true+ or +false+.
- * The further requirement (though not checked) is that
- * there are no indexes +i+ and +j+ such that:
- * - <tt>0 <= i < j <= self.size</tt>.
- * - The block returns +true+ for <tt>self[i]</tt> and +false+ for <tt>self[j]</tt>.
- *
- * In find-minimum mode, method bsearch returns the first element for which the block returns true.
- *
- * Examples:
- * a = [0, 4, 7, 10, 12]
- * a.bsearch {|x| x >= 4 } # => 4
- * a.bsearch {|x| x >= 6 } # => 7
- * a.bsearch {|x| x >= -1 } # => 0
- * a.bsearch {|x| x >= 100 } # => nil
- *
- * Less formally: the block is such that all +false+-evaluating elements
- * precede all +true+-evaluating elements.
- *
- * These make sense as blocks in find-minimum mode:
- * a = [0, 4, 7, 10, 12]
- * a.map {|x| x >= 4 } # => [false, true, true, true, true]
- * a.map {|x| x >= 6 } # => [false, false, true, true, true]
- * a.map {|x| x >= -1 } # => [true, true, true, true, true]
- * a.map {|x| x >= 100 } # => [false, false, false, false, false]
- *
- * This would not make sense:
- * a = [0, 4, 7, 10, 12]
- * a.map {|x| x == 7 } # => [false, false, true, false, false]
- *
- * <b>Find-Any Mode</b>
- *
- * In find-any mode, the block always returns a numeric value.
- * The further requirement (though not checked) is that
- * there are no indexes +i+ and +j+ such that:
- * - <tt>0 <= i < j <= self.size</tt>.
- * - The block returns a negative value for <tt>self[i]</tt>
- * and a positive value for <tt>self[j]</tt>.
- * - The block returns a negative value for <tt>self[i]</tt> and zero <tt>self[j]</tt>.
- * - The block returns zero for <tt>self[i]</tt> and a positive value for <tt>self[j]</tt>.
- *
- * In find-any mode, method bsearch returns some element
- * for which the block returns zero, or +nil+ if no such element is found.
- *
- * Examples:
- * a = [0, 4, 7, 10, 12]
- * a.bsearch {|element| 7 <=> element } # => 7
- * a.bsearch {|element| -1 <=> element } # => nil
- * a.bsearch {|element| 5 <=> element } # => nil
- * a.bsearch {|element| 15 <=> element } # => nil
- *
- * Less formally: the block is such that:
- * - All positive-evaluating elements precede all zero-evaluating elements.
- * - All positive-evaluating elements precede all negative-evaluating elements.
- * - All zero-evaluating elements precede all negative-evaluating elements.
- *
- * These make sense as blocks in find-any mode:
- * a = [0, 4, 7, 10, 12]
- * a.map {|element| 7 <=> element } # => [1, 1, 0, -1, -1]
- * a.map {|element| -1 <=> element } # => [-1, -1, -1, -1, -1]
- * a.map {|element| 5 <=> element } # => [1, 1, -1, -1, -1]
- * a.map {|element| 15 <=> element } # => [1, 1, 1, 1, 1]
- *
- * This would not make sense:
- * a = [0, 4, 7, 10, 12]
- * a.map {|element| element <=> 7 } # => [-1, -1, 0, 1, 1]
- *
- * Returns an enumerator if no block given:
- * a = [0, 4, 7, 10, 12]
- * a.bsearch # => #<Enumerator: [0, 4, 7, 10, 12]:bsearch>
+ * See {Binary Searching}[rdoc-ref:bsearch.rdoc].
*/
static VALUE
@@ -3557,7 +3466,7 @@ rb_ary_bsearch_index(VALUE ary)
satisfied = 1;
smaller = 1;
}
- else if (v == Qfalse || v == Qnil) {
+ else if (!RTEST(v)) {
smaller = 0;
}
else if (rb_obj_is_kind_of(v, rb_cNumeric)) {
@@ -4098,7 +4007,7 @@ ary_slice_bang_by_rb_ary_splice(VALUE ary, long pos, long len)
else if (orig_len < pos) {
return Qnil;
}
- else if (orig_len < pos + len) {
+ if (orig_len < pos + len) {
len = orig_len - pos;
}
if (len == 0) {
@@ -4847,6 +4756,7 @@ ary_append(VALUE x, VALUE y)
if (n > 0) {
rb_ary_splice(x, RARRAY_LEN(x), 0, RARRAY_CONST_PTR_TRANSIENT(y), n);
}
+ RB_GC_GUARD(y);
return x;
}
@@ -5923,8 +5833,7 @@ ary_min_opt_string(VALUE ary, long i, VALUE vmin)
*
* With an argument +n+ and a block, returns a new \Array with at most +n+ elements,
* in ascending order per the block:
- * [0, 1, 2, 3].min(3) # => [0, 1, 2]
- * [0, 1, 2, 3].min(6) # => [0, 1, 2, 3]
+ * ['0', '00', '000'].min(2) {|a, b| a.size <=> b.size } # => ["0", "00"]
*/
static VALUE
rb_ary_min(int argc, VALUE *argv, VALUE ary)
@@ -6570,7 +6479,7 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
n = RARRAY_AREF(args, 0);
}
if (RARRAY_LEN(self) == 0) return INT2FIX(0);
- if (n == Qnil) return DBL2NUM(HUGE_VAL);
+ if (NIL_P(n)) return DBL2NUM(HUGE_VAL);
mul = NUM2LONG(n);
if (mul <= 0) return INT2FIX(0);
n = LONG2FIX(mul);
@@ -7435,7 +7344,7 @@ rb_ary_drop(VALUE ary, VALUE n)
}
result = rb_ary_subseq(ary, pos, RARRAY_LEN(ary));
- if (result == Qnil) result = rb_ary_new();
+ if (NIL_P(result)) result = rb_ary_new();
return result;
}
@@ -7719,7 +7628,7 @@ rb_ary_one_p(int argc, VALUE *argv, VALUE ary)
* Finds and returns the object in nested objects
* that is specified by +index+ and +identifiers+.
* The nested objects may be instances of various classes.
- * See {Dig Methods}[rdoc-ref:doc/dig_methods.rdoc].
+ * See {Dig Methods}[rdoc-ref:dig_methods.rdoc].
*
* Examples:
* a = [:foo, [:bar, :baz, [:bat, :bam]]]
@@ -7813,7 +7722,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
n = 0;
}
}
- else if (RB_TYPE_P(e, T_BIGNUM))
+ else if (RB_BIGNUM_TYPE_P(e))
v = rb_big_plus(e, v);
else if (RB_TYPE_P(e, T_RATIONAL)) {
if (r == Qundef)
@@ -7850,7 +7759,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
x = RFLOAT_VALUE(e);
else if (FIXNUM_P(e))
x = FIX2LONG(e);
- else if (RB_TYPE_P(e, T_BIGNUM))
+ else if (RB_BIGNUM_TYPE_P(e))
x = rb_big2dbl(e);
else if (RB_TYPE_P(e, T_RATIONAL))
x = rb_num2dbl(e);
@@ -8335,7 +8244,7 @@ rb_ary_deconstruct(VALUE ary)
* - With string argument +field_separator+, a new string that is equivalent to
* <tt>join(field_separator)</tt>.
* #abbrev:: Returns a hash of unambiguous abbreviations for elements.
- * #pack:: Packs the the elements into a binary sequence.
+ * #pack:: Packs the elements into a binary sequence.
* #sum:: Returns a sum of elements according to either <tt>+</tt> or a given block.
*/
diff --git a/array.rb b/array.rb
index a43a3b27b1..05ce60773e 100644
--- a/array.rb
+++ b/array.rb
@@ -49,6 +49,8 @@ class Array
# But +self+ may contain duplicates:
# a = [1, 1, 1, 2, 2, 3]
# a.sample(a.size * 2) # => [1, 1, 3, 2, 1, 2]
+ # The argument +n+ must be a non-negative numeric value.
+ # The order of the result array is unrelated to the order of +self+.
# Returns a new empty \Array if +self+ is empty.
#
# The optional +random+ argument will be used as the random number generator:
diff --git a/ast.c b/ast.c
index 20c4588cd7..84e5fdcecc 100644
--- a/ast.c
+++ b/ast.c
@@ -64,8 +64,8 @@ ast_new_internal(rb_ast_t *ast, const NODE *node)
return obj;
}
-static VALUE rb_ast_parse_str(VALUE str, VALUE save_script_lines);
-static VALUE rb_ast_parse_file(VALUE path, VALUE save_script_lines);
+static VALUE rb_ast_parse_str(VALUE str, VALUE keep_script_lines);
+static VALUE rb_ast_parse_file(VALUE path, VALUE keep_script_lines);
static VALUE
ast_parse_new(void)
@@ -85,31 +85,31 @@ ast_parse_done(rb_ast_t *ast)
}
static VALUE
-ast_s_parse(rb_execution_context_t *ec, VALUE module, VALUE str, VALUE save_script_lines)
+ast_s_parse(rb_execution_context_t *ec, VALUE module, VALUE str, VALUE keep_script_lines)
{
- return rb_ast_parse_str(str, save_script_lines);
+ return rb_ast_parse_str(str, keep_script_lines);
}
static VALUE
-rb_ast_parse_str(VALUE str, VALUE save_script_lines)
+rb_ast_parse_str(VALUE str, VALUE keep_script_lines)
{
rb_ast_t *ast = 0;
StringValue(str);
VALUE vparser = ast_parse_new();
- if (RTEST(save_script_lines)) rb_parser_save_script_lines(vparser);
+ if (RTEST(keep_script_lines)) rb_parser_keep_script_lines(vparser);
ast = rb_parser_compile_string_path(vparser, Qnil, str, 1);
return ast_parse_done(ast);
}
static VALUE
-ast_s_parse_file(rb_execution_context_t *ec, VALUE module, VALUE path, VALUE save_script_lines)
+ast_s_parse_file(rb_execution_context_t *ec, VALUE module, VALUE path, VALUE keep_script_lines)
{
- return rb_ast_parse_file(path, save_script_lines);
+ return rb_ast_parse_file(path, keep_script_lines);
}
static VALUE
-rb_ast_parse_file(VALUE path, VALUE save_script_lines)
+rb_ast_parse_file(VALUE path, VALUE keep_script_lines)
{
VALUE f;
rb_ast_t *ast = 0;
@@ -119,7 +119,7 @@ rb_ast_parse_file(VALUE path, VALUE save_script_lines)
f = rb_file_open_str(path, "r");
rb_funcall(f, rb_intern("set_encoding"), 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
VALUE vparser = ast_parse_new();
- if (RTEST(save_script_lines)) rb_parser_save_script_lines(vparser);
+ if (RTEST(keep_script_lines)) rb_parser_keep_script_lines(vparser);
ast = rb_parser_compile_file_path(vparser, Qnil, f, 1);
rb_io_close(f);
return ast_parse_done(ast);
@@ -139,13 +139,13 @@ lex_array(VALUE array, int index)
}
static VALUE
-rb_ast_parse_array(VALUE array, VALUE save_script_lines)
+rb_ast_parse_array(VALUE array, VALUE keep_script_lines)
{
rb_ast_t *ast = 0;
array = rb_check_array_type(array);
VALUE vparser = ast_parse_new();
- if (RTEST(save_script_lines)) rb_parser_save_script_lines(vparser);
+ if (RTEST(keep_script_lines)) rb_parser_keep_script_lines(vparser);
ast = rb_parser_compile_generic(vparser, lex_array, Qnil, array, 1);
return ast_parse_done(ast);
}
@@ -193,7 +193,7 @@ script_lines(VALUE path)
}
static VALUE
-ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE save_script_lines)
+ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE keep_script_lines)
{
VALUE path, node, lines;
int node_id;
@@ -213,6 +213,9 @@ ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE save_script
else {
iseq = rb_method_iseq(body);
}
+ if (!iseq) {
+ return Qnil;
+ }
if (rb_iseq_from_eval_p(iseq)) {
rb_raise(rb_eArgError, "cannot get AST for method defined in eval");
}
@@ -221,13 +224,13 @@ ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE save_script
}
if (!NIL_P(lines = script_lines(path))) {
- node = rb_ast_parse_array(lines, save_script_lines);
+ node = rb_ast_parse_array(lines, keep_script_lines);
}
else if (RSTRING_LEN(path) == 2 && memcmp(RSTRING_PTR(path), "-e", 2) == 0) {
- node = rb_ast_parse_str(rb_e_script, save_script_lines);
+ node = rb_ast_parse_str(rb_e_script, keep_script_lines);
}
else {
- node = rb_ast_parse_file(path, save_script_lines);
+ node = rb_ast_parse_file(path, keep_script_lines);
}
return node_find(node, node_id);
@@ -366,7 +369,7 @@ node_children(rb_ast_t *ast, const NODE *node)
case NODE_WHILE:
case NODE_UNTIL:
return rb_ary_push(rb_ary_new_from_node_args(ast, 2, node->nd_cond, node->nd_body),
- (node->nd_state ? Qtrue : Qfalse));
+ RBOOL(node->nd_state));
case NODE_ITER:
case NODE_FOR:
return rb_ary_new_from_node_args(ast, 2, node->nd_iter, node->nd_body);
@@ -433,7 +436,7 @@ node_children(rb_ast_t *ast, const NODE *node)
NEW_CHILD(ast, node->nd_args->nd_body));
case NODE_OP_ASGN2:
return rb_ary_new_from_args(5, NEW_CHILD(ast, node->nd_recv),
- node->nd_next->nd_aid ? Qtrue : Qfalse,
+ RBOOL(node->nd_next->nd_aid),
ID2SYM(node->nd_next->nd_vid),
ID2SYM(node->nd_next->nd_mid),
NEW_CHILD(ast, node->nd_value));
diff --git a/ast.rb b/ast.rb
index 34dd3f1d49..f866bd23e5 100644
--- a/ast.rb
+++ b/ast.rb
@@ -29,8 +29,8 @@ module RubyVM::AbstractSyntaxTree
#
# RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>
- def self.parse string, save_script_lines: false
- Primitive.ast_s_parse string, save_script_lines
+ def self.parse string, keep_script_lines: false
+ Primitive.ast_s_parse string, keep_script_lines
end
# call-seq:
@@ -44,8 +44,8 @@ module RubyVM::AbstractSyntaxTree
#
# RubyVM::AbstractSyntaxTree.parse_file("my-app/app.rb")
# # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-31:3>
- def self.parse_file pathname, save_script_lines: false
- Primitive.ast_s_parse_file pathname, save_script_lines
+ def self.parse_file pathname, keep_script_lines: false
+ Primitive.ast_s_parse_file pathname, keep_script_lines
end
# call-seq:
@@ -63,8 +63,8 @@ module RubyVM::AbstractSyntaxTree
#
# RubyVM::AbstractSyntaxTree.of(method(:hello))
# # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-3:3>
- def self.of body, save_script_lines: false
- Primitive.ast_s_of body, save_script_lines
+ def self.of body, keep_script_lines: false
+ Primitive.ast_s_of body, keep_script_lines
end
# RubyVM::AbstractSyntaxTree::Node instances are created by parse methods in
diff --git a/benchmark/attr_accessor.yml b/benchmark/attr_accessor.yml
new file mode 100644
index 0000000000..82134cdf9b
--- /dev/null
+++ b/benchmark/attr_accessor.yml
@@ -0,0 +1,29 @@
+prelude: |
+ class C
+ attr_accessor :x
+ def initialize
+ @x = nil
+ end
+ class_eval <<-END
+ def ar
+ #{'x;'*256}
+ end
+ def aw
+ #{'self.x = nil;'*256}
+ end
+ def arm
+ m = method(:x)
+ #{'m.call;'*256}
+ end
+ def awm
+ m = method(:x=)
+ #{'m.call(nil);'*256}
+ end
+ END
+ end
+ obj = C.new
+benchmark:
+ attr_reader: "obj.ar"
+ attr_writer: "obj.aw"
+ attr_reader_method: "obj.arm"
+ attr_writer_method: "obj.awm"
diff --git a/benchmark/hash_aref_array.rb b/benchmark/hash_aref_array.rb
new file mode 100644
index 0000000000..ac7a683d95
--- /dev/null
+++ b/benchmark/hash_aref_array.rb
@@ -0,0 +1,5 @@
+h = {}
+arrays = (0..99).each_slice(10).to_a
+#STDERR.puts arrays.inspect
+arrays.each { |s| h[s] = s }
+200_000.times { arrays.each { |s| h[s] } }
diff --git a/benchmark/time_new.yml b/benchmark/time_new.yml
new file mode 100644
index 0000000000..5947dd3a41
--- /dev/null
+++ b/benchmark/time_new.yml
@@ -0,0 +1,4 @@
+benchmark:
+ - 'Time.new(2021)'
+ - 'Time.new(2021, 8, 22)'
+ - 'Time.new(2021, 8, 22, in: "+09:00")'
diff --git a/benchmark/time_parse.yml b/benchmark/time_parse.yml
new file mode 100644
index 0000000000..a6d6948b9c
--- /dev/null
+++ b/benchmark/time_parse.yml
@@ -0,0 +1,8 @@
+prelude: |
+ require 'time'
+ inspect = "2021-08-23 09:57:02 +0900"
+ iso8601 = "2021-08-23T09:57:02+09:00"
+benchmark:
+ - Time.iso8601(iso8601)
+ - Time.parse(iso8601)
+ - Time.parse(inspect)
diff --git a/bignum.c b/bignum.c
index d3e6cf29bb..c74df3f4da 100644
--- a/bignum.c
+++ b/bignum.c
@@ -36,15 +36,12 @@
#include "internal/numeric.h"
#include "internal/object.h"
#include "internal/sanitizers.h"
-#include "internal/util.h"
#include "internal/variable.h"
#include "internal/warnings.h"
#include "ruby/thread.h"
#include "ruby/util.h"
#include "ruby_assert.h"
-#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
-
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
#ifndef SIZEOF_BDIGIT_DBL
@@ -463,7 +460,6 @@ static int
bary_2comp(BDIGIT *ds, size_t n)
{
size_t i;
- i = 0;
for (i = 0; i < n; i++) {
if (ds[i] != 0) {
goto non_zero;
@@ -1053,6 +1049,7 @@ integer_unpack_num_bdigits(size_t numwords, size_t wordsize, size_t nails, int *
size_t num_bdigits1 = integer_unpack_num_bdigits_generic(numwords, wordsize, nails, &nlp_bits1);
assert(num_bdigits == num_bdigits1);
assert(*nlp_bits_ret == nlp_bits1);
+ (void)num_bdigits1;
}
#endif
}
@@ -1644,11 +1641,13 @@ rb_big_sq_fast(VALUE x)
/* balancing multiplication by slicing larger argument */
static void
-bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn, mulfunc_t *mulfunc)
+bary_mul_balance_with_mulfunc(BDIGIT *const zds, const size_t zn,
+ const BDIGIT *const xds, const size_t xn,
+ const BDIGIT *const yds, const size_t yn,
+ BDIGIT *wds, size_t wn, mulfunc_t *const mulfunc)
{
VALUE work = 0;
- size_t yn0 = yn;
- size_t r, n;
+ size_t n;
assert(xn + yn <= zn);
assert(xn <= yn);
@@ -1656,14 +1655,20 @@ bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t
BDIGITS_ZERO(zds, xn);
+ if (wn < xn) {
+ const size_t r = (yn % xn) ? (yn % xn) : xn;
+ if ((2 * xn + yn + r) > zn) {
+ wn = xn;
+ wds = ALLOCV_N(BDIGIT, work, wn);
+ }
+ }
+
n = 0;
- while (yn > 0) {
- BDIGIT *tds;
- size_t tn;
- r = xn > yn ? yn : xn;
- tn = xn + r;
+ while (yn > n) {
+ const size_t r = (xn > (yn - n) ? (yn - n) : xn);
+ const size_t tn = (xn + r);
if (2 * (xn + r) <= zn - n) {
- tds = zds + n + xn + r;
+ BDIGIT *const tds = zds + n + xn + r;
mulfunc(tds, tn, xds, xn, yds + n, r, wds, wn);
BDIGITS_ZERO(zds + n + xn, r);
bary_add(zds + n, tn,
@@ -1671,21 +1676,25 @@ bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t
tds, tn);
}
else {
+ BDIGIT *const tds = zds + n;
if (wn < xn) {
+ /* xn is invariant, only once here */
+#if 0
wn = xn;
wds = ALLOCV_N(BDIGIT, work, wn);
+#else
+ rb_bug("wds is not enough: %" PRIdSIZE " for %" PRIdSIZE, wn, xn);
+#endif
}
- tds = zds + n;
MEMCPY(wds, zds + n, BDIGIT, xn);
mulfunc(tds, tn, xds, xn, yds + n, r, wds+xn, wn-xn);
bary_add(zds + n, tn,
zds + n, tn,
wds, xn);
}
- yn -= r;
n += r;
}
- BDIGITS_ZERO(zds+xn+yn0, zn - (xn+yn0));
+ BDIGITS_ZERO(zds+xn+yn, zn - (xn+yn));
if (work)
ALLOCV_END(work);
@@ -3401,6 +3410,7 @@ rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret)
numwords0 = absint_numwords_generic(numbytes, nlz_bits_in_msbyte, word_numbits, &nlz_bits0);
assert(numwords0 == numwords);
assert(nlz_bits0 == nlz_bits);
+ (void)numwords0;
}
#endif
}
@@ -5381,7 +5391,7 @@ rb_integer_float_eq(VALUE x, VALUE y)
double yd = RFLOAT_VALUE(y);
double yi, yf;
- if (isnan(yd) || isinf(yd))
+ if (!isfinite(yd))
return Qfalse;
yf = modf(yd, &yi);
if (yf != 0)
@@ -5389,18 +5399,14 @@ rb_integer_float_eq(VALUE x, VALUE y)
if (FIXNUM_P(x)) {
#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
double xd = (double)FIX2LONG(x);
- if (xd != yd)
- return Qfalse;
- return Qtrue;
+ return RBOOL(xd == yd);
#else
long xn, yn;
if (yi < LONG_MIN || LONG_MAX_as_double <= yi)
return Qfalse;
xn = FIX2LONG(x);
yn = (long)yi;
- if (xn != yn)
- return Qfalse;
- return Qtrue;
+ return RBOOL(xn == yn);
#endif
}
y = rb_dbl2big(yi);
@@ -5470,10 +5476,10 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
n = FIX2INT(rel);
switch (op) {
- case big_op_gt: return n > 0 ? Qtrue : Qfalse;
- case big_op_ge: return n >= 0 ? Qtrue : Qfalse;
- case big_op_lt: return n < 0 ? Qtrue : Qfalse;
- case big_op_le: return n <= 0 ? Qtrue : Qfalse;
+ case big_op_gt: return RBOOL(n > 0);
+ case big_op_ge: return RBOOL(n >= 0);
+ case big_op_lt: return RBOOL(n < 0);
+ case big_op_le: return RBOOL(n <= 0);
}
return Qundef;
}
@@ -5517,7 +5523,7 @@ VALUE
rb_big_eq(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return bignorm(x) == y ? Qtrue : Qfalse;
+ return RBOOL(bignorm(x) == y);
}
else if (RB_BIGNUM_TYPE_P(y)) {
}
@@ -5529,8 +5535,7 @@ rb_big_eq(VALUE x, VALUE y)
}
if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y)) return Qfalse;
if (BIGNUM_LEN(x) != BIGNUM_LEN(y)) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) != 0) return Qfalse;
- return Qtrue;
+ return RBOOL(MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) == 0);
}
VALUE
@@ -5539,8 +5544,7 @@ rb_big_eql(VALUE x, VALUE y)
if (!RB_BIGNUM_TYPE_P(y)) return Qfalse;
if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y)) return Qfalse;
if (BIGNUM_LEN(x) != BIGNUM_LEN(y)) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) != 0) return Qfalse;
- return Qtrue;
+ return RBOOL(MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) == 0);
}
VALUE
@@ -6823,10 +6827,7 @@ rb_big_bit_length(VALUE big)
VALUE
rb_big_odd_p(VALUE num)
{
- if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
- return Qtrue;
- }
- return Qfalse;
+ return RBOOL(BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1);
}
VALUE
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index 28c9e6d90c..4da348df67 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -187,6 +187,28 @@ assert_equal '[:ok, :ok, :ok]', %q{
}.map(&:take)
}
+# Ractor.make_shareable issue for locals in proc [Bug #18023]
+assert_equal '[:a, :b, :c, :d, :e]', %q{
+ v1, v2, v3, v4, v5 = :a, :b, :c, :d, :e
+ closure = Proc.new { [v1, v2, v3, v4, v5] }
+
+ Ractor.make_shareable(closure).call
+}
+
+# Ractor.make_shareable issue for locals in proc [Bug #18023]
+assert_equal '[:a, :b, :c, :d, :e, :f, :g]', %q{
+ a = :a
+ closure = -> {
+ b, c, d = :b, :c, :d
+ -> {
+ e, f, g = :e, :f, :g
+ -> { [a, b, c, d, e, f, g] }
+ }.call
+ }.call
+
+ Ractor.make_shareable(closure).call
+}
+
###
###
# Ractor still has several memory corruption so skip huge number of tests
@@ -1418,4 +1440,19 @@ assert_equal "ok", %q{
'ok'
}
+# Can yield back values while GC is sweeping [Bug #18117]
+assert_equal "ok", %q{
+ workers = (0...8).map do
+ Ractor.new do
+ loop do
+ 10_000.times.map { Object.new }
+ Ractor.yield Time.now
+ end
+ end
+ end
+
+ 1_000.times { idle_worker, tmp_reporter = Ractor.select(*workers) }
+ "ok"
+}
+
end # if !ENV['GITHUB_WORKFLOW']
diff --git a/class.c b/class.c
index ef3db6dab3..ca8bdc2e79 100644
--- a/class.c
+++ b/class.c
@@ -10,16 +10,7 @@
**********************************************************************/
/*!
- * \defgroup class Classes and their hierarchy.
- * \par Terminology
- * - class: same as in Ruby.
- * - singleton class: class for a particular object
- * - eigenclass: = singleton class
- * - metaclass: class of a class. metaclass is a kind of singleton class.
- * - metametaclass: class of a metaclass.
- * - meta^(n)-class: class of a meta^(n-1)-class.
- * - attached object: A singleton class knows its unique instance.
- * The instance is called the attached object for the singleton class.
+ * \addtogroup class
* \{
*/
@@ -89,14 +80,14 @@ rb_module_add_to_subclasses_list(VALUE module, VALUE iclass)
void
rb_class_remove_from_super_subclasses(VALUE klass)
{
- rb_subclass_entry_t *entry;
+ rb_subclass_entry_t **prev = RCLASS_PARENT_SUBCLASSES(klass);
- if (RCLASS_PARENT_SUBCLASSES(klass)) {
- entry = *RCLASS_PARENT_SUBCLASSES(klass);
+ if (prev) {
+ rb_subclass_entry_t *entry = *prev, *next = entry->next;
- *RCLASS_PARENT_SUBCLASSES(klass) = entry->next;
- if (entry->next) {
- RCLASS_PARENT_SUBCLASSES(entry->next->klass) = RCLASS_PARENT_SUBCLASSES(klass);
+ *prev = next;
+ if (next) {
+ RCLASS_PARENT_SUBCLASSES(next->klass) = prev;
}
xfree(entry);
}
@@ -107,14 +98,14 @@ rb_class_remove_from_super_subclasses(VALUE klass)
void
rb_class_remove_from_module_subclasses(VALUE klass)
{
- rb_subclass_entry_t *entry;
+ rb_subclass_entry_t **prev = RCLASS_MODULE_SUBCLASSES(klass);
- if (RCLASS_MODULE_SUBCLASSES(klass)) {
- entry = *RCLASS_MODULE_SUBCLASSES(klass);
- *RCLASS_MODULE_SUBCLASSES(klass) = entry->next;
+ if (prev) {
+ rb_subclass_entry_t *entry = *prev, *next = entry->next;
- if (entry->next) {
- RCLASS_MODULE_SUBCLASSES(entry->next->klass) = RCLASS_MODULE_SUBCLASSES(klass);
+ *prev = next;
+ if (next) {
+ RCLASS_MODULE_SUBCLASSES(next->klass) = prev;
}
xfree(entry);
@@ -185,8 +176,7 @@ class_alloc(VALUE flags, VALUE klass)
RVARGC_NEWOBJ_OF(obj, struct RClass, klass, (flags & T_MASK) | FL_PROMOTED1 /* start from age == 2 */ | (RGENGC_WB_PROTECTED_CLASS ? FL_WB_PROTECTED : 0), payload_size);
#if USE_RVARGC
- obj->ptr = (rb_classext_t *)rb_rvargc_payload_data_ptr((VALUE)obj + rb_slot_size());
- RB_OBJ_WRITTEN(obj, Qundef, (VALUE)obj + rb_slot_size());
+ obj->ptr = (rb_classext_t *)rb_gc_rvargc_object_data((VALUE)obj);
#else
obj->ptr = ZALLOC(rb_classext_t);
#endif
@@ -235,13 +225,6 @@ rb_class_boot(VALUE super)
return (VALUE)klass;
}
-
-/*!
- * Ensures a class can be derived from super.
- *
- * \param super a reference to an object.
- * \exception TypeError if \a super is not a Class or \a super is a singleton class.
- */
void
rb_check_inheritable(VALUE super)
{
@@ -257,13 +240,6 @@ rb_check_inheritable(VALUE super)
}
}
-
-/*!
- * Creates a new class.
- * \param super a class from which the new class derives.
- * \exception TypeError \a super is not inheritable.
- * \exception TypeError \a super is the Class class.
- */
VALUE
rb_class_new(VALUE super)
{
@@ -272,6 +248,12 @@ rb_class_new(VALUE super)
return rb_class_boot(super);
}
+VALUE
+rb_class_s_alloc(VALUE klass)
+{
+ return rb_class_boot(0);
+}
+
static void
clone_method(VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t *me)
{
@@ -369,12 +351,47 @@ copy_tables(VALUE clone, VALUE orig)
static bool ensure_origin(VALUE klass);
+/**
+ * If this flag is set, that module is allocated but not initialized yet.
+ */
+enum {RMODULE_ALLOCATED_BUT_NOT_INITIALIZED = RUBY_FL_USER5};
+
+static inline bool
+RMODULE_UNINITIALIZED(VALUE module)
+{
+ return FL_TEST_RAW(module, RMODULE_ALLOCATED_BUT_NOT_INITIALIZED);
+}
+
+void
+rb_module_set_initialized(VALUE mod)
+{
+ FL_UNSET_RAW(mod, RMODULE_ALLOCATED_BUT_NOT_INITIALIZED);
+ /* no more re-initialization */
+}
+
+void
+rb_module_check_initializable(VALUE mod)
+{
+ if (!RMODULE_UNINITIALIZED(mod)) {
+ rb_raise(rb_eTypeError, "already initialized module");
+ }
+ RB_OBJ_WRITE(mod, &RCLASS(mod)->super, 0);
+}
+
/* :nodoc: */
VALUE
rb_mod_init_copy(VALUE clone, VALUE orig)
{
- if (RB_TYPE_P(clone, T_CLASS)) {
+ switch (BUILTIN_TYPE(clone)) {
+ case T_CLASS:
+ case T_ICLASS:
class_init_copy_check(clone, orig);
+ break;
+ case T_MODULE:
+ rb_module_check_initializable(clone);
+ break;
+ default:
+ break;
}
if (!OBJ_INIT_COPY(clone, orig)) return clone;
@@ -537,10 +554,6 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
}
}
-/*!
- * Attach a object to a singleton class.
- * @pre \a klass is the singleton class of \a obj.
- */
void
rb_singleton_class_attached(VALUE klass, VALUE obj)
{
@@ -698,17 +711,6 @@ rb_make_metaclass(VALUE obj, VALUE unused)
}
}
-
-/*!
- * Defines a new class.
- * \param id ignored
- * \param super A class from which the new class will derive. NULL means \c Object class.
- * \return the created class
- * \throw TypeError if super is not a \c Class object.
- *
- * \note the returned class will not be associated with \a id.
- * You must explicitly set a class name if necessary.
- */
VALUE
rb_define_class_id(ID id, VALUE super)
{
@@ -739,23 +741,6 @@ rb_class_inherited(VALUE super, VALUE klass)
return rb_funcall(super, inherited, 1, klass);
}
-
-
-/*!
- * Defines a top-level class.
- * \param name name of the class
- * \param super a class from which the new class will derive.
- * \return the created class
- * \throw TypeError if the constant name \a name is already taken but
- * the constant is not a \c Class.
- * \throw TypeError if the class is already defined but the class can not
- * be reopened because its superclass is not \a super.
- * \throw ArgumentError if the \a super is NULL.
- * \post top-level constant named \a name refers the returned class.
- *
- * \note if a class named \a name is already defined and its superclass is
- * \a super, the function just returns the defined class.
- */
VALUE
rb_define_class(const char *name, VALUE super)
{
@@ -788,48 +773,12 @@ rb_define_class(const char *name, VALUE super)
return klass;
}
-
-/*!
- * Defines a class under the namespace of \a outer.
- * \param outer a class which contains the new class.
- * \param name name of the new class
- * \param super a class from which the new class will derive.
- * NULL means \c Object class.
- * \return the created class
- * \throw TypeError if the constant name \a name is already taken but
- * the constant is not a \c Class.
- * \throw TypeError if the class is already defined but the class can not
- * be reopened because its superclass is not \a super.
- * \post top-level constant named \a name refers the returned class.
- *
- * \note if a class named \a name is already defined and its superclass is
- * \a super, the function just returns the defined class.
- * \note the compaction GC does not move classes returned by this function.
- */
VALUE
rb_define_class_under(VALUE outer, const char *name, VALUE super)
{
return rb_define_class_id_under(outer, rb_intern(name), super);
}
-
-/*!
- * Defines a class under the namespace of \a outer.
- * \param outer a class which contains the new class.
- * \param id name of the new class
- * \param super a class from which the new class will derive.
- * NULL means \c Object class.
- * \return the created class
- * \throw TypeError if the constant name \a name is already taken but
- * the constant is not a \c Class.
- * \throw TypeError if the class is already defined but the class can not
- * be reopened because its superclass is not \a super.
- * \post top-level constant named \a name refers the returned class.
- *
- * \note if a class named \a name is already defined and its superclass is
- * \a super, the function just returns the defined class.
- * \note the compaction GC does not move classes returned by this function.
- */
VALUE
rb_define_class_id_under(VALUE outer, ID id, VALUE super)
{
@@ -867,6 +816,15 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
}
VALUE
+rb_module_s_alloc(VALUE klass)
+{
+ VALUE mod = class_alloc(T_MODULE, klass);
+ RCLASS_M_TBL_INIT(mod);
+ FL_SET(mod, RMODULE_ALLOCATED_BUT_NOT_INITIALIZED);
+ return mod;
+}
+
+VALUE
rb_module_new(void)
{
VALUE mdl = class_alloc(T_MODULE, rb_cModule);
@@ -881,9 +839,6 @@ rb_define_module_id(ID id)
return rb_module_new();
}
-/*!
- * \note the compaction GC does not move modules returned by this function.
- */
VALUE
rb_define_module(const char *name)
{
@@ -908,9 +863,6 @@ rb_define_module(const char *name)
return module;
}
-/*!
- * \note the compaction GC does not move modules returned by this function.
- */
VALUE
rb_define_module_under(VALUE outer, const char *name)
{
@@ -976,6 +928,7 @@ ensure_includable(VALUE klass, VALUE module)
{
rb_class_modify_check(klass);
Check_Type(module, T_MODULE);
+ rb_module_set_initialized(module);
if (!NIL_P(rb_refinement_module_get_refined_class(module))) {
rb_raise(rb_eArgError, "refinement module is not allowed");
}
@@ -1124,10 +1077,10 @@ do_include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super
add_subclass = FALSE;
}
- {
+ if (add_subclass) {
VALUE m = module;
if (BUILTIN_TYPE(m) == T_ICLASS) m = RBASIC(m)->klass;
- if (add_subclass) rb_module_add_to_subclasses_list(m, iclass);
+ rb_module_add_to_subclasses_list(m, iclass);
}
if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
@@ -1347,8 +1300,13 @@ VALUE
rb_mod_ancestors(VALUE mod)
{
VALUE p, ary = rb_ary_new();
+ VALUE refined_class = Qnil;
+ if (FL_TEST(mod, RMODULE_IS_REFINEMENT)) {
+ refined_class = rb_refinement_module_get_refined_class(mod);
+ }
for (p = mod; p; p = RCLASS_SUPER(p)) {
+ if (p == refined_class) break;
if (p != RCLASS_ORIGIN(p)) continue;
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
@@ -1431,6 +1389,7 @@ method_entry_i(ID key, VALUE value, void *data)
}
else {
type = METHOD_ENTRY_VISI(me);
+ RUBY_ASSERT(type != METHOD_VISI_UNDEF);
}
st_add_direct(arg->list, key, (st_data_t)type);
}
@@ -1730,56 +1689,7 @@ rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
* \}
*/
/*!
- * \defgroup defmethod Defining methods
- * There are some APIs to define a method from C.
- * These API takes a C function as a method body.
- *
- * \par Method body functions
- * Method body functions must return a VALUE and
- * can be one of the following form:
- * <dl>
- * <dt>Fixed number of parameters</dt>
- * <dd>
- * This form is a normal C function, excepting it takes
- * a receiver object as the first argument.
- *
- * \code
- * static VALUE my_method(VALUE self, VALUE x, VALUE y);
- * \endcode
- * </dd>
- * <dt>argc and argv style</dt>
- * <dd>
- * This form takes three parameters: \a argc, \a argv and \a self.
- * \a self is the receiver. \a argc is the number of arguments.
- * \a argv is a pointer to an array of the arguments.
- *
- * \code
- * static VALUE my_method(int argc, VALUE *argv, VALUE self);
- * \endcode
- * </dd>
- * <dt>Ruby array style</dt>
- * <dd>
- * This form takes two parameters: self and args.
- * \a self is the receiver. \a args is an Array object which
- * contains the arguments.
- *
- * \code
- * static VALUE my_method(VALUE self, VALUE args);
- * \endcode
- * </dd>
- *
- * \par Number of parameters
- * Method defining APIs takes the number of parameters which the
- * method will takes. This number is called \a argc.
- * \a argc can be:
- * <dl>
- * <dt>zero or positive number</dt>
- * <dd>This means the method body function takes a fixed number of parameters</dd>
- * <dt>-1</dt>
- * <dd>This means the method body function is "argc and argv" style.</dd>
- * <dt>-2</dt>
- * <dd>This means the method body function is "self and args" style.</dd>
- * </dl>
+ * \addtogroup defmethod
* \{
*/
@@ -1949,23 +1859,6 @@ rb_singleton_class_get(VALUE obj)
return klass;
}
-/*!
- * Returns the singleton class of \a obj. Creates it if necessary.
- *
- * \param obj an arbitrary object.
- * \throw TypeError if \a obj is an Integer or a Symbol.
- * \return the singleton class.
- *
- * \post \a obj has its own singleton class.
- * \post if \a obj is a class,
- * the returned singleton class also has its own
- * singleton class in order to keep consistency of the
- * inheritance structure of metaclasses.
- * \note a new singleton class will be created
- * if \a obj does not have it.
- * \note the singleton classes for nil, true and false are:
- * NilClass, TrueClass and FalseClass.
- */
VALUE
rb_singleton_class(VALUE obj)
{
@@ -1989,13 +1882,6 @@ rb_singleton_class(VALUE obj)
#ifdef rb_define_singleton_method
#undef rb_define_singleton_method
#endif
-/*!
- * Defines a singleton method for \a obj.
- * \param obj an arbitrary object
- * \param name name of the singleton method
- * \param func the method body
- * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
- */
void
rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS), int argc)
{
@@ -2005,13 +1891,6 @@ rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS),
#ifdef rb_define_module_function
#undef rb_define_module_function
#endif
-/*!
- * Defines a module function for \a module.
- * \param module an module or a class.
- * \param name name of the function
- * \param func the method body
- * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
- */
void
rb_define_module_function(VALUE module, const char *name, VALUE (*func)(ANYARGS), int argc)
{
@@ -2022,38 +1901,18 @@ rb_define_module_function(VALUE module, const char *name, VALUE (*func)(ANYARGS)
#ifdef rb_define_global_function
#undef rb_define_global_function
#endif
-/*!
- * Defines a global function
- * \param name name of the function
- * \param func the method body
- * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
- */
void
rb_define_global_function(const char *name, VALUE (*func)(ANYARGS), int argc)
{
rb_define_module_function(rb_mKernel, name, func, argc);
}
-
-/*!
- * Defines an alias of a method.
- * \param klass the class which the original method belongs to
- * \param name1 a new name for the method
- * \param name2 the original name of the method
- */
void
rb_define_alias(VALUE klass, const char *name1, const char *name2)
{
rb_alias(klass, rb_intern(name1), rb_intern(name2));
}
-/*!
- * Defines (a) public accessor method(s) for an attribute.
- * \param klass the class which the attribute will belongs to
- * \param name name of the attribute
- * \param read a getter method for the attribute will be defined if \a read is non-zero.
- * \param write a setter method for the attribute will be defined if \a write is non-zero.
- */
void
rb_define_attr(VALUE klass, const char *name, int read, int write)
{
@@ -2363,12 +2222,6 @@ rb_scan_args_kw(int kw_flag, int argc, const VALUE *argv, const char *fmt, ...)
return rb_scan_args_result(&arg, argc);
}
-int
-rb_class_has_methods(VALUE c)
-{
- return rb_id_table_size(RCLASS_M_TBL(c)) == 0 ? FALSE : TRUE;
-}
-
/*!
* \}
*/
diff --git a/common.mk b/common.mk
index 2f1a47c7b8..872e6e0a10 100644
--- a/common.mk
+++ b/common.mk
@@ -232,7 +232,7 @@ mjit_config.h: Makefile
$(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) \
$(TIMESTAMPDIR)/$(arch)/.time $(tooldir)/mjit_tabs.rb $(PREP) $(RBCONFIG)
$(ECHO) building $(@F:.time=.h)
- $(MINIRUBY) $(tooldir)/mjit_tabs.rb "$(MJIT_TABS)" \
+ $(Q)$(MINIRUBY) $(tooldir)/mjit_tabs.rb "$(MJIT_TABS)" \
$(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new
$(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new
@@ -243,7 +243,7 @@ $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: \
$(tooldir)/transform_mjit_header.rb $(PREP) \
$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h
$(ECHO) building $@
- $(MINIRUBY) $(tooldir)/transform_mjit_header.rb "$(CC) $(CFLAGS) -w" $(MJIT_HEADER:.h=)$(MJIT_HEADER_ARCH).h $@
+ $(Q)$(MINIRUBY) $(tooldir)/transform_mjit_header.rb "$(CC) $(CFLAGS) -w" $(MJIT_HEADER:.h=)$(MJIT_HEADER_ARCH).h $@
$(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
$(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
@@ -376,7 +376,7 @@ $(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
install-all: docs pre-install-all do-install-all post-install-all
pre-install-all:: all pre-install-local pre-install-ext pre-install-gem pre-install-doc
do-install-all: pre-install-all
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) $(INSTALL_DOC_OPTS)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all $(INSTALL_DOC_OPTS)
post-install-all:: post-install-local post-install-ext post-install-gem post-install-doc
@$(NULLCMD)
@@ -741,7 +741,7 @@ check: main test test-tool test-all test-spec
if [ x"$(GIT)" != x ] && $(CHDIR) "$(srcdir)" && \
b=`$(GIT) symbolic-ref --short HEAD 2>&1` && \
u=`$(GIT) branch --list --format='%(upstream:short)' $$b`; then \
- set -x; $(GIT) --no-pager log --format=oneline -G "^ *# *include" $$u..HEAD --; \
+ set -x; $(GIT) --no-pager log --format=oneline -G '^ *# *include *("|<ruby)' $$u..HEAD --; \
fi
check-ruby: test test-ruby
@@ -760,35 +760,49 @@ $(arch)-fake.rb: $(srcdir)/template/fake.rb.in $(tooldir)/generic_erb.rb version
btest: $(TEST_RUNNABLE)-btest
no-btest: PHONY
yes-btest: fake miniruby$(EXEEXT) PHONY
+ $(ACTIONS_GROUP)
$(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(BTESTS)
+ $(ACTIONS_ENDGROUP)
btest-ruby: $(TEST_RUNNABLE)-btest-ruby
no-btest-ruby: PHONY
yes-btest-ruby: prog PHONY
+ $(ACTIONS_GROUP)
$(Q)$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS) $(BTESTS)
+ $(ACTIONS_ENDGROUP)
rtest: fake miniruby$(EXEEXT) PHONY
+ $(ACTIONS_GROUP)
$(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" --sets=ractor -v
+ $(ACTIONS_ENDGROUP)
test-basic: $(TEST_RUNNABLE)-test-basic
no-test-basic: PHONY
yes-test-basic: prog PHONY
+ $(ACTIONS_GROUP)
$(Q)$(exec) $(RUNRUBY) "$(srcdir)/basictest/runner.rb" --run-opt=$(RUN_OPTS) $(OPTS) $(TESTOPTS)
+ $(ACTIONS_ENDGROUP)
test-knownbugs: test-knownbug
test-knownbug: $(TEST_RUNNABLE)-test-knownbug
no-test-knownbug: PHONY
yes-test-knownbug: prog PHONY
+ $(ACTIONS_GROUP)
-$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
+ $(ACTIONS_ENDGROUP)
test-testframework: $(TEST_RUNNABLE)-test-testframework
yes-test-testframework: prog PHONY
- $(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
+ $(ACTIONS_GROUP)
+ $(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit
+ $(ACTIONS_ENDGROUP)
no-test-testframework: PHONY
test-tool: $(TEST_RUNNABLE)-test-tool
yes-test-tool: prog PHONY
+ $(ACTIONS_GROUP)
$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS)
+ $(ACTIONS_ENDGROUP)
no-test-tool: PHONY
test-sample: test-basic # backward compatibility for mswin-build
@@ -799,7 +813,9 @@ test: test-short
# for example, make test-all TESTOPTS="-j2 -v -n test-name -- test-file-name"
test-all: $(TEST_RUNNABLE)-test-all
yes-test-all: programs PHONY
+ $(ACTIONS_GROUP)
$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
+ $(ACTIONS_ENDGROUP)
TESTS_BUILD = mkmf
no-test-all: PHONY
$(gnumake_recursive)$(MINIRUBY) -I"$(srcdir)/lib" "$(TESTSDIR)/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
@@ -839,8 +855,10 @@ test-spec-precheck: programs
test-spec: $(TEST_RUNNABLE)-test-spec
yes-test-spec: test-spec-precheck
+ $(ACTIONS_GROUP)
$(gnumake_recursive)$(Q) \
- $(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec -I$(srcdir)/tool/lib $(MSPECOPT) $(SPECOPTS)
+ $(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT) $(SPECOPTS)
+ $(ACTIONS_ENDGROUP)
no-test-spec:
RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
@@ -941,23 +959,28 @@ RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
acosh.$(OBJEXT): {$(VPATH)}acosh.c
alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
+cbrt.$(OBJEXT): {$(VPATH)}cbrt.c
+close.$(OBJEXT): {$(VPATH)}close.c
crypt.$(OBJEXT): {$(VPATH)}crypt.c {$(VPATH)}crypt.h {$(VPATH)}missing/des_tables.c
-dup2.$(OBJEXT): {$(VPATH)}dup2.c
erf.$(OBJEXT): {$(VPATH)}erf.c
explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
-finite.$(OBJEXT): {$(VPATH)}finite.c
+ffs.$(OBJEXT): {$(VPATH)}ffs.c
flock.$(OBJEXT): {$(VPATH)}flock.c
+hypot.$(OBJEXT): {$(VPATH)}hypot.c
+langinfo.$(OBJEXT): {$(VPATH)}langinfo.c
+lgamma_r.$(OBJEXT): {$(VPATH)}lgamma_r.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
memmove.$(OBJEXT): {$(VPATH)}memmove.c
-mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
+nan.$(OBJEXT): {$(VPATH)}nan.c
+nextafter.$(OBJEXT): {$(VPATH)}nextafter.c
+procstat_vm.$(OBJEXT): {$(VPATH)}procstat_vm.c
setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
strchr.$(OBJEXT): {$(VPATH)}strchr.c
-strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
strstr.$(OBJEXT): {$(VPATH)}strstr.c
-nt.$(OBJEXT): {$(VPATH)}nt.c
+tgamma.$(OBJEXT): {$(VPATH)}tgamma.c
.coroutine_obj $(COROUTINE_OBJ): \
{$(VPATH)}$(COROUTINE_SRC) \
@@ -987,7 +1010,7 @@ $(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(tooldir)/transcode-tblgen.rb
$(Q) $(BASERUBY) "$(tooldir)/transcode-tblgen.rb" -vo $@ $(srcdir)/enc/trans/newline.trans
enc/trans/newline.$(OBJEXT): $(NEWLINE_C)
-verconf.h: $(srcdir)/template/verconf.h.tmpl $(tooldir)/generic_erb.rb
+verconf.h: $(srcdir)/template/verconf.h.tmpl $(tooldir)/generic_erb.rb $(RBCONFIG)
$(ECHO) creating $@
$(Q) $(BOOTSTRAPRUBY) "$(tooldir)/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
@@ -1024,6 +1047,7 @@ BUILTIN_RB_SRCS = \
$(srcdir)/gc.rb \
$(srcdir)/numeric.rb \
$(srcdir)/io.rb \
+ $(srcdir)/marshal.rb \
$(srcdir)/pack.rb \
$(srcdir)/trace_point.rb \
$(srcdir)/warning.rb \
@@ -1166,10 +1190,10 @@ $(REVISION_H): revision.tmp
$(srcdir)/ext/ripper/ripper.c: $(srcdir)/ext/ripper/tools/preproc.rb $(srcdir)/parse.y id.h $(srcdir)/ext/ripper/depend
$(ECHO) generating $@
- $(Q) VPATH=$${PWD-`pwd`} && $(CHDIR) $(@D) && \
+ $(Q) $(CHDIR) $(@D) && \
sed -e 's/{\$$([^(){}]*)[^{}]*}//g' -e /AUTOGENERATED/q depend | \
$(exec) $(MAKE) -f - $(mflags) \
- Q=$(Q) ECHO=$(ECHO) RM="$(RM)" BISON=$(YACC) top_srcdir=../.. srcdir=. VPATH="$${VPATH}" \
+ Q=$(Q) ECHO=$(ECHO) RM="$(RM1)" BISON=$(YACC) top_srcdir=../.. srcdir=. VPATH=../.. \
RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)" LANG=C
$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl $(srcdir)/ext/json/parser/prereq.mk
@@ -1352,8 +1376,10 @@ test-bundled-gems-prepare: test-bundled-gems-precheck test-bundled-gems-fetch
test-bundled-gems-prepare: $(TEST_RUNNABLE)-test-bundled-gems-prepare
no-test-bundled-gems-prepare: no-test-bundled-gems-precheck
yes-test-bundled-gems-prepare: yes-test-bundled-gems-precheck
+ $(ACTIONS_GROUP)
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
- --install-dir .bundle --conservative "bundler" "minitest:~> 5" "test-unit" "rake" "hoe" "yard" "pry" "packnga" "rexml" "json-schema" "rbs"
+ --install-dir .bundle --conservative "bundler" "minitest:~> 5" "test-unit" "rake" "hoe" "yard" "pry" "packnga" "rexml" "json-schema" "test-unit-rr"
+ $(ACTIONS_ENDGROUP)
PREPARE_BUNDLED_GEMS = test-bundled-gems-prepare
test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems
@@ -1373,8 +1399,10 @@ yes-test-bundler-precheck: main
no-test-bundler-prepare: no-test-bundler-precheck
yes-test-bundler-prepare: yes-test-bundler-precheck
+ $(ACTIONS_GROUP)
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
--install-dir .bundle --conservative "rspec:~> 3.8" "rake:~> 13.0" "parallel_tests:~> 2.29"
+ $(ACTIONS_ENDGROUP)
RSPECOPTS =
BUNDLER_SPECS =
@@ -1805,6 +1833,15 @@ array.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
array.$(OBJEXT): {$(VPATH)}internal/ctype.h
array.$(OBJEXT): {$(VPATH)}internal/dllexport.h
array.$(OBJEXT): {$(VPATH)}internal/dosish.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+array.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
array.$(OBJEXT): {$(VPATH)}internal/error.h
array.$(OBJEXT): {$(VPATH)}internal/eval.h
array.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -1990,6 +2027,15 @@ ast.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
ast.$(OBJEXT): {$(VPATH)}internal/ctype.h
ast.$(OBJEXT): {$(VPATH)}internal/dllexport.h
ast.$(OBJEXT): {$(VPATH)}internal/dosish.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+ast.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
ast.$(OBJEXT): {$(VPATH)}internal/error.h
ast.$(OBJEXT): {$(VPATH)}internal/eval.h
ast.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -2089,7 +2135,6 @@ bignum.$(OBJEXT): $(top_srcdir)/internal/object.h
bignum.$(OBJEXT): $(top_srcdir)/internal/sanitizers.h
bignum.$(OBJEXT): $(top_srcdir)/internal/serial.h
bignum.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
-bignum.$(OBJEXT): $(top_srcdir)/internal/util.h
bignum.$(OBJEXT): $(top_srcdir)/internal/variable.h
bignum.$(OBJEXT): $(top_srcdir)/internal/vm.h
bignum.$(OBJEXT): $(top_srcdir)/internal/warnings.h
@@ -2551,6 +2596,15 @@ class.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
class.$(OBJEXT): {$(VPATH)}internal/ctype.h
class.$(OBJEXT): {$(VPATH)}internal/dllexport.h
class.$(OBJEXT): {$(VPATH)}internal/dosish.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+class.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
class.$(OBJEXT): {$(VPATH)}internal/error.h
class.$(OBJEXT): {$(VPATH)}internal/eval.h
class.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -2729,6 +2783,15 @@ compar.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
compar.$(OBJEXT): {$(VPATH)}internal/ctype.h
compar.$(OBJEXT): {$(VPATH)}internal/dllexport.h
compar.$(OBJEXT): {$(VPATH)}internal/dosish.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+compar.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
compar.$(OBJEXT): {$(VPATH)}internal/error.h
compar.$(OBJEXT): {$(VPATH)}internal/eval.h
compar.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -2932,6 +2995,15 @@ compile.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
compile.$(OBJEXT): {$(VPATH)}internal/ctype.h
compile.$(OBJEXT): {$(VPATH)}internal/dllexport.h
compile.$(OBJEXT): {$(VPATH)}internal/dosish.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+compile.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
compile.$(OBJEXT): {$(VPATH)}internal/error.h
compile.$(OBJEXT): {$(VPATH)}internal/eval.h
compile.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -3414,7 +3486,6 @@ debug.$(OBJEXT): $(top_srcdir)/internal/imemo.h
debug.$(OBJEXT): $(top_srcdir)/internal/serial.h
debug.$(OBJEXT): $(top_srcdir)/internal/signal.h
debug.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
-debug.$(OBJEXT): $(top_srcdir)/internal/util.h
debug.$(OBJEXT): $(top_srcdir)/internal/vm.h
debug.$(OBJEXT): $(top_srcdir)/internal/warnings.h
debug.$(OBJEXT): {$(VPATH)}assert.h
@@ -3432,6 +3503,7 @@ debug.$(OBJEXT): {$(VPATH)}config.h
debug.$(OBJEXT): {$(VPATH)}debug.c
debug.$(OBJEXT): {$(VPATH)}debug_counter.h
debug.$(OBJEXT): {$(VPATH)}defines.h
+debug.$(OBJEXT): {$(VPATH)}encindex.h
debug.$(OBJEXT): {$(VPATH)}encoding.h
debug.$(OBJEXT): {$(VPATH)}eval_intern.h
debug.$(OBJEXT): {$(VPATH)}gc.h
@@ -3508,6 +3580,15 @@ debug.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
debug.$(OBJEXT): {$(VPATH)}internal/ctype.h
debug.$(OBJEXT): {$(VPATH)}internal/dllexport.h
debug.$(OBJEXT): {$(VPATH)}internal/dosish.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+debug.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
debug.$(OBJEXT): {$(VPATH)}internal/error.h
debug.$(OBJEXT): {$(VPATH)}internal/eval.h
debug.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -3863,6 +3944,15 @@ dir.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
dir.$(OBJEXT): {$(VPATH)}internal/ctype.h
dir.$(OBJEXT): {$(VPATH)}internal/dllexport.h
dir.$(OBJEXT): {$(VPATH)}internal/dosish.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+dir.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
dir.$(OBJEXT): {$(VPATH)}internal/error.h
dir.$(OBJEXT): {$(VPATH)}internal/eval.h
dir.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -4563,6 +4653,15 @@ encoding.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
encoding.$(OBJEXT): {$(VPATH)}internal/ctype.h
encoding.$(OBJEXT): {$(VPATH)}internal/dllexport.h
encoding.$(OBJEXT): {$(VPATH)}internal/dosish.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+encoding.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
encoding.$(OBJEXT): {$(VPATH)}internal/error.h
encoding.$(OBJEXT): {$(VPATH)}internal/eval.h
encoding.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -4753,6 +4852,15 @@ enum.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
enum.$(OBJEXT): {$(VPATH)}internal/ctype.h
enum.$(OBJEXT): {$(VPATH)}internal/dllexport.h
enum.$(OBJEXT): {$(VPATH)}internal/dosish.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+enum.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
enum.$(OBJEXT): {$(VPATH)}internal/error.h
enum.$(OBJEXT): {$(VPATH)}internal/eval.h
enum.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -4938,6 +5046,15 @@ enumerator.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
enumerator.$(OBJEXT): {$(VPATH)}internal/ctype.h
enumerator.$(OBJEXT): {$(VPATH)}internal/dllexport.h
enumerator.$(OBJEXT): {$(VPATH)}internal/dosish.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+enumerator.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
enumerator.$(OBJEXT): {$(VPATH)}internal/error.h
enumerator.$(OBJEXT): {$(VPATH)}internal/eval.h
enumerator.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -5130,6 +5247,15 @@ error.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
error.$(OBJEXT): {$(VPATH)}internal/ctype.h
error.$(OBJEXT): {$(VPATH)}internal/dllexport.h
error.$(OBJEXT): {$(VPATH)}internal/dosish.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+error.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
error.$(OBJEXT): {$(VPATH)}internal/error.h
error.$(OBJEXT): {$(VPATH)}internal/eval.h
error.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -5336,6 +5462,15 @@ eval.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
eval.$(OBJEXT): {$(VPATH)}internal/ctype.h
eval.$(OBJEXT): {$(VPATH)}internal/dllexport.h
eval.$(OBJEXT): {$(VPATH)}internal/dosish.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+eval.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
eval.$(OBJEXT): {$(VPATH)}internal/error.h
eval.$(OBJEXT): {$(VPATH)}internal/eval.h
eval.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -5431,6 +5566,7 @@ eval.$(OBJEXT): {$(VPATH)}vm_debug.h
eval.$(OBJEXT): {$(VPATH)}vm_opts.h
explicit_bzero.$(OBJEXT): {$(VPATH)}config.h
explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
+explicit_bzero.$(OBJEXT): {$(VPATH)}internal/attr/format.h
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/compiler_is.h
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/compiler_is/apple.h
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/compiler_is/clang.h
@@ -5441,6 +5577,7 @@ explicit_bzero.$(OBJEXT): {$(VPATH)}internal/compiler_is/sunpro.h
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/compiler_since.h
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/config.h
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/dllexport.h
+explicit_bzero.$(OBJEXT): {$(VPATH)}internal/has/attribute.h
explicit_bzero.$(OBJEXT): {$(VPATH)}missing.h
file.$(OBJEXT): $(hdrdir)/ruby.h
file.$(OBJEXT): $(hdrdir)/ruby/ruby.h
@@ -5551,6 +5688,15 @@ file.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
file.$(OBJEXT): {$(VPATH)}internal/ctype.h
file.$(OBJEXT): {$(VPATH)}internal/dllexport.h
file.$(OBJEXT): {$(VPATH)}internal/dosish.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+file.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
file.$(OBJEXT): {$(VPATH)}internal/error.h
file.$(OBJEXT): {$(VPATH)}internal/eval.h
file.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -5759,6 +5905,15 @@ gc.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
gc.$(OBJEXT): {$(VPATH)}internal/ctype.h
gc.$(OBJEXT): {$(VPATH)}internal/dllexport.h
gc.$(OBJEXT): {$(VPATH)}internal/dosish.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+gc.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
gc.$(OBJEXT): {$(VPATH)}internal/error.h
gc.$(OBJEXT): {$(VPATH)}internal/eval.h
gc.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -6154,6 +6309,15 @@ hash.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
hash.$(OBJEXT): {$(VPATH)}internal/ctype.h
hash.$(OBJEXT): {$(VPATH)}internal/dllexport.h
hash.$(OBJEXT): {$(VPATH)}internal/dosish.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+hash.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
hash.$(OBJEXT): {$(VPATH)}internal/error.h
hash.$(OBJEXT): {$(VPATH)}internal/eval.h
hash.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -6521,6 +6685,15 @@ io.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
io.$(OBJEXT): {$(VPATH)}internal/ctype.h
io.$(OBJEXT): {$(VPATH)}internal/dllexport.h
io.$(OBJEXT): {$(VPATH)}internal/dosish.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+io.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
io.$(OBJEXT): {$(VPATH)}internal/error.h
io.$(OBJEXT): {$(VPATH)}internal/eval.h
io.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -6731,6 +6904,15 @@ iseq.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
iseq.$(OBJEXT): {$(VPATH)}internal/ctype.h
iseq.$(OBJEXT): {$(VPATH)}internal/dllexport.h
iseq.$(OBJEXT): {$(VPATH)}internal/dosish.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+iseq.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
iseq.$(OBJEXT): {$(VPATH)}internal/error.h
iseq.$(OBJEXT): {$(VPATH)}internal/eval.h
iseq.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -6932,6 +7114,15 @@ load.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
load.$(OBJEXT): {$(VPATH)}internal/ctype.h
load.$(OBJEXT): {$(VPATH)}internal/dllexport.h
load.$(OBJEXT): {$(VPATH)}internal/dosish.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+load.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
load.$(OBJEXT): {$(VPATH)}internal/error.h
load.$(OBJEXT): {$(VPATH)}internal/eval.h
load.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -7267,6 +7458,15 @@ localeinit.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
localeinit.$(OBJEXT): {$(VPATH)}internal/ctype.h
localeinit.$(OBJEXT): {$(VPATH)}internal/dllexport.h
localeinit.$(OBJEXT): {$(VPATH)}internal/dosish.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+localeinit.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
localeinit.$(OBJEXT): {$(VPATH)}internal/error.h
localeinit.$(OBJEXT): {$(VPATH)}internal/eval.h
localeinit.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -7519,6 +7719,7 @@ marshal.$(OBJEXT): $(top_srcdir)/internal/serial.h
marshal.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
marshal.$(OBJEXT): $(top_srcdir)/internal/string.h
marshal.$(OBJEXT): $(top_srcdir)/internal/struct.h
+marshal.$(OBJEXT): $(top_srcdir)/internal/symbol.h
marshal.$(OBJEXT): $(top_srcdir)/internal/util.h
marshal.$(OBJEXT): $(top_srcdir)/internal/vm.h
marshal.$(OBJEXT): $(top_srcdir)/internal/warnings.h
@@ -7532,6 +7733,7 @@ marshal.$(OBJEXT): {$(VPATH)}backward/2/limits.h
marshal.$(OBJEXT): {$(VPATH)}backward/2/long_long.h
marshal.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
marshal.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
+marshal.$(OBJEXT): {$(VPATH)}builtin.h
marshal.$(OBJEXT): {$(VPATH)}config.h
marshal.$(OBJEXT): {$(VPATH)}defines.h
marshal.$(OBJEXT): {$(VPATH)}encindex.h
@@ -7608,6 +7810,15 @@ marshal.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
marshal.$(OBJEXT): {$(VPATH)}internal/ctype.h
marshal.$(OBJEXT): {$(VPATH)}internal/dllexport.h
marshal.$(OBJEXT): {$(VPATH)}internal/dosish.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+marshal.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
marshal.$(OBJEXT): {$(VPATH)}internal/error.h
marshal.$(OBJEXT): {$(VPATH)}internal/eval.h
marshal.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -7680,6 +7891,8 @@ marshal.$(OBJEXT): {$(VPATH)}internal/warning_push.h
marshal.$(OBJEXT): {$(VPATH)}internal/xmalloc.h
marshal.$(OBJEXT): {$(VPATH)}io.h
marshal.$(OBJEXT): {$(VPATH)}marshal.c
+marshal.$(OBJEXT): {$(VPATH)}marshal.rb
+marshal.$(OBJEXT): {$(VPATH)}marshal.rbinc
marshal.$(OBJEXT): {$(VPATH)}missing.h
marshal.$(OBJEXT): {$(VPATH)}onigmo.h
marshal.$(OBJEXT): {$(VPATH)}oniguruma.h
@@ -7859,7 +8072,6 @@ math.$(OBJEXT): {$(VPATH)}st.h
math.$(OBJEXT): {$(VPATH)}subst.h
memory_view.$(OBJEXT): $(hdrdir)/ruby/ruby.h
memory_view.$(OBJEXT): $(top_srcdir)/internal/hash.h
-memory_view.$(OBJEXT): $(top_srcdir)/internal/util.h
memory_view.$(OBJEXT): $(top_srcdir)/internal/variable.h
memory_view.$(OBJEXT): {$(VPATH)}assert.h
memory_view.$(OBJEXT): {$(VPATH)}backward/2/assume.h
@@ -8023,6 +8235,7 @@ memory_view.$(OBJEXT): {$(VPATH)}missing.h
memory_view.$(OBJEXT): {$(VPATH)}node.h
memory_view.$(OBJEXT): {$(VPATH)}st.h
memory_view.$(OBJEXT): {$(VPATH)}subst.h
+memory_view.$(OBJEXT): {$(VPATH)}util.h
memory_view.$(OBJEXT): {$(VPATH)}vm_debug.h
memory_view.$(OBJEXT): {$(VPATH)}vm_sync.h
miniinit.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
@@ -8131,6 +8344,15 @@ miniinit.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
miniinit.$(OBJEXT): {$(VPATH)}internal/ctype.h
miniinit.$(OBJEXT): {$(VPATH)}internal/dllexport.h
miniinit.$(OBJEXT): {$(VPATH)}internal/dosish.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+miniinit.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
miniinit.$(OBJEXT): {$(VPATH)}internal/error.h
miniinit.$(OBJEXT): {$(VPATH)}internal/eval.h
miniinit.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -8204,6 +8426,7 @@ miniinit.$(OBJEXT): {$(VPATH)}internal/xmalloc.h
miniinit.$(OBJEXT): {$(VPATH)}io.rb
miniinit.$(OBJEXT): {$(VPATH)}iseq.h
miniinit.$(OBJEXT): {$(VPATH)}kernel.rb
+miniinit.$(OBJEXT): {$(VPATH)}marshal.rb
miniinit.$(OBJEXT): {$(VPATH)}method.h
miniinit.$(OBJEXT): {$(VPATH)}mini_builtin.c
miniinit.$(OBJEXT): {$(VPATH)}miniinit.c
@@ -8376,6 +8599,15 @@ mjit.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
mjit.$(OBJEXT): {$(VPATH)}internal/ctype.h
mjit.$(OBJEXT): {$(VPATH)}internal/dllexport.h
mjit.$(OBJEXT): {$(VPATH)}internal/dosish.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+mjit.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
mjit.$(OBJEXT): {$(VPATH)}internal/error.h
mjit.$(OBJEXT): {$(VPATH)}internal/eval.h
mjit.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -8974,6 +9206,15 @@ numeric.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
numeric.$(OBJEXT): {$(VPATH)}internal/ctype.h
numeric.$(OBJEXT): {$(VPATH)}internal/dllexport.h
numeric.$(OBJEXT): {$(VPATH)}internal/dosish.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+numeric.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
numeric.$(OBJEXT): {$(VPATH)}internal/error.h
numeric.$(OBJEXT): {$(VPATH)}internal/eval.h
numeric.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -9164,6 +9405,15 @@ object.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
object.$(OBJEXT): {$(VPATH)}internal/ctype.h
object.$(OBJEXT): {$(VPATH)}internal/dllexport.h
object.$(OBJEXT): {$(VPATH)}internal/dosish.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+object.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
object.$(OBJEXT): {$(VPATH)}internal/error.h
object.$(OBJEXT): {$(VPATH)}internal/eval.h
object.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -9255,7 +9505,6 @@ pack.$(OBJEXT): $(top_srcdir)/internal/compilers.h
pack.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
pack.$(OBJEXT): $(top_srcdir)/internal/string.h
pack.$(OBJEXT): $(top_srcdir)/internal/symbol.h
-pack.$(OBJEXT): $(top_srcdir)/internal/util.h
pack.$(OBJEXT): $(top_srcdir)/internal/variable.h
pack.$(OBJEXT): $(top_srcdir)/internal/warnings.h
pack.$(OBJEXT): {$(VPATH)}assert.h
@@ -9345,6 +9594,15 @@ pack.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
pack.$(OBJEXT): {$(VPATH)}internal/ctype.h
pack.$(OBJEXT): {$(VPATH)}internal/dllexport.h
pack.$(OBJEXT): {$(VPATH)}internal/dosish.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+pack.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
pack.$(OBJEXT): {$(VPATH)}internal/error.h
pack.$(OBJEXT): {$(VPATH)}internal/eval.h
pack.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -9422,6 +9680,7 @@ pack.$(OBJEXT): {$(VPATH)}pack.c
pack.$(OBJEXT): {$(VPATH)}pack.rbinc
pack.$(OBJEXT): {$(VPATH)}st.h
pack.$(OBJEXT): {$(VPATH)}subst.h
+pack.$(OBJEXT): {$(VPATH)}util.h
parse.$(OBJEXT): $(hdrdir)/ruby.h
parse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
parse.$(OBJEXT): $(top_srcdir)/internal/array.h
@@ -9445,7 +9704,6 @@ parse.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
parse.$(OBJEXT): $(top_srcdir)/internal/string.h
parse.$(OBJEXT): $(top_srcdir)/internal/symbol.h
parse.$(OBJEXT): $(top_srcdir)/internal/thread.h
-parse.$(OBJEXT): $(top_srcdir)/internal/util.h
parse.$(OBJEXT): $(top_srcdir)/internal/variable.h
parse.$(OBJEXT): $(top_srcdir)/internal/vm.h
parse.$(OBJEXT): $(top_srcdir)/internal/warnings.h
@@ -9537,6 +9795,15 @@ parse.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
parse.$(OBJEXT): {$(VPATH)}internal/ctype.h
parse.$(OBJEXT): {$(VPATH)}internal/dllexport.h
parse.$(OBJEXT): {$(VPATH)}internal/dosish.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+parse.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
parse.$(OBJEXT): {$(VPATH)}internal/error.h
parse.$(OBJEXT): {$(VPATH)}internal/eval.h
parse.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -9763,6 +10030,15 @@ proc.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
proc.$(OBJEXT): {$(VPATH)}internal/ctype.h
proc.$(OBJEXT): {$(VPATH)}internal/dllexport.h
proc.$(OBJEXT): {$(VPATH)}internal/dosish.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+proc.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
proc.$(OBJEXT): {$(VPATH)}internal/error.h
proc.$(OBJEXT): {$(VPATH)}internal/eval.h
proc.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -9967,6 +10243,15 @@ process.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
process.$(OBJEXT): {$(VPATH)}internal/ctype.h
process.$(OBJEXT): {$(VPATH)}internal/dllexport.h
process.$(OBJEXT): {$(VPATH)}internal/dosish.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+process.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
process.$(OBJEXT): {$(VPATH)}internal/error.h
process.$(OBJEXT): {$(VPATH)}internal/eval.h
process.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -10172,6 +10457,15 @@ ractor.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
ractor.$(OBJEXT): {$(VPATH)}internal/ctype.h
ractor.$(OBJEXT): {$(VPATH)}internal/dllexport.h
ractor.$(OBJEXT): {$(VPATH)}internal/dosish.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+ractor.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
ractor.$(OBJEXT): {$(VPATH)}internal/error.h
ractor.$(OBJEXT): {$(VPATH)}internal/eval.h
ractor.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -10556,6 +10850,15 @@ range.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
range.$(OBJEXT): {$(VPATH)}internal/ctype.h
range.$(OBJEXT): {$(VPATH)}internal/dllexport.h
range.$(OBJEXT): {$(VPATH)}internal/dosish.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+range.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
range.$(OBJEXT): {$(VPATH)}internal/error.h
range.$(OBJEXT): {$(VPATH)}internal/eval.h
range.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -10915,6 +11218,15 @@ re.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
re.$(OBJEXT): {$(VPATH)}internal/ctype.h
re.$(OBJEXT): {$(VPATH)}internal/dllexport.h
re.$(OBJEXT): {$(VPATH)}internal/dosish.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+re.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
re.$(OBJEXT): {$(VPATH)}internal/error.h
re.$(OBJEXT): {$(VPATH)}internal/eval.h
re.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -12089,6 +12401,15 @@ ruby.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
ruby.$(OBJEXT): {$(VPATH)}internal/ctype.h
ruby.$(OBJEXT): {$(VPATH)}internal/dllexport.h
ruby.$(OBJEXT): {$(VPATH)}internal/dosish.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+ruby.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
ruby.$(OBJEXT): {$(VPATH)}internal/error.h
ruby.$(OBJEXT): {$(VPATH)}internal/eval.h
ruby.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -12189,6 +12510,7 @@ scheduler.$(OBJEXT): $(top_srcdir)/internal/gc.h
scheduler.$(OBJEXT): $(top_srcdir)/internal/imemo.h
scheduler.$(OBJEXT): $(top_srcdir)/internal/serial.h
scheduler.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
+scheduler.$(OBJEXT): $(top_srcdir)/internal/thread.h
scheduler.$(OBJEXT): $(top_srcdir)/internal/vm.h
scheduler.$(OBJEXT): $(top_srcdir)/internal/warnings.h
scheduler.$(OBJEXT): {$(VPATH)}assert.h
@@ -12279,6 +12601,15 @@ scheduler.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
scheduler.$(OBJEXT): {$(VPATH)}internal/ctype.h
scheduler.$(OBJEXT): {$(VPATH)}internal/dllexport.h
scheduler.$(OBJEXT): {$(VPATH)}internal/dosish.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+scheduler.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
scheduler.$(OBJEXT): {$(VPATH)}internal/error.h
scheduler.$(OBJEXT): {$(VPATH)}internal/eval.h
scheduler.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -12631,6 +12962,15 @@ signal.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
signal.$(OBJEXT): {$(VPATH)}internal/ctype.h
signal.$(OBJEXT): {$(VPATH)}internal/dllexport.h
signal.$(OBJEXT): {$(VPATH)}internal/dosish.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+signal.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
signal.$(OBJEXT): {$(VPATH)}internal/error.h
signal.$(OBJEXT): {$(VPATH)}internal/eval.h
signal.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -12735,7 +13075,6 @@ sprintf.$(OBJEXT): $(top_srcdir)/internal/serial.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/string.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/symbol.h
-sprintf.$(OBJEXT): $(top_srcdir)/internal/util.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/vm.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/warnings.h
sprintf.$(OBJEXT): {$(VPATH)}assert.h
@@ -12825,6 +13164,15 @@ sprintf.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
sprintf.$(OBJEXT): {$(VPATH)}internal/ctype.h
sprintf.$(OBJEXT): {$(VPATH)}internal/dllexport.h
sprintf.$(OBJEXT): {$(VPATH)}internal/dosish.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+sprintf.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
sprintf.$(OBJEXT): {$(VPATH)}internal/error.h
sprintf.$(OBJEXT): {$(VPATH)}internal/eval.h
sprintf.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -12903,6 +13251,7 @@ sprintf.$(OBJEXT): {$(VPATH)}regex.h
sprintf.$(OBJEXT): {$(VPATH)}sprintf.c
sprintf.$(OBJEXT): {$(VPATH)}st.h
sprintf.$(OBJEXT): {$(VPATH)}subst.h
+sprintf.$(OBJEXT): {$(VPATH)}util.h
sprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
st.$(OBJEXT): $(hdrdir)/ruby.h
st.$(OBJEXT): $(hdrdir)/ruby/ruby.h
@@ -13075,7 +13424,6 @@ strftime.$(OBJEXT): $(top_srcdir)/internal/compilers.h
strftime.$(OBJEXT): $(top_srcdir)/internal/serial.h
strftime.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
strftime.$(OBJEXT): $(top_srcdir)/internal/string.h
-strftime.$(OBJEXT): $(top_srcdir)/internal/util.h
strftime.$(OBJEXT): $(top_srcdir)/internal/vm.h
strftime.$(OBJEXT): {$(VPATH)}assert.h
strftime.$(OBJEXT): {$(VPATH)}backward/2/assume.h
@@ -13161,6 +13509,15 @@ strftime.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
strftime.$(OBJEXT): {$(VPATH)}internal/ctype.h
strftime.$(OBJEXT): {$(VPATH)}internal/dllexport.h
strftime.$(OBJEXT): {$(VPATH)}internal/dosish.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+strftime.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
strftime.$(OBJEXT): {$(VPATH)}internal/error.h
strftime.$(OBJEXT): {$(VPATH)}internal/eval.h
strftime.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -13238,6 +13595,7 @@ strftime.$(OBJEXT): {$(VPATH)}st.h
strftime.$(OBJEXT): {$(VPATH)}strftime.c
strftime.$(OBJEXT): {$(VPATH)}subst.h
strftime.$(OBJEXT): {$(VPATH)}timev.h
+strftime.$(OBJEXT): {$(VPATH)}util.h
string.$(OBJEXT): $(hdrdir)/ruby.h
string.$(OBJEXT): $(hdrdir)/ruby/ruby.h
string.$(OBJEXT): $(top_srcdir)/internal/array.h
@@ -13353,6 +13711,15 @@ string.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
string.$(OBJEXT): {$(VPATH)}internal/ctype.h
string.$(OBJEXT): {$(VPATH)}internal/dllexport.h
string.$(OBJEXT): {$(VPATH)}internal/dosish.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+string.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
string.$(OBJEXT): {$(VPATH)}internal/error.h
string.$(OBJEXT): {$(VPATH)}internal/eval.h
string.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -13440,6 +13807,7 @@ string.$(OBJEXT): {$(VPATH)}util.h
string.$(OBJEXT): {$(VPATH)}vm_debug.h
string.$(OBJEXT): {$(VPATH)}vm_sync.h
strlcat.$(OBJEXT): {$(VPATH)}config.h
+strlcat.$(OBJEXT): {$(VPATH)}internal/attr/format.h
strlcat.$(OBJEXT): {$(VPATH)}internal/compiler_is.h
strlcat.$(OBJEXT): {$(VPATH)}internal/compiler_is/apple.h
strlcat.$(OBJEXT): {$(VPATH)}internal/compiler_is/clang.h
@@ -13450,9 +13818,11 @@ strlcat.$(OBJEXT): {$(VPATH)}internal/compiler_is/sunpro.h
strlcat.$(OBJEXT): {$(VPATH)}internal/compiler_since.h
strlcat.$(OBJEXT): {$(VPATH)}internal/config.h
strlcat.$(OBJEXT): {$(VPATH)}internal/dllexport.h
+strlcat.$(OBJEXT): {$(VPATH)}internal/has/attribute.h
strlcat.$(OBJEXT): {$(VPATH)}missing.h
strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
strlcpy.$(OBJEXT): {$(VPATH)}config.h
+strlcpy.$(OBJEXT): {$(VPATH)}internal/attr/format.h
strlcpy.$(OBJEXT): {$(VPATH)}internal/compiler_is.h
strlcpy.$(OBJEXT): {$(VPATH)}internal/compiler_is/apple.h
strlcpy.$(OBJEXT): {$(VPATH)}internal/compiler_is/clang.h
@@ -13463,6 +13833,7 @@ strlcpy.$(OBJEXT): {$(VPATH)}internal/compiler_is/sunpro.h
strlcpy.$(OBJEXT): {$(VPATH)}internal/compiler_since.h
strlcpy.$(OBJEXT): {$(VPATH)}internal/config.h
strlcpy.$(OBJEXT): {$(VPATH)}internal/dllexport.h
+strlcpy.$(OBJEXT): {$(VPATH)}internal/has/attribute.h
strlcpy.$(OBJEXT): {$(VPATH)}missing.h
strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
struct.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
@@ -13575,6 +13946,15 @@ struct.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
struct.$(OBJEXT): {$(VPATH)}internal/ctype.h
struct.$(OBJEXT): {$(VPATH)}internal/dllexport.h
struct.$(OBJEXT): {$(VPATH)}internal/dosish.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+struct.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
struct.$(OBJEXT): {$(VPATH)}internal/error.h
struct.$(OBJEXT): {$(VPATH)}internal/eval.h
struct.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -13764,6 +14144,15 @@ symbol.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
symbol.$(OBJEXT): {$(VPATH)}internal/ctype.h
symbol.$(OBJEXT): {$(VPATH)}internal/dllexport.h
symbol.$(OBJEXT): {$(VPATH)}internal/dosish.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+symbol.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
symbol.$(OBJEXT): {$(VPATH)}internal/error.h
symbol.$(OBJEXT): {$(VPATH)}internal/eval.h
symbol.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -13968,6 +14357,15 @@ thread.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
thread.$(OBJEXT): {$(VPATH)}internal/ctype.h
thread.$(OBJEXT): {$(VPATH)}internal/dllexport.h
thread.$(OBJEXT): {$(VPATH)}internal/dosish.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+thread.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
thread.$(OBJEXT): {$(VPATH)}internal/error.h
thread.$(OBJEXT): {$(VPATH)}internal/eval.h
thread.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -14169,6 +14567,15 @@ time.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
time.$(OBJEXT): {$(VPATH)}internal/ctype.h
time.$(OBJEXT): {$(VPATH)}internal/dllexport.h
time.$(OBJEXT): {$(VPATH)}internal/dosish.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+time.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
time.$(OBJEXT): {$(VPATH)}internal/error.h
time.$(OBJEXT): {$(VPATH)}internal/eval.h
time.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -14347,6 +14754,15 @@ transcode.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
transcode.$(OBJEXT): {$(VPATH)}internal/ctype.h
transcode.$(OBJEXT): {$(VPATH)}internal/dllexport.h
transcode.$(OBJEXT): {$(VPATH)}internal/dosish.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+transcode.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
transcode.$(OBJEXT): {$(VPATH)}internal/error.h
transcode.$(OBJEXT): {$(VPATH)}internal/eval.h
transcode.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -14897,6 +15313,15 @@ variable.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
variable.$(OBJEXT): {$(VPATH)}internal/ctype.h
variable.$(OBJEXT): {$(VPATH)}internal/dllexport.h
variable.$(OBJEXT): {$(VPATH)}internal/dosish.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+variable.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
variable.$(OBJEXT): {$(VPATH)}internal/error.h
variable.$(OBJEXT): {$(VPATH)}internal/eval.h
variable.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -15306,6 +15731,15 @@ vm.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
vm.$(OBJEXT): {$(VPATH)}internal/ctype.h
vm.$(OBJEXT): {$(VPATH)}internal/dllexport.h
vm.$(OBJEXT): {$(VPATH)}internal/dosish.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+vm.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
vm.$(OBJEXT): {$(VPATH)}internal/error.h
vm.$(OBJEXT): {$(VPATH)}internal/eval.h
vm.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -15516,6 +15950,15 @@ vm_backtrace.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
vm_backtrace.$(OBJEXT): {$(VPATH)}internal/ctype.h
vm_backtrace.$(OBJEXT): {$(VPATH)}internal/dllexport.h
vm_backtrace.$(OBJEXT): {$(VPATH)}internal/dosish.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
vm_backtrace.$(OBJEXT): {$(VPATH)}internal/error.h
vm_backtrace.$(OBJEXT): {$(VPATH)}internal/eval.h
vm_backtrace.$(OBJEXT): {$(VPATH)}internal/event.h
@@ -16096,6 +16539,15 @@ vm_trace.$(OBJEXT): {$(VPATH)}internal/core/rtypeddata.h
vm_trace.$(OBJEXT): {$(VPATH)}internal/ctype.h
vm_trace.$(OBJEXT): {$(VPATH)}internal/dllexport.h
vm_trace.$(OBJEXT): {$(VPATH)}internal/dosish.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/coderange.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/ctype.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/encoding.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/pathname.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/re.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/sprintf.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/string.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/symbol.h
+vm_trace.$(OBJEXT): {$(VPATH)}internal/encoding/transcode.h
vm_trace.$(OBJEXT): {$(VPATH)}internal/error.h
vm_trace.$(OBJEXT): {$(VPATH)}internal/eval.h
vm_trace.$(OBJEXT): {$(VPATH)}internal/event.h
diff --git a/compar.c b/compar.c
index 0de318525c..e9d1ac41f9 100644
--- a/compar.c
+++ b/compar.c
@@ -84,8 +84,7 @@ cmp_equal(VALUE x, VALUE y)
c = rb_exec_recursive_paired_outer(cmp_eq_recursive, x, y, y);
if (NIL_P(c)) return Qfalse;
- if (rb_cmpint(c, x, y) == 0) return Qtrue;
- return Qfalse;
+ return RBOOL(rb_cmpint(c, x, y) == 0);
}
static int
@@ -105,8 +104,7 @@ cmpint(VALUE x, VALUE y)
static VALUE
cmp_gt(VALUE x, VALUE y)
{
- if (cmpint(x, y) > 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) > 0);
}
/*
@@ -120,8 +118,7 @@ cmp_gt(VALUE x, VALUE y)
static VALUE
cmp_ge(VALUE x, VALUE y)
{
- if (cmpint(x, y) >= 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) >= 0);
}
/*
@@ -135,8 +132,7 @@ cmp_ge(VALUE x, VALUE y)
static VALUE
cmp_lt(VALUE x, VALUE y)
{
- if (cmpint(x, y) < 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) < 0);
}
/*
@@ -150,8 +146,7 @@ cmp_lt(VALUE x, VALUE y)
static VALUE
cmp_le(VALUE x, VALUE y)
{
- if (cmpint(x, y) <= 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) <= 0);
}
/*
diff --git a/compile.c b/compile.c
index 6695a0293b..e9295a47b4 100644
--- a/compile.c
+++ b/compile.c
@@ -353,9 +353,9 @@ static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, const NOD
/* error */
#if CPDEBUG > 0
-NORETURN(static void append_compile_error(const rb_iseq_t *iseq, int line, const char *fmt, ...));
+RBIMPL_ATTR_NORETURN()
#endif
-
+RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 4)
static void
append_compile_error(const rb_iseq_t *iseq, int line, const char *fmt, ...)
{
@@ -1633,7 +1633,7 @@ access_outer_variables(const rb_iseq_t *iseq, int level, ID id, bool write)
if (isolated_depth && level >= isolated_depth) {
if (id == rb_intern("yield")) {
- COMPILE_ERROR(iseq, ISEQ_LAST_LINE(iseq), "can not yield from isolated Proc", rb_id2name(id));
+ COMPILE_ERROR(iseq, ISEQ_LAST_LINE(iseq), "can not yield from isolated Proc");
}
else {
COMPILE_ERROR(iseq, ISEQ_LAST_LINE(iseq), "can not access variable `%s' from isolated Proc", rb_id2name(id));
@@ -1654,7 +1654,7 @@ access_outer_variables(const rb_iseq_t *iseq, int level, ID id, bool write)
}
}
else {
- rb_id_table_insert(iseq->body->outer_variables, id, write ? Qtrue : Qfalse);
+ rb_id_table_insert(iseq->body->outer_variables, id, RBOOL(write));
}
iseq = iseq->body->parent_iseq;
@@ -3441,6 +3441,7 @@ insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
{
iobj->insn_id = insn_id;
iobj->operand_size = insn_len(insn_id) - 1;
+ iobj->insn_info.events |= RUBY_EVENT_C_CALL | RUBY_EVENT_C_RETURN;
if (insn_id == BIN(opt_neq)) {
VALUE original_ci = iobj->operands[0];
@@ -3935,6 +3936,20 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *cons
}
static int
+compile_block(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped)
+{
+ while (node && nd_type(node) == NODE_BLOCK) {
+ CHECK(COMPILE_(ret, "BLOCK body", node->nd_head,
+ (node->nd_next ? 1 : popped)));
+ node = node->nd_next;
+ }
+ if (node) {
+ CHECK(COMPILE_(ret, "BLOCK next", node->nd_next, popped));
+ }
+ return COMPILE_OK;
+}
+
+static int
compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node)
{
int cnt;
@@ -4088,7 +4103,7 @@ compile_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
seen_nodes++;
assert(nd_type(node) == NODE_LIST);
- if (key_node && nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {
+ if (key_node && nd_type(key_node) == NODE_LIT && SYMBOL_P(key_node->nd_lit)) {
/* can be keywords */
}
else {
@@ -4536,7 +4551,7 @@ rb_node_case_when_optimizable_literal(const NODE *const node)
case NODE_LIT: {
VALUE v = node->nd_lit;
double ival;
- if (RB_TYPE_P(v, T_FLOAT) &&
+ if (RB_FLOAT_TYPE_P(v) &&
modf(RFLOAT_VALUE(v), &ival) == 0.0) {
return FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
}
@@ -5481,7 +5496,7 @@ setup_args_core(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
switch (nd_type(argn)) {
case NODE_SPLAT: {
NO_CHECK(COMPILE(args, "args (splat)", argn->nd_head));
- ADD_INSN1(args, argn, splatarray, dup_rest ? Qtrue : Qfalse);
+ ADD_INSN1(args, argn, splatarray, RBOOL(dup_rest));
if (flag) *flag |= VM_CALL_ARGS_SPLAT;
return INT2FIX(1);
}
@@ -5939,12 +5954,22 @@ compile_case2(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
return COMPILE_OK;
}
-static int iseq_compile_pattern_match(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *unmatched, int in_alt_pattern, int deconstructed_pos);
+static int iseq_compile_pattern_match(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *unmatched, bool in_single_pattern, bool in_alt_pattern, int base_index, bool use_deconstructed_cache);
+
+static int iseq_compile_pattern_constant(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *match_failed, bool in_single_pattern, int base_index);
+static int iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *deconstruct, LABEL *deconstructed, LABEL *match_failed, LABEL *type_error, bool in_single_pattern, int base_index, bool use_deconstructed_cache);
+static int iseq_compile_pattern_set_general_errmsg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, VALUE errmsg, int base_index);
+static int iseq_compile_pattern_set_length_errmsg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, VALUE errmsg, VALUE pattern_length, int base_index);
+static int iseq_compile_pattern_set_eqq_errmsg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int base_index);
-static int iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *deconstruct, LABEL *deconstructed, LABEL *match_failed, LABEL *type_error, int deconstructed_pos);
+#define CASE3_BI_OFFSET_DECONSTRUCTED_CACHE 0
+#define CASE3_BI_OFFSET_ERROR_STRING 1
+#define CASE3_BI_OFFSET_KEY_ERROR_P 2
+#define CASE3_BI_OFFSET_KEY_ERROR_MATCHEE 3
+#define CASE3_BI_OFFSET_KEY_ERROR_KEY 4
static int
-iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *matched, LABEL *unmatched, int in_alt_pattern, int deconstructed_pos)
+iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *matched, LABEL *unmatched, bool in_single_pattern, bool in_alt_pattern, int base_index, bool use_deconstructed_cache)
{
const int line = nd_line(node);
const NODE *line_node = node;
@@ -6022,31 +6047,32 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
if (use_rest_num) {
ADD_INSN1(ret, line_node, putobject, INT2FIX(0)); /* allocate stack for rest_num */
ADD_INSN(ret, line_node, swap);
- if (deconstructed_pos) {
- deconstructed_pos++;
+ if (base_index) {
+ base_index++;
}
}
- if (node->nd_pconst) {
- ADD_INSN(ret, line_node, dup);
- CHECK(COMPILE(ret, "constant", node->nd_pconst));
- ADD_INSN1(ret, line_node, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- ADD_INSNL(ret, line_node, branchunless, match_failed);
- }
+ CHECK(iseq_compile_pattern_constant(iseq, ret, node, match_failed, in_single_pattern, base_index));
- CHECK(iseq_compile_array_deconstruct(iseq, ret, node, deconstruct, deconstructed, match_failed, type_error, deconstructed_pos));
+ CHECK(iseq_compile_array_deconstruct(iseq, ret, node, deconstruct, deconstructed, match_failed, type_error, in_single_pattern, base_index, use_deconstructed_cache));
ADD_INSN(ret, line_node, dup);
ADD_SEND(ret, line_node, idLength, INT2FIX(0));
ADD_INSN1(ret, line_node, putobject, INT2FIX(min_argc));
- ADD_SEND(ret, line_node, apinfo->rest_arg ? idGE : idEq, INT2FIX(1));
+ ADD_SEND(ret, line_node, apinfo->rest_arg ? idGE : idEq, INT2FIX(1)); // (1)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_length_errmsg(iseq, ret, node,
+ apinfo->rest_arg ? rb_fstring_lit("%p length mismatch (given %p, expected %p+)") :
+ rb_fstring_lit("%p length mismatch (given %p, expected %p)"),
+ INT2FIX(min_argc), base_index + 1 /* (1) */));
+ }
ADD_INSNL(ret, line_node, branchunless, match_failed);
for (i = 0; i < pre_args_num; i++) {
ADD_INSN(ret, line_node, dup);
ADD_INSN1(ret, line_node, putobject, INT2FIX(i));
- ADD_SEND(ret, line_node, idAREF, INT2FIX(1));
- CHECK(iseq_compile_pattern_match(iseq, ret, args->nd_head, match_failed, in_alt_pattern, FALSE));
+ ADD_SEND(ret, line_node, idAREF, INT2FIX(1)); // (2)
+ CHECK(iseq_compile_pattern_match(iseq, ret, args->nd_head, match_failed, in_single_pattern, in_alt_pattern, base_index + 1 /* (2) */, false));
args = args->nd_next;
}
@@ -6059,9 +6085,9 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN1(ret, line_node, putobject, INT2FIX(min_argc));
ADD_SEND(ret, line_node, idMINUS, INT2FIX(1));
ADD_INSN1(ret, line_node, setn, INT2FIX(4));
- ADD_SEND(ret, line_node, idAREF, INT2FIX(2));
+ ADD_SEND(ret, line_node, idAREF, INT2FIX(2)); // (3)
- CHECK(iseq_compile_pattern_match(iseq, ret, apinfo->rest_arg, match_failed, in_alt_pattern, FALSE));
+ CHECK(iseq_compile_pattern_match(iseq, ret, apinfo->rest_arg, match_failed, in_single_pattern, in_alt_pattern, base_index + 1 /* (3) */, false));
}
else {
if (post_args_num > 0) {
@@ -6083,8 +6109,8 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN1(ret, line_node, topn, INT2FIX(3));
ADD_SEND(ret, line_node, idPLUS, INT2FIX(1));
- ADD_SEND(ret, line_node, idAREF, INT2FIX(1));
- CHECK(iseq_compile_pattern_match(iseq, ret, args->nd_head, match_failed, in_alt_pattern, FALSE));
+ ADD_SEND(ret, line_node, idAREF, INT2FIX(1)); // (4)
+ CHECK(iseq_compile_pattern_match(iseq, ret, args->nd_head, match_failed, in_single_pattern, in_alt_pattern, base_index + 1 /* (4) */, false));
args = args->nd_next;
}
@@ -6173,19 +6199,17 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
deconstruct = NEW_LABEL(line);
deconstructed = NEW_LABEL(line);
- if (node->nd_pconst) {
- ADD_INSN(ret, line_node, dup);
- CHECK(COMPILE(ret, "constant", node->nd_pconst));
- ADD_INSN1(ret, line_node, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- ADD_INSNL(ret, line_node, branchunless, match_failed);
- }
+ CHECK(iseq_compile_pattern_constant(iseq, ret, node, match_failed, in_single_pattern, base_index));
- CHECK(iseq_compile_array_deconstruct(iseq, ret, node, deconstruct, deconstructed, match_failed, type_error, deconstructed_pos));
+ CHECK(iseq_compile_array_deconstruct(iseq, ret, node, deconstruct, deconstructed, match_failed, type_error, in_single_pattern, base_index, use_deconstructed_cache));
ADD_INSN(ret, line_node, dup);
ADD_SEND(ret, line_node, idLength, INT2FIX(0));
ADD_INSN1(ret, line_node, putobject, INT2FIX(args_num));
- ADD_SEND(ret, line_node, idGE, INT2FIX(1));
+ ADD_SEND(ret, line_node, idGE, INT2FIX(1)); // (1)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_length_errmsg(iseq, ret, node, rb_fstring_lit("%p length mismatch (given %p, expected %p+)"), INT2FIX(args_num), base_index + 1 /* (1) */));
+ }
ADD_INSNL(ret, line_node, branchunless, match_failed);
{
@@ -6196,13 +6220,13 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
int j;
ADD_INSN(ret, line_node, dup); /* allocate stack for len */
- ADD_SEND(ret, line_node, idLength, INT2FIX(0));
+ ADD_SEND(ret, line_node, idLength, INT2FIX(0)); // (2)
ADD_INSN(ret, line_node, dup); /* allocate stack for limit */
ADD_INSN1(ret, line_node, putobject, INT2FIX(args_num));
- ADD_SEND(ret, line_node, idMINUS, INT2FIX(1));
+ ADD_SEND(ret, line_node, idMINUS, INT2FIX(1)); // (3)
- ADD_INSN1(ret, line_node, putobject, INT2FIX(0)); /* allocate stack for i */
+ ADD_INSN1(ret, line_node, putobject, INT2FIX(0)); /* allocate stack for i */ // (4)
ADD_LABEL(ret, while_begin);
@@ -6218,9 +6242,9 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN1(ret, line_node, putobject, INT2FIX(j));
ADD_SEND(ret, line_node, idPLUS, INT2FIX(1));
}
- ADD_SEND(ret, line_node, idAREF, INT2FIX(1));
+ ADD_SEND(ret, line_node, idAREF, INT2FIX(1)); // (5)
- CHECK(iseq_compile_pattern_match(iseq, ret, args->nd_head, next_loop, in_alt_pattern, FALSE));
+ CHECK(iseq_compile_pattern_match(iseq, ret, args->nd_head, next_loop, in_single_pattern, in_alt_pattern, base_index + 4 /* (2), (3), (4), (5) */, false));
args = args->nd_next;
}
@@ -6228,8 +6252,8 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN1(ret, line_node, topn, INT2FIX(3));
ADD_INSN1(ret, line_node, putobject, INT2FIX(0));
ADD_INSN1(ret, line_node, topn, INT2FIX(2));
- ADD_SEND(ret, line_node, idAREF, INT2FIX(2));
- CHECK(iseq_compile_pattern_match(iseq, ret, fpinfo->pre_rest_arg, find_failed, in_alt_pattern, FALSE));
+ ADD_SEND(ret, line_node, idAREF, INT2FIX(2)); // (6)
+ CHECK(iseq_compile_pattern_match(iseq, ret, fpinfo->pre_rest_arg, find_failed, in_single_pattern, in_alt_pattern, base_index + 4 /* (2), (3), (4), (6) */, false));
}
if (NODE_NAMED_REST_P(fpinfo->post_rest_arg)) {
ADD_INSN1(ret, line_node, topn, INT2FIX(3));
@@ -6237,8 +6261,8 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN1(ret, line_node, putobject, INT2FIX(args_num));
ADD_SEND(ret, line_node, idPLUS, INT2FIX(1));
ADD_INSN1(ret, line_node, topn, INT2FIX(3));
- ADD_SEND(ret, line_node, idAREF, INT2FIX(2));
- CHECK(iseq_compile_pattern_match(iseq, ret, fpinfo->post_rest_arg, find_failed, in_alt_pattern, FALSE));
+ ADD_SEND(ret, line_node, idAREF, INT2FIX(2)); // (7)
+ CHECK(iseq_compile_pattern_match(iseq, ret, fpinfo->post_rest_arg, find_failed, in_single_pattern, in_alt_pattern, base_index + 4 /* (2), (3),(4), (7) */, false));
}
ADD_INSNL(ret, line_node, jump, find_succeeded);
@@ -6248,16 +6272,25 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSNL(ret, line_node, jump, while_begin);
ADD_LABEL(ret, find_failed);
- ADD_INSN(ret, line_node, pop);
- ADD_INSN(ret, line_node, pop);
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN1(ret, line_node, adjuststack, INT2FIX(3));
+ if (in_single_pattern) {
+ ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line_node, putobject, rb_fstring_lit("%p does not match to find pattern"));
+ ADD_INSN1(ret, line_node, topn, INT2FIX(2));
+ ADD_SEND(ret, line_node, id_core_sprintf, INT2FIX(2)); // (8)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_ERROR_STRING + 1 /* (8) */)); // (9)
+
+ ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_P + 2 /* (8), (9) */));
+
+ ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, line_node, pop);
+ }
ADD_INSNL(ret, line_node, jump, match_failed);
ADD_INSN1(ret, line_node, dupn, INT2FIX(3));
ADD_LABEL(ret, find_succeeded);
- ADD_INSN(ret, line_node, pop);
- ADD_INSN(ret, line_node, pop);
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN1(ret, line_node, adjuststack, INT2FIX(3));
}
ADD_INSN(ret, line_node, pop);
@@ -6352,16 +6385,14 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
}
}
- if (node->nd_pconst) {
- ADD_INSN(ret, line_node, dup);
- CHECK(COMPILE(ret, "constant", node->nd_pconst));
- ADD_INSN1(ret, line_node, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- ADD_INSNL(ret, line_node, branchunless, match_failed);
- }
+ CHECK(iseq_compile_pattern_constant(iseq, ret, node, match_failed, in_single_pattern, base_index));
ADD_INSN(ret, line_node, dup);
ADD_INSN1(ret, line_node, putobject, ID2SYM(rb_intern("deconstruct_keys")));
- ADD_SEND(ret, line_node, idRespond_to, INT2FIX(1));
+ ADD_SEND(ret, line_node, idRespond_to, INT2FIX(1)); // (1)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_general_errmsg(iseq, ret, node, rb_fstring_lit("%p does not respond to #deconstruct_keys"), base_index + 1 /* (1) */));
+ }
ADD_INSNL(ret, line_node, branchunless, match_failed);
if (NIL_P(keys)) {
@@ -6371,7 +6402,7 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN1(ret, line_node, duparray, keys);
RB_OBJ_WRITTEN(iseq, Qundef, rb_obj_hide(keys));
}
- ADD_SEND(ret, line_node, rb_intern("deconstruct_keys"), INT2FIX(1));
+ ADD_SEND(ret, line_node, rb_intern("deconstruct_keys"), INT2FIX(1)); // (2)
ADD_INSN(ret, line_node, dup);
ADD_INSN1(ret, line_node, checktype, INT2FIX(T_HASH));
@@ -6402,13 +6433,33 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
ADD_INSN(ret, line_node, dup);
ADD_INSN1(ret, line_node, putobject, key);
- ADD_SEND(ret, line_node, rb_intern("key?"), INT2FIX(1));
+ ADD_SEND(ret, line_node, rb_intern("key?"), INT2FIX(1)); // (3)
+ if (in_single_pattern) {
+ LABEL *match_succeeded;
+ match_succeeded = NEW_LABEL(line);
+
+ ADD_INSN(ret, line_node, dup);
+ ADD_INSNL(ret, line_node, branchif, match_succeeded);
+
+ ADD_INSN1(ret, line_node, putobject, rb_str_freeze(rb_sprintf("key not found: %+"PRIsVALUE, key))); // (4)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_ERROR_STRING + 2 /* (3), (4) */));
+ ADD_INSN1(ret, line_node, putobject, Qtrue); // (5)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_P + 3 /* (3), (4), (5) */));
+ ADD_INSN1(ret, line_node, topn, INT2FIX(3)); // (6)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_MATCHEE + 4 /* (3), (4), (5), (6) */));
+ ADD_INSN1(ret, line_node, putobject, key); // (7)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_KEY + 5 /* (3), (4), (5), (6), (7) */));
+
+ ADD_INSN1(ret, line_node, adjuststack, INT2FIX(4));
+
+ ADD_LABEL(ret, match_succeeded);
+ }
ADD_INSNL(ret, line_node, branchunless, match_failed);
ADD_INSN(match_values, line_node, dup);
ADD_INSN1(match_values, line_node, putobject, key);
- ADD_SEND(match_values, line_node, node->nd_pkwrestarg ? rb_intern("delete") : idAREF, INT2FIX(1));
- CHECK(iseq_compile_pattern_match(iseq, match_values, value_node, match_failed, in_alt_pattern, FALSE));
+ ADD_SEND(match_values, line_node, node->nd_pkwrestarg ? rb_intern("delete") : idAREF, INT2FIX(1)); // (8)
+ CHECK(iseq_compile_pattern_match(iseq, match_values, value_node, match_failed, in_single_pattern, in_alt_pattern, base_index + 1 /* (8) */, false));
args = args->nd_next->nd_next;
}
ADD_SEQ(ret, match_values);
@@ -6416,19 +6467,25 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
}
else {
ADD_INSN(ret, line_node, dup);
- ADD_SEND(ret, line_node, idEmptyP, INT2FIX(0));
+ ADD_SEND(ret, line_node, idEmptyP, INT2FIX(0)); // (9)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_general_errmsg(iseq, ret, node, rb_fstring_lit("%p is not empty"), base_index + 1 /* (9) */));
+ }
ADD_INSNL(ret, line_node, branchunless, match_failed);
}
if (node->nd_pkwrestarg) {
if (node->nd_pkwrestarg == NODE_SPECIAL_NO_REST_KEYWORD) {
ADD_INSN(ret, line_node, dup);
- ADD_SEND(ret, line_node, idEmptyP, INT2FIX(0));
+ ADD_SEND(ret, line_node, idEmptyP, INT2FIX(0)); // (10)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_general_errmsg(iseq, ret, node, rb_fstring_lit("rest of %p is not empty"), base_index + 1 /* (10) */));
+ }
ADD_INSNL(ret, line_node, branchunless, match_failed);
}
else {
- ADD_INSN(ret, line_node, dup);
- CHECK(iseq_compile_pattern_match(iseq, ret, node->nd_pkwrestarg, match_failed, in_alt_pattern, FALSE));
+ ADD_INSN(ret, line_node, dup); // (11)
+ CHECK(iseq_compile_pattern_match(iseq, ret, node->nd_pkwrestarg, match_failed, in_single_pattern, in_alt_pattern, base_index + 1 /* (11) */, false));
}
}
@@ -6472,8 +6529,14 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
case NODE_COLON2:
case NODE_COLON3:
case NODE_BEGIN:
- CHECK(COMPILE(ret, "case in literal", node));
- ADD_INSN1(ret, line_node, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
+ CHECK(COMPILE(ret, "case in literal", node)); // (1)
+ if (in_single_pattern) {
+ ADD_INSN1(ret, line_node, dupn, INT2FIX(2));
+ }
+ ADD_INSN1(ret, line_node, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE)); // (2)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_eqq_errmsg(iseq, ret, node, base_index + 2 /* (1), (2) */));
+ }
ADD_INSNL(ret, line_node, branchif, matched);
ADD_INSNL(ret, line_node, jump, unmatched);
break;
@@ -6524,8 +6587,30 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
case NODE_UNLESS: {
LABEL *match_failed;
match_failed = unmatched;
- CHECK(iseq_compile_pattern_match(iseq, ret, node->nd_body, unmatched, in_alt_pattern, deconstructed_pos));
+ CHECK(iseq_compile_pattern_match(iseq, ret, node->nd_body, unmatched, in_single_pattern, in_alt_pattern, base_index, use_deconstructed_cache));
CHECK(COMPILE(ret, "case in if", node->nd_cond));
+ if (in_single_pattern) {
+ LABEL *match_succeeded;
+ match_succeeded = NEW_LABEL(line);
+
+ ADD_INSN(ret, line_node, dup);
+ if (nd_type(node) == NODE_IF) {
+ ADD_INSNL(ret, line_node, branchif, match_succeeded);
+ }
+ else {
+ ADD_INSNL(ret, line_node, branchunless, match_succeeded);
+ }
+
+ ADD_INSN1(ret, line_node, putobject, rb_fstring_lit("guard clause does not return true")); // (1)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_ERROR_STRING + 1 /* (1) */)); // (2)
+ ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_P + 2 /* (1), (2) */));
+
+ ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, line_node, pop);
+
+ ADD_LABEL(ret, match_succeeded);
+ }
if (nd_type(node) == NODE_IF) {
ADD_INSNL(ret, line_node, branchunless, match_failed);
}
@@ -6546,9 +6631,9 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
return COMPILE_NG;
}
- ADD_INSN(ret, line_node, dup);
- CHECK(iseq_compile_pattern_match(iseq, ret, n->nd_head, match_failed, in_alt_pattern, deconstructed_pos ? deconstructed_pos + 1 : FALSE));
- CHECK(iseq_compile_pattern_each(iseq, ret, n->nd_next->nd_head, matched, match_failed, in_alt_pattern, FALSE));
+ ADD_INSN(ret, line_node, dup); // (1)
+ CHECK(iseq_compile_pattern_match(iseq, ret, n->nd_head, match_failed, in_single_pattern, in_alt_pattern, base_index + 1 /* (1) */, use_deconstructed_cache));
+ CHECK(iseq_compile_pattern_each(iseq, ret, n->nd_next->nd_head, matched, match_failed, in_single_pattern, in_alt_pattern, base_index, false));
ADD_INSN(ret, line_node, putnil);
ADD_LABEL(ret, match_failed);
@@ -6561,14 +6646,14 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
match_succeeded = NEW_LABEL(line);
fin = NEW_LABEL(line);
- ADD_INSN(ret, line_node, dup);
- CHECK(iseq_compile_pattern_each(iseq, ret, node->nd_1st, match_succeeded, fin, TRUE, deconstructed_pos ? deconstructed_pos + 1 : FALSE));
+ ADD_INSN(ret, line_node, dup); // (1)
+ CHECK(iseq_compile_pattern_each(iseq, ret, node->nd_1st, match_succeeded, fin, in_single_pattern, true, base_index + 1 /* (1) */, use_deconstructed_cache));
ADD_LABEL(ret, match_succeeded);
ADD_INSN(ret, line_node, pop);
ADD_INSNL(ret, line_node, jump, matched);
ADD_INSN(ret, line_node, putnil);
ADD_LABEL(ret, fin);
- CHECK(iseq_compile_pattern_each(iseq, ret, node->nd_2nd, matched, unmatched, TRUE, deconstructed_pos));
+ CHECK(iseq_compile_pattern_each(iseq, ret, node->nd_2nd, matched, unmatched, in_single_pattern, true, base_index, use_deconstructed_cache));
break;
}
default:
@@ -6578,35 +6663,54 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
}
static int
-iseq_compile_pattern_match(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *unmatched, int in_alt_pattern, int deconstructed_pos)
+iseq_compile_pattern_match(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *unmatched, bool in_single_pattern, bool in_alt_pattern, int base_index, bool use_deconstructed_cache)
{
LABEL *fin = NEW_LABEL(nd_line(node));
- CHECK(iseq_compile_pattern_each(iseq, ret, node, fin, unmatched, in_alt_pattern, deconstructed_pos));
+ CHECK(iseq_compile_pattern_each(iseq, ret, node, fin, unmatched, in_single_pattern, in_alt_pattern, base_index, use_deconstructed_cache));
ADD_LABEL(ret, fin);
return COMPILE_OK;
}
static int
-iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *deconstruct, LABEL *deconstructed, LABEL *match_failed, LABEL *type_error, int deconstructed_pos)
+iseq_compile_pattern_constant(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *match_failed, bool in_single_pattern, int base_index)
+{
+ const NODE *line_node = node;
+
+ if (node->nd_pconst) {
+ ADD_INSN(ret, line_node, dup); // (1)
+ CHECK(COMPILE(ret, "constant", node->nd_pconst)); // (2)
+ if (in_single_pattern) {
+ ADD_INSN1(ret, line_node, dupn, INT2FIX(2));
+ }
+ ADD_INSN1(ret, line_node, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE)); // (3)
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_eqq_errmsg(iseq, ret, node, base_index + 3 /* (1), (2), (3) */));
+ }
+ ADD_INSNL(ret, line_node, branchunless, match_failed);
+ }
+ return COMPILE_OK;
+}
+
+
+static int
+iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, LABEL *deconstruct, LABEL *deconstructed, LABEL *match_failed, LABEL *type_error, bool in_single_pattern, int base_index, bool use_deconstructed_cache)
{
const NODE *line_node = node;
// NOTE: this optimization allows us to re-use the #deconstruct value
// (or its absence).
- // `deconstructed_pos` contains the distance to the stack relative location
- // where the value is stored.
- if (deconstructed_pos) {
+ if (use_deconstructed_cache) {
// If value is nil then we haven't tried to deconstruct
- ADD_INSN1(ret, line_node, topn, INT2FIX(deconstructed_pos));
+ ADD_INSN1(ret, line_node, topn, INT2FIX(base_index + CASE3_BI_OFFSET_DECONSTRUCTED_CACHE));
ADD_INSNL(ret, line_node, branchnil, deconstruct);
// If false then the value is not deconstructable
- ADD_INSN1(ret, line_node, topn, INT2FIX(deconstructed_pos));
+ ADD_INSN1(ret, line_node, topn, INT2FIX(base_index + CASE3_BI_OFFSET_DECONSTRUCTED_CACHE));
ADD_INSNL(ret, line_node, branchunless, match_failed);
// Drop value, add deconstructed to the stack and jump
- ADD_INSN(ret, line_node, pop);
- ADD_INSN1(ret, line_node, topn, INT2FIX(deconstructed_pos - 1));
+ ADD_INSN(ret, line_node, pop); // (1)
+ ADD_INSN1(ret, line_node, topn, INT2FIX(base_index + CASE3_BI_OFFSET_DECONSTRUCTED_CACHE - 1 /* (1) */));
ADD_INSNL(ret, line_node, jump, deconstructed);
}
else {
@@ -6616,11 +6720,15 @@ iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NO
ADD_LABEL(ret, deconstruct);
ADD_INSN(ret, line_node, dup);
ADD_INSN1(ret, line_node, putobject, ID2SYM(rb_intern("deconstruct")));
- ADD_SEND(ret, line_node, idRespond_to, INT2FIX(1));
+ ADD_SEND(ret, line_node, idRespond_to, INT2FIX(1)); // (2)
// Cache the result of respond_to? (in case it's false is stays there, if true - it's overwritten after #deconstruct)
- if (deconstructed_pos) {
- ADD_INSN1(ret, line_node, setn, INT2FIX(deconstructed_pos + 1));
+ if (use_deconstructed_cache) {
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_DECONSTRUCTED_CACHE + 1 /* (2) */));
+ }
+
+ if (in_single_pattern) {
+ CHECK(iseq_compile_pattern_set_general_errmsg(iseq, ret, node, rb_fstring_lit("%p does not respond to #deconstruct"), base_index + 1 /* (2) */));
}
ADD_INSNL(ret, line_node, branchunless, match_failed);
@@ -6628,14 +6736,13 @@ iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NO
ADD_SEND(ret, line_node, rb_intern("deconstruct"), INT2FIX(0));
// Cache the result (if it's cacheable - currently, only top-level array patterns)
- if (deconstructed_pos) {
- ADD_INSN1(ret, line_node, setn, INT2FIX(deconstructed_pos));
+ if (use_deconstructed_cache) {
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_DECONSTRUCTED_CACHE));
}
ADD_INSN(ret, line_node, dup);
ADD_INSN1(ret, line_node, checktype, INT2FIX(T_ARRAY));
ADD_INSNL(ret, line_node, branchunless, type_error);
- ADD_INSNL(ret, line_node, jump, deconstructed);
ADD_LABEL(ret, deconstructed);
@@ -6643,6 +6750,116 @@ iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NO
}
static int
+iseq_compile_pattern_set_general_errmsg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, VALUE errmsg, int base_index)
+{
+ /*
+ * if match_succeeded?
+ * goto match_succeeded
+ * end
+ * error_string = FrozenCore.sprintf(errmsg, matchee)
+ * key_error_p = false
+ * match_succeeded:
+ */
+ const int line = nd_line(node);
+ const NODE *line_node = node;
+ LABEL *match_succeeded = NEW_LABEL(line);
+
+ ADD_INSN(ret, line_node, dup);
+ ADD_INSNL(ret, line_node, branchif, match_succeeded);
+
+ ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line_node, putobject, errmsg);
+ ADD_INSN1(ret, line_node, topn, INT2FIX(3));
+ ADD_SEND(ret, line_node, id_core_sprintf, INT2FIX(2)); // (1)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_ERROR_STRING + 1 /* (1) */)); // (2)
+
+ ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_P + 2 /* (1), (2) */));
+
+ ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, line_node, pop);
+ ADD_LABEL(ret, match_succeeded);
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_compile_pattern_set_length_errmsg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, VALUE errmsg, VALUE pattern_length, int base_index)
+{
+ /*
+ * if match_succeeded?
+ * goto match_succeeded
+ * end
+ * error_string = FrozenCore.sprintf(errmsg, matchee, matchee.length, pat.length)
+ * key_error_p = false
+ * match_succeeded:
+ */
+ const int line = nd_line(node);
+ const NODE *line_node = node;
+ LABEL *match_succeeded = NEW_LABEL(line);
+
+ ADD_INSN(ret, line_node, dup);
+ ADD_INSNL(ret, line_node, branchif, match_succeeded);
+
+ ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line_node, putobject, errmsg);
+ ADD_INSN1(ret, line_node, topn, INT2FIX(3));
+ ADD_INSN(ret, line_node, dup);
+ ADD_SEND(ret, line_node, idLength, INT2FIX(0));
+ ADD_INSN1(ret, line_node, putobject, pattern_length);
+ ADD_SEND(ret, line_node, id_core_sprintf, INT2FIX(4)); // (1)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_ERROR_STRING + 1 /* (1) */)); // (2)
+
+ ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_P + 2/* (1), (2) */));
+
+ ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, line_node, pop);
+ ADD_LABEL(ret, match_succeeded);
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_compile_pattern_set_eqq_errmsg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int base_index)
+{
+ /*
+ * if match_succeeded?
+ * goto match_succeeded
+ * end
+ * error_string = FrozenCore.sprintf("%p === %p does not return true", pat, matchee)
+ * key_error_p = false
+ * match_succeeded:
+ */
+ const int line = nd_line(node);
+ const NODE *line_node = node;
+ LABEL *match_succeeded = NEW_LABEL(line);
+
+ ADD_INSN(ret, line_node, dup);
+ ADD_INSNL(ret, line_node, branchif, match_succeeded);
+
+ ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line_node, putobject, rb_fstring_lit("%p === %p does not return true"));
+ ADD_INSN1(ret, line_node, topn, INT2FIX(3));
+ ADD_INSN1(ret, line_node, topn, INT2FIX(5));
+ ADD_SEND(ret, line_node, id_core_sprintf, INT2FIX(3)); // (1)
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_ERROR_STRING + 1 /* (1) */)); // (2)
+
+ ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, line_node, setn, INT2FIX(base_index + CASE3_BI_OFFSET_KEY_ERROR_P + 2 /* (1), (2) */));
+
+ ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, line_node, pop);
+
+ ADD_LABEL(ret, match_succeeded);
+ ADD_INSN1(ret, line_node, setn, INT2FIX(2));
+ ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, line_node, pop);
+
+ return COMPILE_OK;
+}
+
+static int
compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_node, int popped)
{
const NODE *pattern;
@@ -6656,6 +6873,7 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
const NODE *line_node;
VALUE branches = 0;
int branch_id = 0;
+ bool single_pattern;
INIT_ANCHOR(head);
INIT_ANCHOR(body_seq);
@@ -6668,10 +6886,18 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
type = nd_type(node);
line = nd_line(node);
line_node = node;
+ single_pattern = !node->nd_next;
endlabel = NEW_LABEL(line);
elselabel = NEW_LABEL(line);
+ if (single_pattern) {
+ /* allocate stack for ... */
+ ADD_INSN(head, line_node, putnil); /* key_error_key */
+ ADD_INSN(head, line_node, putnil); /* key_error_matchee */
+ ADD_INSN1(head, line_node, putobject, Qfalse); /* key_error_p */
+ ADD_INSN(head, line_node, putnil); /* error_string */
+ }
ADD_INSN(head, line_node, putnil); /* allocate stack for cached #deconstruct value */
CHECK(COMPILE(head, "case base", orig_node->nd_head));
@@ -6686,8 +6912,7 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
}
l1 = NEW_LABEL(line);
ADD_LABEL(body_seq, l1);
- ADD_INSN(body_seq, line_node, pop);
- ADD_INSN(body_seq, line_node, pop); /* discard cached #deconstruct value */
+ ADD_INSN1(body_seq, line_node, adjuststack, INT2FIX(single_pattern ? 6 : 2));
add_trace_branch_coverage(
iseq,
body_seq,
@@ -6702,10 +6927,9 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
if (pattern) {
int pat_line = nd_line(pattern);
LABEL *next_pat = NEW_LABEL(pat_line);
- ADD_INSN (cond_seq, pattern, dup);
- // NOTE: set deconstructed_pos to the current cached value location
- // (it's "under" the matchee value, so it's position is 2)
- CHECK(iseq_compile_pattern_each(iseq, cond_seq, pattern, l1, next_pat, FALSE, 2));
+ ADD_INSN (cond_seq, pattern, dup); /* dup case VAL */
+ // NOTE: set base_index (it's "under" the matchee value, so it's position is 2)
+ CHECK(iseq_compile_pattern_each(iseq, cond_seq, pattern, l1, next_pat, single_pattern, false, 2, true));
ADD_LABEL(cond_seq, next_pat);
LABEL_UNREMOVABLE(next_pat);
}
@@ -6740,17 +6964,62 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
ADD_LABEL(cond_seq, elselabel);
add_trace_branch_coverage(iseq, cond_seq, orig_node, branch_id, "else", branches);
ADD_INSN1(cond_seq, orig_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(cond_seq, orig_node, putobject, rb_eNoMatchingPatternError);
- ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(2));
- ADD_SEND(cond_seq, orig_node, id_core_raise, INT2FIX(2));
- ADD_INSN(cond_seq, orig_node, pop);
- ADD_INSN(cond_seq, orig_node, pop);
- ADD_INSN(cond_seq, orig_node, pop); /* discard cached #deconstruct value */
+
+ if (single_pattern) {
+ /*
+ * if key_error_p
+ * FrozenCore.raise NoMatchingPatternKeyError.new(FrozenCore.sprintf("%p: %s", case_val, error_string), matchee: key_error_matchee, key: key_error_key)
+ * else
+ * FrozenCore.raise NoMatchingPatternError, FrozenCore.sprintf("%p: %s", case_val, error_string)
+ * end
+ */
+ LABEL *key_error, *fin;
+ struct rb_callinfo_kwarg *kw_arg;
+
+ key_error = NEW_LABEL(line);
+ fin = NEW_LABEL(line);
+
+ kw_arg = rb_xmalloc_mul_add(2, sizeof(VALUE), sizeof(struct rb_callinfo_kwarg));
+ kw_arg->keyword_len = 2;
+ kw_arg->keywords[0] = ID2SYM(rb_intern("matchee"));
+ kw_arg->keywords[1] = ID2SYM(rb_intern("key"));
+
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(CASE3_BI_OFFSET_KEY_ERROR_P + 2));
+ ADD_INSNL(cond_seq, orig_node, branchif, key_error);
+ ADD_INSN1(cond_seq, orig_node, putobject, rb_eNoMatchingPatternError);
+ ADD_INSN1(cond_seq, orig_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(cond_seq, orig_node, putobject, rb_fstring_lit("%p: %s"));
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(4)); /* case VAL */
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(CASE3_BI_OFFSET_ERROR_STRING + 6));
+ ADD_SEND(cond_seq, orig_node, id_core_sprintf, INT2FIX(3));
+ ADD_SEND(cond_seq, orig_node, id_core_raise, INT2FIX(2));
+ ADD_INSNL(cond_seq, orig_node, jump, fin);
+
+ ADD_LABEL(cond_seq, key_error);
+ ADD_INSN1(cond_seq, orig_node, putobject, rb_eNoMatchingPatternKeyError);
+ ADD_INSN1(cond_seq, orig_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(cond_seq, orig_node, putobject, rb_fstring_lit("%p: %s"));
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(4)); /* case VAL */
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(CASE3_BI_OFFSET_ERROR_STRING + 6));
+ ADD_SEND(cond_seq, orig_node, id_core_sprintf, INT2FIX(3));
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(CASE3_BI_OFFSET_KEY_ERROR_MATCHEE + 4));
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(CASE3_BI_OFFSET_KEY_ERROR_KEY + 5));
+ ADD_SEND_R(cond_seq, orig_node, rb_intern("new"), INT2FIX(1), NULL, INT2FIX(VM_CALL_KWARG), kw_arg);
+ ADD_SEND(cond_seq, orig_node, id_core_raise, INT2FIX(1));
+
+ ADD_LABEL(cond_seq, fin);
+ }
+ else {
+ ADD_INSN1(cond_seq, orig_node, putobject, rb_eNoMatchingPatternError);
+ ADD_INSN1(cond_seq, orig_node, topn, INT2FIX(2));
+ ADD_SEND(cond_seq, orig_node, id_core_raise, INT2FIX(2));
+ }
+ ADD_INSN1(cond_seq, orig_node, adjuststack, INT2FIX(single_pattern ? 7 : 3));
if (!popped) {
ADD_INSN(cond_seq, orig_node, putnil);
}
ADD_INSNL(cond_seq, orig_node, jump, endlabel);
- ADD_INSN(cond_seq, line_node, putnil);
+ ADD_INSN1(cond_seq, orig_node, dupn, INT2FIX(single_pattern ? 5 : 1));
if (popped) {
ADD_INSN(cond_seq, line_node, putnil);
}
@@ -6762,6 +7031,12 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
return COMPILE_OK;
}
+#undef CASE3_BI_OFFSET_DECONSTRUCTED_CACHE
+#undef CASE3_BI_OFFSET_ERROR_STRING
+#undef CASE3_BI_OFFSET_KEY_ERROR_P
+#undef CASE3_BI_OFFSET_KEY_ERROR_MATCHEE
+#undef CASE3_BI_OFFSET_KEY_ERROR_KEY
+
static int
compile_loop(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
{
@@ -7842,8 +8117,842 @@ compile_call(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, co
return COMPILE_OK;
}
+static int
+compile_op_asgn1(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ const int line = nd_line(node);
+ VALUE argc;
+ unsigned int flag = 0;
+ int asgnflag = 0;
+ ID id = node->nd_mid;
+ int boff = 0;
+
+ /*
+ * a[x] (op)= y
+ *
+ * nil # nil
+ * eval a # nil a
+ * eval x # nil a x
+ * dupn 2 # nil a x a x
+ * send :[] # nil a x a[x]
+ * eval y # nil a x a[x] y
+ * send op # nil a x ret
+ * setn 3 # ret a x ret
+ * send []= # ret ?
+ * pop # ret
+ */
+
+ /*
+ * nd_recv[nd_args->nd_body] (nd_mid)= nd_args->nd_head;
+ * NODE_OP_ASGN nd_recv
+ * nd_args->nd_head
+ * nd_args->nd_body
+ * nd_mid
+ */
+
+ if (!popped) {
+ ADD_INSN(ret, node, putnil);
+ }
+ asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN1 recv", node);
+ CHECK(asgnflag != -1);
+ switch (nd_type(node->nd_args->nd_head)) {
+ case NODE_ZLIST:
+ argc = INT2FIX(0);
+ break;
+ case NODE_BLOCK_PASS:
+ boff = 1;
+ /* fall through */
+ default:
+ argc = setup_args(iseq, ret, node->nd_args->nd_head, &flag, NULL);
+ CHECK(!NIL_P(argc));
+ }
+ ADD_INSN1(ret, node, dupn, FIXNUM_INC(argc, 1 + boff));
+ flag |= asgnflag;
+ ADD_SEND_WITH_FLAG(ret, node, idAREF, argc, INT2FIX(flag));
+
+ if (id == idOROP || id == idANDOP) {
+ /* a[x] ||= y or a[x] &&= y
+
+ unless/if a[x]
+ a[x]= y
+ else
+ nil
+ end
+ */
+ LABEL *label = NEW_LABEL(line);
+ LABEL *lfin = NEW_LABEL(line);
+
+ ADD_INSN(ret, node, dup);
+ if (id == idOROP) {
+ ADD_INSNL(ret, node, branchif, label);
+ }
+ else { /* idANDOP */
+ ADD_INSNL(ret, node, branchunless, label);
+ }
+ ADD_INSN(ret, node, pop);
+
+ CHECK(COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body));
+ if (!popped) {
+ ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 2+boff));
+ }
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, node, newarray, INT2FIX(1));
+ if (boff > 0) {
+ ADD_INSN1(ret, node, dupn, INT2FIX(3));
+ ADD_INSN(ret, node, swap);
+ ADD_INSN(ret, node, pop);
+ }
+ ADD_INSN(ret, node, concatarray);
+ if (boff > 0) {
+ ADD_INSN1(ret, node, setn, INT2FIX(3));
+ ADD_INSN(ret, node, pop);
+ ADD_INSN(ret, node, pop);
+ }
+ ADD_SEND_WITH_FLAG(ret, node, idASET, argc, INT2FIX(flag));
+ }
+ else {
+ if (boff > 0)
+ ADD_INSN(ret, node, swap);
+ ADD_SEND_WITH_FLAG(ret, node, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
+ }
+ ADD_INSN(ret, node, pop);
+ ADD_INSNL(ret, node, jump, lfin);
+ ADD_LABEL(ret, label);
+ if (!popped) {
+ ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 2+boff));
+ }
+ ADD_INSN1(ret, node, adjuststack, FIXNUM_INC(argc, 2+boff));
+ ADD_LABEL(ret, lfin);
+ }
+ else {
+ CHECK(COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body));
+ ADD_SEND(ret, node, id, INT2FIX(1));
+ if (!popped) {
+ ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 2+boff));
+ }
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, node, newarray, INT2FIX(1));
+ if (boff > 0) {
+ ADD_INSN1(ret, node, dupn, INT2FIX(3));
+ ADD_INSN(ret, node, swap);
+ ADD_INSN(ret, node, pop);
+ }
+ ADD_INSN(ret, node, concatarray);
+ if (boff > 0) {
+ ADD_INSN1(ret, node, setn, INT2FIX(3));
+ ADD_INSN(ret, node, pop);
+ ADD_INSN(ret, node, pop);
+ }
+ ADD_SEND_WITH_FLAG(ret, node, idASET, argc, INT2FIX(flag));
+ }
+ else {
+ if (boff > 0)
+ ADD_INSN(ret, node, swap);
+ ADD_SEND_WITH_FLAG(ret, node, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
+ }
+ ADD_INSN(ret, node, pop);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_op_asgn2(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ const int line = nd_line(node);
+ ID atype = node->nd_next->nd_mid;
+ ID vid = node->nd_next->nd_vid, aid = rb_id_attrset(vid);
+ int asgnflag;
+ LABEL *lfin = NEW_LABEL(line);
+ LABEL *lcfin = NEW_LABEL(line);
+ LABEL *lskip = 0;
+ /*
+ class C; attr_accessor :c; end
+ r = C.new
+ r.a &&= v # asgn2
+
+ eval r # r
+ dup # r r
+ eval r.a # r o
+
+ # or
+ dup # r o o
+ if lcfin # r o
+ pop # r
+ eval v # r v
+ swap # v r
+ topn 1 # v r v
+ send a= # v ?
+ jump lfin # v ?
+
+ lcfin: # r o
+ swap # o r
+
+ lfin: # o ?
+ pop # o
+
+ # and
+ dup # r o o
+ unless lcfin
+ pop # r
+ eval v # r v
+ swap # v r
+ topn 1 # v r v
+ send a= # v ?
+ jump lfin # v ?
+
+ # others
+ eval v # r o v
+ send ?? # r w
+ send a= # w
+
+ */
+
+ asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
+ CHECK(asgnflag != -1);
+ if (node->nd_next->nd_aid) {
+ lskip = NEW_LABEL(line);
+ ADD_INSN(ret, node, dup);
+ ADD_INSNL(ret, node, branchnil, lskip);
+ }
+ ADD_INSN(ret, node, dup);
+ ADD_SEND_WITH_FLAG(ret, node, vid, INT2FIX(0), INT2FIX(asgnflag));
+
+ if (atype == idOROP || atype == idANDOP) {
+ ADD_INSN(ret, node, dup);
+ if (atype == idOROP) {
+ ADD_INSNL(ret, node, branchif, lcfin);
+ }
+ else { /* idANDOP */
+ ADD_INSNL(ret, node, branchunless, lcfin);
+ }
+ ADD_INSN(ret, node, pop);
+ CHECK(COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value));
+ ADD_INSN(ret, node, swap);
+ ADD_INSN1(ret, node, topn, INT2FIX(1));
+ ADD_SEND_WITH_FLAG(ret, node, aid, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_INSNL(ret, node, jump, lfin);
+
+ ADD_LABEL(ret, lcfin);
+ ADD_INSN(ret, node, swap);
+
+ ADD_LABEL(ret, lfin);
+ ADD_INSN(ret, node, pop);
+ if (lskip) {
+ ADD_LABEL(ret, lskip);
+ }
+ if (popped) {
+ /* we can apply more optimize */
+ ADD_INSN(ret, node, pop);
+ }
+ }
+ else {
+ CHECK(COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value));
+ ADD_SEND(ret, node, atype, INT2FIX(1));
+ if (!popped) {
+ ADD_INSN(ret, node, swap);
+ ADD_INSN1(ret, node, topn, INT2FIX(1));
+ }
+ ADD_SEND_WITH_FLAG(ret, node, aid, INT2FIX(1), INT2FIX(asgnflag));
+ if (lskip && popped) {
+ ADD_LABEL(ret, lskip);
+ }
+ ADD_INSN(ret, node, pop);
+ if (lskip && !popped) {
+ ADD_LABEL(ret, lskip);
+ }
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_op_cdecl(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ const int line = nd_line(node);
+ LABEL *lfin = 0;
+ LABEL *lassign = 0;
+ ID mid;
+
+ switch (nd_type(node->nd_head)) {
+ case NODE_COLON3:
+ ADD_INSN1(ret, node, putobject, rb_cObject);
+ break;
+ case NODE_COLON2:
+ CHECK(COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head));
+ break;
+ default:
+ COMPILE_ERROR(ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
+ ruby_node_name(nd_type(node->nd_head)));
+ return COMPILE_NG;
+ }
+ mid = node->nd_head->nd_mid;
+ /* cref */
+ if (node->nd_aid == idOROP) {
+ lassign = NEW_LABEL(line);
+ ADD_INSN(ret, node, dup); /* cref cref */
+ ADD_INSN3(ret, node, defined, INT2FIX(DEFINED_CONST_FROM),
+ ID2SYM(mid), Qtrue); /* cref bool */
+ ADD_INSNL(ret, node, branchunless, lassign); /* cref */
+ }
+ ADD_INSN(ret, node, dup); /* cref cref */
+ ADD_INSN1(ret, node, putobject, Qtrue);
+ ADD_INSN1(ret, node, getconstant, ID2SYM(mid)); /* cref obj */
+
+ if (node->nd_aid == idOROP || node->nd_aid == idANDOP) {
+ lfin = NEW_LABEL(line);
+ if (!popped) ADD_INSN(ret, node, dup); /* cref [obj] obj */
+ if (node->nd_aid == idOROP)
+ ADD_INSNL(ret, node, branchif, lfin);
+ else /* idANDOP */
+ ADD_INSNL(ret, node, branchunless, lfin);
+ /* cref [obj] */
+ if (!popped) ADD_INSN(ret, node, pop); /* cref */
+ if (lassign) ADD_LABEL(ret, lassign);
+ CHECK(COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value));
+ /* cref value */
+ if (popped)
+ ADD_INSN1(ret, node, topn, INT2FIX(1)); /* cref value cref */
+ else {
+ ADD_INSN1(ret, node, dupn, INT2FIX(2)); /* cref value cref value */
+ ADD_INSN(ret, node, swap); /* cref value value cref */
+ }
+ ADD_INSN1(ret, node, setconstant, ID2SYM(mid)); /* cref [value] */
+ ADD_LABEL(ret, lfin); /* cref [value] */
+ if (!popped) ADD_INSN(ret, node, swap); /* [value] cref */
+ ADD_INSN(ret, node, pop); /* [value] */
+ }
+ else {
+ CHECK(COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value));
+ /* cref obj value */
+ ADD_CALL(ret, node, node->nd_aid, INT2FIX(1));
+ /* cref value */
+ ADD_INSN(ret, node, swap); /* value cref */
+ if (!popped) {
+ ADD_INSN1(ret, node, topn, INT2FIX(1)); /* value cref value */
+ ADD_INSN(ret, node, swap); /* value value cref */
+ }
+ ADD_INSN1(ret, node, setconstant, ID2SYM(mid));
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_op_log(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
+{
+ const int line = nd_line(node);
+ LABEL *lfin = NEW_LABEL(line);
+ LABEL *lassign;
+
+ if (type == NODE_OP_ASGN_OR && nd_type(node->nd_head) != NODE_IVAR) {
+ LABEL *lfinish[2];
+ lfinish[0] = lfin;
+ lfinish[1] = 0;
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
+ lassign = lfinish[1];
+ if (!lassign) {
+ lassign = NEW_LABEL(line);
+ }
+ ADD_INSNL(ret, node, branchunless, lassign);
+ }
+ else {
+ lassign = NEW_LABEL(line);
+ }
+
+ CHECK(COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head));
+ ADD_INSN(ret, node, dup);
+
+ if (type == NODE_OP_ASGN_AND) {
+ ADD_INSNL(ret, node, branchunless, lfin);
+ }
+ else {
+ ADD_INSNL(ret, node, branchif, lfin);
+ }
+
+ ADD_INSN(ret, node, pop);
+ ADD_LABEL(ret, lassign);
+ CHECK(COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value));
+ ADD_LABEL(ret, lfin);
+
+ if (popped) {
+ /* we can apply more optimize */
+ ADD_INSN(ret, node, pop);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_super(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
+{
+ struct rb_iseq_constant_body *const body = iseq->body;
+ DECL_ANCHOR(args);
+ int argc;
+ unsigned int flag = 0;
+ struct rb_callinfo_kwarg *keywords = NULL;
+ const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
+
+ INIT_ANCHOR(args);
+ ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
+ if (type == NODE_SUPER) {
+ VALUE vargc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
+ CHECK(!NIL_P(vargc));
+ argc = FIX2INT(vargc);
+ }
+ else {
+ /* NODE_ZSUPER */
+ int i;
+ const rb_iseq_t *liseq = body->local_iseq;
+ const struct rb_iseq_constant_body *const local_body = liseq->body;
+ const struct rb_iseq_param_keyword *const local_kwd = local_body->param.keyword;
+ int lvar_level = get_lvar_level(iseq);
+
+ argc = local_body->param.lead_num;
+
+ /* normal arguments */
+ for (i = 0; i < local_body->param.lead_num; i++) {
+ int idx = local_body->local_table_size - i;
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ }
+
+ if (local_body->param.flags.has_opt) {
+ /* optional arguments */
+ int j;
+ for (j = 0; j < local_body->param.opt_num; j++) {
+ int idx = local_body->local_table_size - (i + j);
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ }
+ i += j;
+ argc = i;
+ }
+ if (local_body->param.flags.has_rest) {
+ /* rest argument */
+ int idx = local_body->local_table_size - local_body->param.rest_start;
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ ADD_INSN1(args, node, splatarray, Qfalse);
+
+ argc = local_body->param.rest_start + 1;
+ flag |= VM_CALL_ARGS_SPLAT;
+ }
+ if (local_body->param.flags.has_post) {
+ /* post arguments */
+ int post_len = local_body->param.post_num;
+ int post_start = local_body->param.post_start;
+
+ if (local_body->param.flags.has_rest) {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = local_body->local_table_size - (post_start + j);
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ }
+ ADD_INSN1(args, node, newarray, INT2FIX(j));
+ ADD_INSN (args, node, concatarray);
+ /* argc is settled at above */
+ }
+ else {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = local_body->local_table_size - (post_start + j);
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ }
+ argc = post_len + post_start;
+ }
+ }
+
+ if (local_body->param.flags.has_kw) { /* TODO: support keywords */
+ int local_size = local_body->local_table_size;
+ argc++;
+
+ ADD_INSN1(args, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+
+ if (local_body->param.flags.has_kwrest) {
+ int idx = local_body->local_table_size - local_kwd->rest_start;
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ if (local_kwd->num > 0) {
+ ADD_SEND (args, node, rb_intern("dup"), INT2FIX(0));
+ flag |= VM_CALL_KW_SPLAT_MUT;
+ }
+ }
+ else {
+ ADD_INSN1(args, node, newhash, INT2FIX(0));
+ flag |= VM_CALL_KW_SPLAT_MUT;
+ }
+ for (i = 0; i < local_kwd->num; ++i) {
+ ID id = local_kwd->table[i];
+ int idx = local_size - get_local_var_idx(liseq, id);
+ ADD_INSN1(args, node, putobject, ID2SYM(id));
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+ }
+ ADD_SEND(args, node, id_core_hash_merge_ptr, INT2FIX(i * 2 + 1));
+ if (local_body->param.flags.has_rest) {
+ ADD_INSN1(args, node, newarray, INT2FIX(1));
+ ADD_INSN (args, node, concatarray);
+ --argc;
+ }
+ flag |= VM_CALL_KW_SPLAT;
+ }
+ else if (local_body->param.flags.has_kwrest) {
+ int idx = local_body->local_table_size - local_kwd->rest_start;
+ ADD_GETLOCAL(args, node, idx, lvar_level);
+
+ if (local_body->param.flags.has_rest) {
+ ADD_INSN1(args, node, newarray, INT2FIX(1));
+ ADD_INSN (args, node, concatarray);
+ }
+ else {
+ argc++;
+ }
+ flag |= VM_CALL_KW_SPLAT;
+ }
+ }
+
+ flag |= VM_CALL_SUPER | VM_CALL_FCALL;
+ if (type == NODE_ZSUPER) flag |= VM_CALL_ZSUPER;
+ ADD_INSN(ret, node, putself);
+ ADD_SEQ(ret, args);
+ ADD_INSN2(ret, node, invokesuper,
+ new_callinfo(iseq, 0, argc, flag, keywords, parent_block != NULL),
+ parent_block);
+
+ if (popped) {
+ ADD_INSN(ret, node, pop);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_yield(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ DECL_ANCHOR(args);
+ VALUE argc;
+ unsigned int flag = 0;
+ struct rb_callinfo_kwarg *keywords = NULL;
+
+ INIT_ANCHOR(args);
+
+ switch (iseq->body->local_iseq->body->type) {
+ case ISEQ_TYPE_TOP:
+ case ISEQ_TYPE_MAIN:
+ case ISEQ_TYPE_CLASS:
+ COMPILE_ERROR(ERROR_ARGS "Invalid yield");
+ return COMPILE_NG;
+ default: /* valid */;
+ }
+
+ if (node->nd_head) {
+ argc = setup_args(iseq, args, node->nd_head, &flag, &keywords);
+ CHECK(!NIL_P(argc));
+ }
+ else {
+ argc = INT2FIX(0);
+ }
+
+ ADD_SEQ(ret, args);
+ ADD_INSN1(ret, node, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), flag, keywords, FALSE));
+
+ if (popped) {
+ ADD_INSN(ret, node, pop);
+ }
+
+ int level = 0;
+ const rb_iseq_t *tmp_iseq = iseq;
+ for (; tmp_iseq != iseq->body->local_iseq; level++ ) {
+ tmp_iseq = tmp_iseq->body->parent_iseq;
+ }
+ if (level > 0) access_outer_variables(iseq, level, rb_intern("yield"), true);
+
+ return COMPILE_OK;
+}
+
+static int
+compile_match(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
+{
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(val);
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(val);
+ switch ((int)type) {
+ case NODE_MATCH:
+ ADD_INSN1(recv, node, putobject, node->nd_lit);
+ ADD_INSN2(val, node, getspecial, INT2FIX(0),
+ INT2FIX(0));
+ break;
+ case NODE_MATCH2:
+ CHECK(COMPILE(recv, "receiver", node->nd_recv));
+ CHECK(COMPILE(val, "value", node->nd_value));
+ break;
+ case NODE_MATCH3:
+ CHECK(COMPILE(recv, "receiver", node->nd_value));
+ CHECK(COMPILE(val, "value", node->nd_recv));
+ break;
+ }
+
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_SEND(ret, node, idEqTilde, INT2FIX(1));
+
+ if (node->nd_args) {
+ compile_named_capture_assign(iseq, ret, node->nd_args);
+ }
+
+ if (popped) {
+ ADD_INSN(ret, node, pop);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_colon2(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ const int line = nd_line(node);
+ if (rb_is_const_id(node->nd_mid)) {
+ /* constant */
+ LABEL *lend = NEW_LABEL(line);
+ int ic_index = iseq->body->is_size++;
+
+ DECL_ANCHOR(pref);
+ DECL_ANCHOR(body);
+
+ INIT_ANCHOR(pref);
+ INIT_ANCHOR(body);
+ CHECK(compile_const_prefix(iseq, node, pref, body));
+ if (LIST_INSN_SIZE_ZERO(pref)) {
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ ADD_INSN2(ret, node, opt_getinlinecache, lend, INT2FIX(ic_index));
+ }
+ else {
+ ADD_INSN(ret, node, putnil);
+ }
+
+ ADD_SEQ(ret, body);
+
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ ADD_INSN1(ret, node, opt_setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+ }
+ else {
+ ADD_SEQ(ret, pref);
+ ADD_SEQ(ret, body);
+ }
+ }
+ else {
+ /* function call */
+ ADD_CALL_RECEIVER(ret, node);
+ CHECK(COMPILE(ret, "colon2#nd_head", node->nd_head));
+ ADD_CALL(ret, node, node->nd_mid, INT2FIX(1));
+ }
+ if (popped) {
+ ADD_INSN(ret, node, pop);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_colon3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ const int line = nd_line(node);
+ LABEL *lend = NEW_LABEL(line);
+ int ic_index = iseq->body->is_size++;
+
+ debugi("colon3#nd_mid", node->nd_mid);
+
+ /* add cache insn */
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ ADD_INSN2(ret, node, opt_getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, node, pop);
+ }
+
+ ADD_INSN1(ret, node, putobject, rb_cObject);
+ ADD_INSN1(ret, node, putobject, Qtrue);
+ ADD_INSN1(ret, node, getconstant, ID2SYM(node->nd_mid));
+
+ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ ADD_INSN1(ret, node, opt_setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+
+ if (popped) {
+ ADD_INSN(ret, node, pop);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_dots(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const int excl)
+{
+ VALUE flag = INT2FIX(excl);
+ const NODE *b = node->nd_beg;
+ const NODE *e = node->nd_end;
+
+ if (optimizable_range_item_p(b) && optimizable_range_item_p(e)) {
+ if (!popped) {
+ VALUE bv = nd_type(b) == NODE_LIT ? b->nd_lit : Qnil;
+ VALUE ev = nd_type(e) == NODE_LIT ? e->nd_lit : Qnil;
+ VALUE val = rb_range_new(bv, ev, excl);
+ ADD_INSN1(ret, node, putobject, val);
+ RB_OBJ_WRITTEN(iseq, Qundef, val);
+ }
+ }
+ else {
+ CHECK(COMPILE_(ret, "min", b, popped));
+ CHECK(COMPILE_(ret, "max", e, popped));
+ if (!popped) {
+ ADD_INSN1(ret, node, newrange, flag);
+ }
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_errinfo(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ if (!popped) {
+ if (iseq->body->type == ISEQ_TYPE_RESCUE) {
+ ADD_GETLOCAL(ret, node, LVAR_ERRINFO, 0);
+ }
+ else {
+ const rb_iseq_t *ip = iseq;
+ int level = 0;
+ while (ip) {
+ if (ip->body->type == ISEQ_TYPE_RESCUE) {
+ break;
+ }
+ ip = ip->body->parent_iseq;
+ level++;
+ }
+ if (ip) {
+ ADD_GETLOCAL(ret, node, LVAR_ERRINFO, level);
+ }
+ else {
+ ADD_INSN(ret, node, putnil);
+ }
+ }
+ }
+ return COMPILE_OK;
+}
-static int iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped);
+static int
+compile_kw_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ struct rb_iseq_constant_body *const body = iseq->body;
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+ const NODE *default_value = node->nd_body->nd_value;
+
+ if (default_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
+ /* required argument. do nothing */
+ COMPILE_ERROR(ERROR_ARGS "unreachable");
+ return COMPILE_NG;
+ }
+ else if (nd_type(default_value) == NODE_LIT ||
+ nd_type(default_value) == NODE_NIL ||
+ nd_type(default_value) == NODE_TRUE ||
+ nd_type(default_value) == NODE_FALSE) {
+ COMPILE_ERROR(ERROR_ARGS "unreachable");
+ return COMPILE_NG;
+ }
+ else {
+ /* if keywordcheck(_kw_bits, nth_keyword)
+ * kw = default_value
+ * end
+ */
+ int kw_bits_idx = body->local_table_size - body->param.keyword->bits_start;
+ int keyword_idx = body->param.keyword->num;
+
+ ADD_INSN2(ret, node, checkkeyword, INT2FIX(kw_bits_idx + VM_ENV_DATA_SIZE - 1), INT2FIX(keyword_idx));
+ ADD_INSNL(ret, node, branchif, end_label);
+ CHECK(COMPILE_POPPED(ret, "keyword default argument", node->nd_body));
+ ADD_LABEL(ret, end_label);
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_attrasgn(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
+{
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(args);
+ unsigned int flag = 0;
+ ID mid = node->nd_mid;
+ VALUE argc;
+ LABEL *else_label = NULL;
+ VALUE branches = Qfalse;
+
+ /* optimization shortcut
+ * obj["literal"] = value -> opt_aset_with(obj, "literal", value)
+ */
+ if (mid == idASET && !private_recv_p(node) && node->nd_args &&
+ nd_type(node->nd_args) == NODE_LIST && node->nd_args->nd_alen == 2 &&
+ nd_type(node->nd_args->nd_head) == NODE_STR &&
+ ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
+ !ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal &&
+ ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
+ {
+ VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
+ CHECK(COMPILE(ret, "recv", node->nd_recv));
+ CHECK(COMPILE(ret, "value", node->nd_args->nd_next->nd_head));
+ if (!popped) {
+ ADD_INSN(ret, node, swap);
+ ADD_INSN1(ret, node, topn, INT2FIX(1));
+ }
+ ADD_INSN2(ret, node, opt_aset_with, str,
+ new_callinfo(iseq, idASET, 2, 0, NULL, FALSE));
+ RB_OBJ_WRITTEN(iseq, Qundef, str);
+ ADD_INSN(ret, node, pop);
+ return COMPILE_OK;
+ }
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(args);
+ argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
+ CHECK(!NIL_P(argc));
+
+ int asgnflag = COMPILE_RECV(recv, "recv", node);
+ CHECK(asgnflag != -1);
+ flag |= (unsigned int)asgnflag;
+
+ debugp_param("argc", argc);
+ debugp_param("nd_mid", ID2SYM(mid));
+
+ if (!rb_is_attrset_id(mid)) {
+ /* safe nav attr */
+ mid = rb_id_attrset(mid);
+ else_label = qcall_branch_start(iseq, recv, &branches, node, node);
+ }
+ if (!popped) {
+ ADD_INSN(ret, node, putnil);
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+
+ if (flag & VM_CALL_ARGS_BLOCKARG) {
+ ADD_INSN1(ret, node, topn, INT2FIX(1));
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, node, putobject, INT2FIX(-1));
+ ADD_SEND_WITH_FLAG(ret, node, idAREF, INT2FIX(1), INT2FIX(asgnflag));
+ }
+ ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 3));
+ ADD_INSN (ret, node, pop);
+ }
+ else if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN(ret, node, dup);
+ ADD_INSN1(ret, node, putobject, INT2FIX(-1));
+ ADD_SEND_WITH_FLAG(ret, node, idAREF, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 2));
+ ADD_INSN (ret, node, pop);
+ }
+ else {
+ ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 1));
+ }
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+ }
+ ADD_SEND_WITH_FLAG(ret, node, mid, argc, INT2FIX(flag));
+ qcall_branch_end(iseq, ret, else_label, branches, node, node);
+ ADD_INSN(ret, node, pop);
+ return COMPILE_OK;
+}
+
+static int iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped);
/**
compile each node
@@ -7868,23 +8977,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE *node, int poppe
}
static int
-check_yield_place(const rb_iseq_t *iseq)
-{
- switch (iseq->body->local_iseq->body->type) {
- case ISEQ_TYPE_TOP:
- case ISEQ_TYPE_MAIN:
- case ISEQ_TYPE_CLASS:
- return FALSE;
- default:
- return TRUE;
- }
-}
-
-static int
-iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped)
+iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
{
const int line = (int)nd_line(node);
- const NODE *line_node = node;
const enum node_type type = nd_type(node);
struct rb_iseq_constant_body *const body = iseq->body;
@@ -7907,17 +9002,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
#define BEFORE_RETURN debug_node_end()
switch (type) {
- case NODE_BLOCK:{
- while (node && nd_type(node) == NODE_BLOCK) {
- CHECK(COMPILE_(ret, "BLOCK body", node->nd_head,
- (node->nd_next ? 1 : popped)));
- node = node->nd_next;
- }
- if (node) {
- CHECK(COMPILE_(ret, "BLOCK next", node->nd_next, popped));
- }
+ case NODE_BLOCK:
+ CHECK(compile_block(iseq, ret, node, popped));
break;
- }
case NODE_IF:
case NODE_UNLESS:
CHECK(compile_if(iseq, ret, node, popped, type));
@@ -7973,16 +9060,16 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
LABEL *end_label = NEW_LABEL(line);
CHECK(COMPILE(ret, "nd_1st", node->nd_1st));
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
if (type == NODE_AND) {
- ADD_INSNL(ret, line_node, branchunless, end_label);
+ ADD_INSNL(ret, node, branchunless, end_label);
}
else {
- ADD_INSNL(ret, line_node, branchif, end_label);
+ ADD_INSNL(ret, node, branchif, end_label);
}
if (!popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
CHECK(COMPILE_(ret, "nd_2nd", node->nd_2nd, popped));
ADD_LABEL(ret, end_label);
@@ -8002,9 +9089,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
CHECK(COMPILE(ret, "rvalue", node->nd_value));
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
- ADD_SETLOCAL(ret, line_node, idx, get_lvar_level(iseq));
+ ADD_SETLOCAL(ret, node, idx, get_lvar_level(iseq));
break;
}
case NODE_DASGN:
@@ -8015,7 +9102,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
debugi("dassn id", rb_id2str(id) ? id : '*');
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
idx = get_dyna_var_idx(iseq, id, &lv, &ls);
@@ -8025,24 +9112,24 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
rb_id2str(id));
goto ng;
}
- ADD_SETLOCAL(ret, line_node, ls - idx, lv);
+ ADD_SETLOCAL(ret, node, ls - idx, lv);
break;
}
case NODE_GASGN:{
CHECK(COMPILE(ret, "lvalue", node->nd_value));
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
- ADD_INSN1(ret, line_node, setglobal, ID2SYM(node->nd_entry));
+ ADD_INSN1(ret, node, setglobal, ID2SYM(node->nd_entry));
break;
}
case NODE_IASGN:{
CHECK(COMPILE(ret, "lvalue", node->nd_value));
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
- ADD_INSN2(ret, line_node, setinstancevariable,
+ ADD_INSN2(ret, node, setinstancevariable,
ID2SYM(node->nd_vid),
get_ivar_ic_value(iseq,node->nd_vid));
break;
@@ -8051,531 +9138,66 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
CHECK(COMPILE(ret, "lvalue", node->nd_value));
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
if (node->nd_vid) {
- ADD_INSN1(ret, line_node, putspecialobject,
+ ADD_INSN1(ret, node, putspecialobject,
INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
- ADD_INSN1(ret, line_node, setconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, node, setconstant, ID2SYM(node->nd_vid));
}
else {
compile_cpath(ret, iseq, node->nd_else);
- ADD_INSN1(ret, line_node, setconstant, ID2SYM(node->nd_else->nd_mid));
+ ADD_INSN1(ret, node, setconstant, ID2SYM(node->nd_else->nd_mid));
}
break;
}
case NODE_CVASGN:{
CHECK(COMPILE(ret, "cvasgn val", node->nd_value));
if (!popped) {
- ADD_INSN(ret, line_node, dup);
+ ADD_INSN(ret, node, dup);
}
- ADD_INSN2(ret, line_node, setclassvariable,
+ ADD_INSN2(ret, node, setclassvariable,
ID2SYM(node->nd_vid),
get_ivar_ic_value(iseq,node->nd_vid));
break;
}
- case NODE_OP_ASGN1: {
- VALUE argc;
- unsigned int flag = 0;
- int asgnflag = 0;
- ID id = node->nd_mid;
- int boff = 0;
-
- /*
- * a[x] (op)= y
- *
- * nil # nil
- * eval a # nil a
- * eval x # nil a x
- * dupn 2 # nil a x a x
- * send :[] # nil a x a[x]
- * eval y # nil a x a[x] y
- * send op # nil a x ret
- * setn 3 # ret a x ret
- * send []= # ret ?
- * pop # ret
- */
-
- /*
- * nd_recv[nd_args->nd_body] (nd_mid)= nd_args->nd_head;
- * NODE_OP_ASGN nd_recv
- * nd_args->nd_head
- * nd_args->nd_body
- * nd_mid
- */
-
- if (!popped) {
- ADD_INSN(ret, line_node, putnil);
- }
- asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN1 recv", node);
- CHECK(asgnflag != -1);
- switch (nd_type(node->nd_args->nd_head)) {
- case NODE_ZLIST:
- argc = INT2FIX(0);
- break;
- case NODE_BLOCK_PASS:
- boff = 1;
- /* fall through */
- default:
- argc = setup_args(iseq, ret, node->nd_args->nd_head, &flag, NULL);
- CHECK(!NIL_P(argc));
- }
- ADD_INSN1(ret, line_node, dupn, FIXNUM_INC(argc, 1 + boff));
- flag |= asgnflag;
- ADD_SEND_WITH_FLAG(ret, line_node, idAREF, argc, INT2FIX(flag));
-
- if (id == idOROP || id == idANDOP) {
- /* a[x] ||= y or a[x] &&= y
-
- unless/if a[x]
- a[x]= y
- else
- nil
- end
- */
- LABEL *label = NEW_LABEL(line);
- LABEL *lfin = NEW_LABEL(line);
-
- ADD_INSN(ret, line_node, dup);
- if (id == idOROP) {
- ADD_INSNL(ret, line_node, branchif, label);
- }
- else { /* idANDOP */
- ADD_INSNL(ret, line_node, branchunless, label);
- }
- ADD_INSN(ret, line_node, pop);
-
- CHECK(COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body));
- if (!popped) {
- ADD_INSN1(ret, line_node, setn, FIXNUM_INC(argc, 2+boff));
- }
- if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN1(ret, line_node, newarray, INT2FIX(1));
- if (boff > 0) {
- ADD_INSN1(ret, line_node, dupn, INT2FIX(3));
- ADD_INSN(ret, line_node, swap);
- ADD_INSN(ret, line_node, pop);
- }
- ADD_INSN(ret, line_node, concatarray);
- if (boff > 0) {
- ADD_INSN1(ret, line_node, setn, INT2FIX(3));
- ADD_INSN(ret, line_node, pop);
- ADD_INSN(ret, line_node, pop);
- }
- ADD_SEND_WITH_FLAG(ret, line_node, idASET, argc, INT2FIX(flag));
- }
- else {
- if (boff > 0)
- ADD_INSN(ret, line_node, swap);
- ADD_SEND_WITH_FLAG(ret, line_node, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
- }
- ADD_INSN(ret, line_node, pop);
- ADD_INSNL(ret, line_node, jump, lfin);
- ADD_LABEL(ret, label);
- if (!popped) {
- ADD_INSN1(ret, line_node, setn, FIXNUM_INC(argc, 2+boff));
- }
- ADD_INSN1(ret, line_node, adjuststack, FIXNUM_INC(argc, 2+boff));
- ADD_LABEL(ret, lfin);
- }
- else {
- CHECK(COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body));
- ADD_SEND(ret, line_node, id, INT2FIX(1));
- if (!popped) {
- ADD_INSN1(ret, line_node, setn, FIXNUM_INC(argc, 2+boff));
- }
- if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN1(ret, line_node, newarray, INT2FIX(1));
- if (boff > 0) {
- ADD_INSN1(ret, line_node, dupn, INT2FIX(3));
- ADD_INSN(ret, line_node, swap);
- ADD_INSN(ret, line_node, pop);
- }
- ADD_INSN(ret, line_node, concatarray);
- if (boff > 0) {
- ADD_INSN1(ret, line_node, setn, INT2FIX(3));
- ADD_INSN(ret, line_node, pop);
- ADD_INSN(ret, line_node, pop);
- }
- ADD_SEND_WITH_FLAG(ret, line_node, idASET, argc, INT2FIX(flag));
- }
- else {
- if (boff > 0)
- ADD_INSN(ret, line_node, swap);
- ADD_SEND_WITH_FLAG(ret, line_node, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
- }
- ADD_INSN(ret, line_node, pop);
- }
-
+ case NODE_OP_ASGN1:
+ CHECK(compile_op_asgn1(iseq, ret, node, popped));
break;
- }
- case NODE_OP_ASGN2:{
- ID atype = node->nd_next->nd_mid;
- ID vid = node->nd_next->nd_vid, aid = rb_id_attrset(vid);
- int asgnflag;
- LABEL *lfin = NEW_LABEL(line);
- LABEL *lcfin = NEW_LABEL(line);
- LABEL *lskip = 0;
- /*
- class C; attr_accessor :c; end
- r = C.new
- r.a &&= v # asgn2
-
- eval r # r
- dup # r r
- eval r.a # r o
-
- # or
- dup # r o o
- if lcfin # r o
- pop # r
- eval v # r v
- swap # v r
- topn 1 # v r v
- send a= # v ?
- jump lfin # v ?
-
- lcfin: # r o
- swap # o r
-
- lfin: # o ?
- pop # o
-
- # and
- dup # r o o
- unless lcfin
- pop # r
- eval v # r v
- swap # v r
- topn 1 # v r v
- send a= # v ?
- jump lfin # v ?
-
- # others
- eval v # r o v
- send ?? # r w
- send a= # w
-
- */
-
- asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
- CHECK(asgnflag != -1);
- if (node->nd_next->nd_aid) {
- lskip = NEW_LABEL(line);
- ADD_INSN(ret, line_node, dup);
- ADD_INSNL(ret, line_node, branchnil, lskip);
- }
- ADD_INSN(ret, line_node, dup);
- ADD_SEND_WITH_FLAG(ret, line_node, vid, INT2FIX(0), INT2FIX(asgnflag));
-
- if (atype == idOROP || atype == idANDOP) {
- ADD_INSN(ret, line_node, dup);
- if (atype == idOROP) {
- ADD_INSNL(ret, line_node, branchif, lcfin);
- }
- else { /* idANDOP */
- ADD_INSNL(ret, line_node, branchunless, lcfin);
- }
- ADD_INSN(ret, line_node, pop);
- CHECK(COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value));
- ADD_INSN(ret, line_node, swap);
- ADD_INSN1(ret, line_node, topn, INT2FIX(1));
- ADD_SEND_WITH_FLAG(ret, line_node, aid, INT2FIX(1), INT2FIX(asgnflag));
- ADD_INSNL(ret, line_node, jump, lfin);
-
- ADD_LABEL(ret, lcfin);
- ADD_INSN(ret, line_node, swap);
-
- ADD_LABEL(ret, lfin);
- ADD_INSN(ret, line_node, pop);
- if (lskip) {
- ADD_LABEL(ret, lskip);
- }
- if (popped) {
- /* we can apply more optimize */
- ADD_INSN(ret, line_node, pop);
- }
- }
- else {
- CHECK(COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value));
- ADD_SEND(ret, line_node, atype, INT2FIX(1));
- if (!popped) {
- ADD_INSN(ret, line_node, swap);
- ADD_INSN1(ret, line_node, topn, INT2FIX(1));
- }
- ADD_SEND_WITH_FLAG(ret, line_node, aid, INT2FIX(1), INT2FIX(asgnflag));
- if (lskip && popped) {
- ADD_LABEL(ret, lskip);
- }
- ADD_INSN(ret, line_node, pop);
- if (lskip && !popped) {
- ADD_LABEL(ret, lskip);
- }
- }
+ case NODE_OP_ASGN2:
+ CHECK(compile_op_asgn2(iseq, ret, node, popped));
break;
- }
- case NODE_OP_CDECL: {
- LABEL *lfin = 0;
- LABEL *lassign = 0;
- ID mid;
-
- switch (nd_type(node->nd_head)) {
- case NODE_COLON3:
- ADD_INSN1(ret, line_node, putobject, rb_cObject);
- break;
- case NODE_COLON2:
- CHECK(COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head));
- break;
- default:
- COMPILE_ERROR(ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
- ruby_node_name(nd_type(node->nd_head)));
- goto ng;
- }
- mid = node->nd_head->nd_mid;
- /* cref */
- if (node->nd_aid == idOROP) {
- lassign = NEW_LABEL(line);
- ADD_INSN(ret, line_node, dup); /* cref cref */
- ADD_INSN3(ret, line_node, defined, INT2FIX(DEFINED_CONST_FROM),
- ID2SYM(mid), Qtrue); /* cref bool */
- ADD_INSNL(ret, line_node, branchunless, lassign); /* cref */
- }
- ADD_INSN(ret, line_node, dup); /* cref cref */
- ADD_INSN1(ret, line_node, putobject, Qtrue);
- ADD_INSN1(ret, line_node, getconstant, ID2SYM(mid)); /* cref obj */
-
- if (node->nd_aid == idOROP || node->nd_aid == idANDOP) {
- lfin = NEW_LABEL(line);
- if (!popped) ADD_INSN(ret, line_node, dup); /* cref [obj] obj */
- if (node->nd_aid == idOROP)
- ADD_INSNL(ret, line_node, branchif, lfin);
- else /* idANDOP */
- ADD_INSNL(ret, line_node, branchunless, lfin);
- /* cref [obj] */
- if (!popped) ADD_INSN(ret, line_node, pop); /* cref */
- if (lassign) ADD_LABEL(ret, lassign);
- CHECK(COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value));
- /* cref value */
- if (popped)
- ADD_INSN1(ret, line_node, topn, INT2FIX(1)); /* cref value cref */
- else {
- ADD_INSN1(ret, line_node, dupn, INT2FIX(2)); /* cref value cref value */
- ADD_INSN(ret, line_node, swap); /* cref value value cref */
- }
- ADD_INSN1(ret, line_node, setconstant, ID2SYM(mid)); /* cref [value] */
- ADD_LABEL(ret, lfin); /* cref [value] */
- if (!popped) ADD_INSN(ret, line_node, swap); /* [value] cref */
- ADD_INSN(ret, line_node, pop); /* [value] */
- }
- else {
- CHECK(COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value));
- /* cref obj value */
- ADD_CALL(ret, line_node, node->nd_aid, INT2FIX(1));
- /* cref value */
- ADD_INSN(ret, line_node, swap); /* value cref */
- if (!popped) {
- ADD_INSN1(ret, line_node, topn, INT2FIX(1)); /* value cref value */
- ADD_INSN(ret, line_node, swap); /* value value cref */
- }
- ADD_INSN1(ret, line_node, setconstant, ID2SYM(mid));
- }
+ case NODE_OP_CDECL:
+ CHECK(compile_op_cdecl(iseq, ret, node, popped));
break;
- }
case NODE_OP_ASGN_AND:
- case NODE_OP_ASGN_OR:{
- LABEL *lfin = NEW_LABEL(line);
- LABEL *lassign;
-
- if (nd_type(node) == NODE_OP_ASGN_OR && nd_type(node->nd_head) != NODE_IVAR) {
- LABEL *lfinish[2];
- lfinish[0] = lfin;
- lfinish[1] = 0;
- defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
- lassign = lfinish[1];
- if (!lassign) {
- lassign = NEW_LABEL(line);
- }
- ADD_INSNL(ret, line_node, branchunless, lassign);
- }
- else {
- lassign = NEW_LABEL(line);
- }
-
- CHECK(COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head));
- ADD_INSN(ret, line_node, dup);
-
- if (nd_type(node) == NODE_OP_ASGN_AND) {
- ADD_INSNL(ret, line_node, branchunless, lfin);
- }
- else {
- ADD_INSNL(ret, line_node, branchif, lfin);
- }
-
- ADD_INSN(ret, line_node, pop);
- ADD_LABEL(ret, lassign);
- CHECK(COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value));
- ADD_LABEL(ret, lfin);
-
- if (popped) {
- /* we can apply more optimize */
- ADD_INSN(ret, line_node, pop);
- }
+ case NODE_OP_ASGN_OR:
+ CHECK(compile_op_log(iseq, ret, node, popped, type));
break;
- }
case NODE_CALL: /* obj.foo */
case NODE_OPCALL: /* foo[] */
- if (compile_call_precheck_freeze(iseq, ret, node, line_node, popped) == TRUE) {
+ if (compile_call_precheck_freeze(iseq, ret, node, node, popped) == TRUE) {
break;
}
case NODE_QCALL: /* obj&.foo */
case NODE_FCALL: /* foo() */
case NODE_VCALL: /* foo (variable or call) */
- if (compile_call(iseq, ret, node, type, line_node, popped, false) == COMPILE_NG) {
+ if (compile_call(iseq, ret, node, type, node, popped, false) == COMPILE_NG) {
goto ng;
}
break;
case NODE_SUPER:
- case NODE_ZSUPER:{
- DECL_ANCHOR(args);
- int argc;
- unsigned int flag = 0;
- struct rb_callinfo_kwarg *keywords = NULL;
- const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
-
- INIT_ANCHOR(args);
- ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
- if (type == NODE_SUPER) {
- VALUE vargc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
- CHECK(!NIL_P(vargc));
- argc = FIX2INT(vargc);
- }
- else {
- /* NODE_ZSUPER */
- int i;
- const rb_iseq_t *liseq = body->local_iseq;
- const struct rb_iseq_constant_body *const local_body = liseq->body;
- const struct rb_iseq_param_keyword *const local_kwd = local_body->param.keyword;
- int lvar_level = get_lvar_level(iseq);
-
- argc = local_body->param.lead_num;
-
- /* normal arguments */
- for (i = 0; i < local_body->param.lead_num; i++) {
- int idx = local_body->local_table_size - i;
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- }
-
- if (local_body->param.flags.has_opt) {
- /* optional arguments */
- int j;
- for (j = 0; j < local_body->param.opt_num; j++) {
- int idx = local_body->local_table_size - (i + j);
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- }
- i += j;
- argc = i;
- }
- if (local_body->param.flags.has_rest) {
- /* rest argument */
- int idx = local_body->local_table_size - local_body->param.rest_start;
-
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- ADD_INSN1(args, line_node, splatarray, Qfalse);
-
- argc = local_body->param.rest_start + 1;
- flag |= VM_CALL_ARGS_SPLAT;
- }
- if (local_body->param.flags.has_post) {
- /* post arguments */
- int post_len = local_body->param.post_num;
- int post_start = local_body->param.post_start;
-
- if (local_body->param.flags.has_rest) {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = local_body->local_table_size - (post_start + j);
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- }
- ADD_INSN1(args, line_node, newarray, INT2FIX(j));
- ADD_INSN (args, line_node, concatarray);
- /* argc is settled at above */
- }
- else {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = local_body->local_table_size - (post_start + j);
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- }
- argc = post_len + post_start;
- }
- }
-
- if (local_body->param.flags.has_kw) { /* TODO: support keywords */
- int local_size = local_body->local_table_size;
- argc++;
-
- ADD_INSN1(args, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
-
- if (local_body->param.flags.has_kwrest) {
- int idx = local_body->local_table_size - local_kwd->rest_start;
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- if (local_kwd->num > 0) {
- ADD_SEND(args, line_node, rb_intern("dup"), INT2FIX(0));
- flag |= VM_CALL_KW_SPLAT_MUT;
- }
- }
- else {
- ADD_INSN1(args, line_node, newhash, INT2FIX(0));
- flag |= VM_CALL_KW_SPLAT_MUT;
- }
- for (i = 0; i < local_kwd->num; ++i) {
- ID id = local_kwd->table[i];
- int idx = local_size - get_local_var_idx(liseq, id);
- ADD_INSN1(args, line_node, putobject, ID2SYM(id));
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
- }
- ADD_SEND(args, line_node, id_core_hash_merge_ptr, INT2FIX(i * 2 + 1));
- if (local_body->param.flags.has_rest) {
- ADD_INSN1(args, line_node, newarray, INT2FIX(1));
- ADD_INSN (args, line_node, concatarray);
- --argc;
- }
- flag |= VM_CALL_KW_SPLAT;
- }
- else if (local_body->param.flags.has_kwrest) {
- int idx = local_body->local_table_size - local_kwd->rest_start;
- ADD_GETLOCAL(args, line_node, idx, lvar_level);
-
- if (local_body->param.flags.has_rest) {
- ADD_INSN1(args, line_node, newarray, INT2FIX(1));
- ADD_INSN (args, line_node, concatarray);
- }
- else {
- argc++;
- }
- flag |= VM_CALL_KW_SPLAT;
- }
- }
-
- ADD_INSN(ret, line_node, putself);
- ADD_SEQ(ret, args);
- ADD_INSN2(ret, line_node, invokesuper,
- new_callinfo(iseq, 0, argc, flag | VM_CALL_SUPER | (type == NODE_ZSUPER ? VM_CALL_ZSUPER : 0) | VM_CALL_FCALL, keywords, parent_block != NULL),
- parent_block);
-
- if (popped) {
- ADD_INSN(ret, line_node, pop);
- }
+ case NODE_ZSUPER:
+ CHECK(compile_super(iseq, ret, node, popped, type));
break;
- }
case NODE_LIST:{
CHECK(compile_array(iseq, ret, node, popped) >= 0);
break;
}
case NODE_ZLIST:{
if (!popped) {
- ADD_INSN1(ret, line_node, newarray, INT2FIX(0));
+ ADD_INSN1(ret, node, newarray, INT2FIX(0));
}
break;
}
@@ -8588,7 +9210,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
CHECK(COMPILE(ret, "values item", n->nd_head));
n = n->nd_next;
}
- ADD_INSN1(ret, line_node, newarray, INT2FIX(node->nd_alen));
+ ADD_INSN1(ret, node, newarray, INT2FIX(node->nd_alen));
break;
}
case NODE_HASH:
@@ -8597,45 +9219,12 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
case NODE_RETURN:
CHECK(compile_return(iseq, ret, node, popped));
break;
- case NODE_YIELD:{
- DECL_ANCHOR(args);
- VALUE argc;
- unsigned int flag = 0;
- struct rb_callinfo_kwarg *keywords = NULL;
-
- INIT_ANCHOR(args);
-
- if (check_yield_place(iseq) == FALSE) {
- COMPILE_ERROR(ERROR_ARGS "Invalid yield");
- goto ng;
- }
-
- if (node->nd_head) {
- argc = setup_args(iseq, args, node->nd_head, &flag, &keywords);
- CHECK(!NIL_P(argc));
- }
- else {
- argc = INT2FIX(0);
- }
-
- ADD_SEQ(ret, args);
- ADD_INSN1(ret, line_node, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), flag, keywords, FALSE));
-
- if (popped) {
- ADD_INSN(ret, line_node, pop);
- }
-
- int level = 0;
- const rb_iseq_t *tmp_iseq = iseq;
- for (; tmp_iseq != iseq->body->local_iseq; level++ ) {
- tmp_iseq = tmp_iseq->body->parent_iseq;
- }
- if (level > 0) access_outer_variables(iseq, level, rb_intern("yield"), true);
+ case NODE_YIELD:
+ CHECK(compile_yield(iseq, ret, node, popped));
break;
- }
case NODE_LVAR:{
if (!popped) {
- compile_lvar(iseq, ret, line_node, node->nd_vid);
+ compile_lvar(iseq, ret, node, node->nd_vid);
}
break;
}
@@ -8649,21 +9238,21 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
rb_id2str(node->nd_vid));
goto ng;
}
- ADD_GETLOCAL(ret, line_node, ls - idx, lv);
+ ADD_GETLOCAL(ret, node, ls - idx, lv);
}
break;
}
case NODE_GVAR:{
- ADD_INSN1(ret, line_node, getglobal, ID2SYM(node->nd_entry));
+ ADD_INSN1(ret, node, getglobal, ID2SYM(node->nd_entry));
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_IVAR:{
debugi("nd_vid", node->nd_vid);
if (!popped) {
- ADD_INSN2(ret, line_node, getinstancevariable,
+ ADD_INSN2(ret, node, getinstancevariable,
ID2SYM(node->nd_vid),
get_ivar_ic_value(iseq,node->nd_vid));
}
@@ -8676,26 +9265,26 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
LABEL *lend = NEW_LABEL(line);
int ic_index = body->is_size++;
- ADD_INSN2(ret, line_node, opt_getinlinecache, lend, INT2FIX(ic_index));
- ADD_INSN1(ret, line_node, putobject, Qtrue);
- ADD_INSN1(ret, line_node, getconstant, ID2SYM(node->nd_vid));
- ADD_INSN1(ret, line_node, opt_setinlinecache, INT2FIX(ic_index));
+ ADD_INSN2(ret, node, opt_getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN1(ret, node, putobject, Qtrue);
+ ADD_INSN1(ret, node, getconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, node, opt_setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
else {
- ADD_INSN(ret, line_node, putnil);
- ADD_INSN1(ret, line_node, putobject, Qtrue);
- ADD_INSN1(ret, line_node, getconstant, ID2SYM(node->nd_vid));
+ ADD_INSN(ret, node, putnil);
+ ADD_INSN1(ret, node, putobject, Qtrue);
+ ADD_INSN1(ret, node, getconstant, ID2SYM(node->nd_vid));
}
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_CVAR:{
if (!popped) {
- ADD_INSN2(ret, line_node, getclassvariable,
+ ADD_INSN2(ret, node, getclassvariable,
ID2SYM(node->nd_vid),
get_ivar_ic_value(iseq,node->nd_vid));
}
@@ -8704,62 +9293,30 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
case NODE_NTH_REF:{
if (!popped) {
if (!node->nd_nth) {
- ADD_INSN(ret, line_node, putnil);
+ ADD_INSN(ret, node, putnil);
break;
}
- ADD_INSN2(ret, line_node, getspecial, INT2FIX(1) /* '~' */,
+ ADD_INSN2(ret, node, getspecial, INT2FIX(1) /* '~' */,
INT2FIX(node->nd_nth << 1));
}
break;
}
case NODE_BACK_REF:{
if (!popped) {
- ADD_INSN2(ret, line_node, getspecial, INT2FIX(1) /* '~' */,
+ ADD_INSN2(ret, node, getspecial, INT2FIX(1) /* '~' */,
INT2FIX(0x01 | (node->nd_nth << 1)));
}
break;
}
case NODE_MATCH:
case NODE_MATCH2:
- case NODE_MATCH3:{
- DECL_ANCHOR(recv);
- DECL_ANCHOR(val);
-
- INIT_ANCHOR(recv);
- INIT_ANCHOR(val);
- switch (nd_type(node)) {
- case NODE_MATCH:
- ADD_INSN1(recv, line_node, putobject, node->nd_lit);
- ADD_INSN2(val, line_node, getspecial, INT2FIX(0),
- INT2FIX(0));
- break;
- case NODE_MATCH2:
- CHECK(COMPILE(recv, "receiver", node->nd_recv));
- CHECK(COMPILE(val, "value", node->nd_value));
- break;
- case NODE_MATCH3:
- CHECK(COMPILE(recv, "receiver", node->nd_value));
- CHECK(COMPILE(val, "value", node->nd_recv));
- break;
- }
-
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, val);
- ADD_SEND(ret, line_node, idEqTilde, INT2FIX(1));
-
- if (node->nd_args) {
- compile_named_capture_assign(iseq, ret, node->nd_args);
- }
-
- if (popped) {
- ADD_INSN(ret, line_node, pop);
- }
+ case NODE_MATCH3:
+ CHECK(compile_match(iseq, ret, node, popped, type));
break;
- }
case NODE_LIT:{
debugp_param("lit", node->nd_lit);
if (!popped) {
- ADD_INSN1(ret, line_node, putobject, node->nd_lit);
+ ADD_INSN1(ret, node, putobject, node->nd_lit);
RB_OBJ_WRITTEN(iseq, Qundef, node->nd_lit);
}
break;
@@ -8770,7 +9327,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
VALUE lit = node->nd_lit;
if (!ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal) {
lit = rb_fstring(lit);
- ADD_INSN1(ret, line_node, putstring, lit);
+ ADD_INSN1(ret, node, putstring, lit);
RB_OBJ_WRITTEN(iseq, Qundef, lit);
}
else {
@@ -8783,7 +9340,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
else {
lit = rb_fstring(lit);
}
- ADD_INSN1(ret, line_node, putobject, lit);
+ ADD_INSN1(ret, node, putobject, lit);
RB_OBJ_WRITTEN(iseq, Qundef, lit);
}
}
@@ -8793,29 +9350,29 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
compile_dstr(iseq, ret, node);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_XSTR:{
- ADD_CALL_RECEIVER(ret, line_node);
+ ADD_CALL_RECEIVER(ret, node);
VALUE str = rb_fstring(node->nd_lit);
- ADD_INSN1(ret, line_node, putobject, str);
+ ADD_INSN1(ret, node, putobject, str);
RB_OBJ_WRITTEN(iseq, Qundef, str);
- ADD_CALL(ret, line_node, idBackquote, INT2FIX(1));
+ ADD_CALL(ret, node, idBackquote, INT2FIX(1));
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_DXSTR:{
- ADD_CALL_RECEIVER(ret, line_node);
+ ADD_CALL_RECEIVER(ret, node);
compile_dstr(iseq, ret, node);
- ADD_CALL(ret, line_node, idBackquote, INT2FIX(1));
+ ADD_CALL(ret, node, idBackquote, INT2FIX(1));
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -8826,7 +9383,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
compile_dregx(iseq, ret, node);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -8835,51 +9392,51 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
const rb_iseq_t *block_iseq;
block_iseq = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_PLAIN, line);
- ADD_INSN2(ret, line_node, once, block_iseq, INT2FIX(ic_index));
+ ADD_INSN2(ret, node, once, block_iseq, INT2FIX(ic_index));
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)block_iseq);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_ARGSCAT:{
if (popped) {
CHECK(COMPILE(ret, "argscat head", node->nd_head));
- ADD_INSN1(ret, line_node, splatarray, Qfalse);
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN1(ret, node, splatarray, Qfalse);
+ ADD_INSN(ret, node, pop);
CHECK(COMPILE(ret, "argscat body", node->nd_body));
- ADD_INSN1(ret, line_node, splatarray, Qfalse);
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN1(ret, node, splatarray, Qfalse);
+ ADD_INSN(ret, node, pop);
}
else {
CHECK(COMPILE(ret, "argscat head", node->nd_head));
CHECK(COMPILE(ret, "argscat body", node->nd_body));
- ADD_INSN(ret, line_node, concatarray);
+ ADD_INSN(ret, node, concatarray);
}
break;
}
case NODE_ARGSPUSH:{
if (popped) {
CHECK(COMPILE(ret, "arsgpush head", node->nd_head));
- ADD_INSN1(ret, line_node, splatarray, Qfalse);
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN1(ret, node, splatarray, Qfalse);
+ ADD_INSN(ret, node, pop);
CHECK(COMPILE_(ret, "argspush body", node->nd_body, popped));
}
else {
CHECK(COMPILE(ret, "arsgpush head", node->nd_head));
CHECK(COMPILE_(ret, "argspush body", node->nd_body, popped));
- ADD_INSN1(ret, line_node, newarray, INT2FIX(1));
- ADD_INSN(ret, line_node, concatarray);
+ ADD_INSN1(ret, node, newarray, INT2FIX(1));
+ ADD_INSN(ret, node, concatarray);
}
break;
}
case NODE_SPLAT:{
CHECK(COMPILE(ret, "splat", node->nd_head));
- ADD_INSN1(ret, line_node, splatarray, Qtrue);
+ ADD_INSN1(ret, node, splatarray, Qtrue);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -8890,11 +9447,11 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ISEQ_TYPE_METHOD, line);
debugp_param("defn/iseq", rb_iseqw_new(method_iseq));
- ADD_INSN2(ret, line_node, definemethod, ID2SYM(mid), method_iseq);
+ ADD_INSN2(ret, node, definemethod, ID2SYM(mid), method_iseq);
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)method_iseq);
if (!popped) {
- ADD_INSN1(ret, line_node, putobject, ID2SYM(mid));
+ ADD_INSN1(ret, node, putobject, ID2SYM(mid));
}
break;
@@ -8907,45 +9464,45 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
debugp_param("defs/iseq", rb_iseqw_new(singleton_method_iseq));
CHECK(COMPILE(ret, "defs: recv", node->nd_recv));
- ADD_INSN2(ret, line_node, definesmethod, ID2SYM(mid), singleton_method_iseq);
+ ADD_INSN2(ret, node, definesmethod, ID2SYM(mid), singleton_method_iseq);
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)singleton_method_iseq);
if (!popped) {
- ADD_INSN1(ret, line_node, putobject, ID2SYM(mid));
+ ADD_INSN1(ret, node, putobject, ID2SYM(mid));
}
break;
}
case NODE_ALIAS:{
- ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
CHECK(COMPILE(ret, "alias arg1", node->nd_1st));
CHECK(COMPILE(ret, "alias arg2", node->nd_2nd));
- ADD_SEND(ret, line_node, id_core_set_method_alias, INT2FIX(3));
+ ADD_SEND(ret, node, id_core_set_method_alias, INT2FIX(3));
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_VALIAS:{
- ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line_node, putobject, ID2SYM(node->nd_alias));
- ADD_INSN1(ret, line_node, putobject, ID2SYM(node->nd_orig));
- ADD_SEND(ret, line_node, id_core_set_variable_alias, INT2FIX(2));
+ ADD_INSN1(ret, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, node, putobject, ID2SYM(node->nd_alias));
+ ADD_INSN1(ret, node, putobject, ID2SYM(node->nd_orig));
+ ADD_SEND(ret, node, id_core_set_variable_alias, INT2FIX(2));
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_UNDEF:{
- ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
CHECK(COMPILE(ret, "undef arg", node->nd_undef));
- ADD_SEND(ret, line_node, id_core_undef_method, INT2FIX(2));
+ ADD_SEND(ret, node, id_core_undef_method, INT2FIX(2));
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -8958,11 +9515,11 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
compile_cpath(ret, iseq, node->nd_cpath);
CHECK(COMPILE(ret, "super", node->nd_super));
- ADD_INSN3(ret, line_node, defineclass, ID2SYM(node->nd_cpath->nd_mid), class_iseq, INT2FIX(flags));
+ ADD_INSN3(ret, node, defineclass, ID2SYM(node->nd_cpath->nd_mid), class_iseq, INT2FIX(flags));
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)class_iseq);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -8973,12 +9530,12 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
const int flags = VM_DEFINECLASS_TYPE_MODULE |
compile_cpath(ret, iseq, node->nd_cpath);
- ADD_INSN (ret, line_node, putnil); /* dummy */
- ADD_INSN3(ret, line_node, defineclass, ID2SYM(node->nd_cpath->nd_mid), module_iseq, INT2FIX(flags));
+ ADD_INSN (ret, node, putnil); /* dummy */
+ ADD_INSN3(ret, node, defineclass, ID2SYM(node->nd_cpath->nd_mid), module_iseq, INT2FIX(flags));
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)module_iseq);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -8988,112 +9545,30 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ISEQ_TYPE_CLASS, line);
CHECK(COMPILE(ret, "sclass#recv", node->nd_recv));
- ADD_INSN (ret, line_node, putnil);
+ ADD_INSN (ret, node, putnil);
CONST_ID(singletonclass, "singletonclass");
- ADD_INSN3(ret, line_node, defineclass,
+ ADD_INSN3(ret, node, defineclass,
ID2SYM(singletonclass), singleton_class,
INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS));
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)singleton_class);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
- case NODE_COLON2:{
- if (rb_is_const_id(node->nd_mid)) {
- /* constant */
- LABEL *lend = NEW_LABEL(line);
- int ic_index = body->is_size++;
-
- DECL_ANCHOR(pref);
- DECL_ANCHOR(body);
-
- INIT_ANCHOR(pref);
- INIT_ANCHOR(body);
- CHECK(compile_const_prefix(iseq, node, pref, body));
- if (LIST_INSN_SIZE_ZERO(pref)) {
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN2(ret, line_node, opt_getinlinecache, lend, INT2FIX(ic_index));
- }
- else {
- ADD_INSN(ret, line_node, putnil);
- }
-
- ADD_SEQ(ret, body);
-
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN1(ret, line_node, opt_setinlinecache, INT2FIX(ic_index));
- ADD_LABEL(ret, lend);
- }
- }
- else {
- ADD_SEQ(ret, pref);
- ADD_SEQ(ret, body);
- }
- }
- else {
- /* function call */
- ADD_CALL_RECEIVER(ret, line_node);
- CHECK(COMPILE(ret, "colon2#nd_head", node->nd_head));
- ADD_CALL(ret, line_node, node->nd_mid, INT2FIX(1));
- }
- if (popped) {
- ADD_INSN(ret, line_node, pop);
- }
+ case NODE_COLON2:
+ CHECK(compile_colon2(iseq, ret, node, popped));
break;
- }
- case NODE_COLON3:{
- LABEL *lend = NEW_LABEL(line);
- int ic_index = body->is_size++;
-
- debugi("colon3#nd_mid", node->nd_mid);
-
- /* add cache insn */
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN2(ret, line_node, opt_getinlinecache, lend, INT2FIX(ic_index));
- ADD_INSN(ret, line_node, pop);
- }
-
- ADD_INSN1(ret, line_node, putobject, rb_cObject);
- ADD_INSN1(ret, line_node, putobject, Qtrue);
- ADD_INSN1(ret, line_node, getconstant, ID2SYM(node->nd_mid));
-
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN1(ret, line_node, opt_setinlinecache, INT2FIX(ic_index));
- ADD_LABEL(ret, lend);
- }
-
- if (popped) {
- ADD_INSN(ret, line_node, pop);
- }
+ case NODE_COLON3:
+ CHECK(compile_colon3(iseq, ret, node, popped));
break;
- }
case NODE_DOT2:
- case NODE_DOT3:{
- int excl = type == NODE_DOT3;
- VALUE flag = INT2FIX(excl);
- const NODE *b = node->nd_beg;
- const NODE *e = node->nd_end;
-
- if (optimizable_range_item_p(b) && optimizable_range_item_p(e)) {
- if (!popped) {
- VALUE bv = nd_type(b) == NODE_LIT ? b->nd_lit : Qnil;
- VALUE ev = nd_type(e) == NODE_LIT ? e->nd_lit : Qnil;
- VALUE val = rb_range_new(bv, ev, excl);
- ADD_INSN1(ret, line_node, putobject, val);
- RB_OBJ_WRITTEN(iseq, Qundef, val);
- }
- }
- else {
- CHECK(COMPILE_(ret, "min", b, popped));
- CHECK(COMPILE_(ret, "max", e, popped));
- if (!popped) {
- ADD_INSN1(ret, line_node, newrange, flag);
- }
- }
+ CHECK(compile_dots(iseq, ret, node, popped, FALSE));
+ break;
+ case NODE_DOT3:
+ CHECK(compile_dots(iseq, ret, node, popped, TRUE));
break;
- }
case NODE_FLIP2:
case NODE_FLIP3:{
LABEL *lend = NEW_LABEL(line);
@@ -9102,62 +9577,40 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
CHECK(compile_flip_flop(iseq, ret, node, type == NODE_FLIP2,
ltrue, lfalse));
ADD_LABEL(ret, ltrue);
- ADD_INSN1(ret, line_node, putobject, Qtrue);
- ADD_INSNL(ret, line_node, jump, lend);
+ ADD_INSN1(ret, node, putobject, Qtrue);
+ ADD_INSNL(ret, node, jump, lend);
ADD_LABEL(ret, lfalse);
- ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, node, putobject, Qfalse);
ADD_LABEL(ret, lend);
break;
}
case NODE_SELF:{
if (!popped) {
- ADD_INSN(ret, line_node, putself);
+ ADD_INSN(ret, node, putself);
}
break;
}
case NODE_NIL:{
if (!popped) {
- ADD_INSN(ret, line_node, putnil);
+ ADD_INSN(ret, node, putnil);
}
break;
}
case NODE_TRUE:{
if (!popped) {
- ADD_INSN1(ret, line_node, putobject, Qtrue);
+ ADD_INSN1(ret, node, putobject, Qtrue);
}
break;
}
case NODE_FALSE:{
if (!popped) {
- ADD_INSN1(ret, line_node, putobject, Qfalse);
+ ADD_INSN1(ret, node, putobject, Qfalse);
}
break;
}
- case NODE_ERRINFO:{
- if (!popped) {
- if (body->type == ISEQ_TYPE_RESCUE) {
- ADD_GETLOCAL(ret, line_node, LVAR_ERRINFO, 0);
- }
- else {
- const rb_iseq_t *ip = iseq;
- int level = 0;
- while (ip) {
- if (ip->body->type == ISEQ_TYPE_RESCUE) {
- break;
- }
- ip = ip->body->parent_iseq;
- level++;
- }
- if (ip) {
- ADD_GETLOCAL(ret, line_node, LVAR_ERRINFO, level);
- }
- else {
- ADD_INSN(ret, line_node, putnil);
- }
- }
- }
+ case NODE_ERRINFO:
+ CHECK(compile_errinfo(iseq, ret, node, popped));
break;
- }
case NODE_DEFINED:
if (!popped) {
CHECK(compile_defined_expr(iseq, ret, node, Qtrue));
@@ -9174,153 +9627,41 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
new_child_iseq_with_callback(iseq, ifunc,
rb_fstring(make_name_for_block(iseq)), iseq, ISEQ_TYPE_BLOCK, line);
- ADD_INSN2(ret, line_node, once, once_iseq, INT2FIX(is_index));
+ ADD_INSN2(ret, node, once, once_iseq, INT2FIX(is_index));
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)once_iseq);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
case NODE_KW_ARG:
- {
- LABEL *end_label = NEW_LABEL(nd_line(node));
- const NODE *default_value = node->nd_body->nd_value;
-
- if (default_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
- /* required argument. do nothing */
- COMPILE_ERROR(ERROR_ARGS "unreachable");
- goto ng;
- }
- else if (nd_type(default_value) == NODE_LIT ||
- nd_type(default_value) == NODE_NIL ||
- nd_type(default_value) == NODE_TRUE ||
- nd_type(default_value) == NODE_FALSE) {
- COMPILE_ERROR(ERROR_ARGS "unreachable");
- goto ng;
- }
- else {
- /* if keywordcheck(_kw_bits, nth_keyword)
- * kw = default_value
- * end
- */
- int kw_bits_idx = body->local_table_size - body->param.keyword->bits_start;
- int keyword_idx = body->param.keyword->num;
-
- ADD_INSN2(ret, line_node, checkkeyword, INT2FIX(kw_bits_idx + VM_ENV_DATA_SIZE - 1), INT2FIX(keyword_idx));
- ADD_INSNL(ret, line_node, branchif, end_label);
- CHECK(COMPILE_POPPED(ret, "keyword default argument", node->nd_body));
- ADD_LABEL(ret, end_label);
- }
-
- break;
- }
+ CHECK(compile_kw_arg(iseq, ret, node, popped));
+ break;
case NODE_DSYM:{
compile_dstr(iseq, ret, node);
if (!popped) {
- ADD_INSN(ret, line_node, intern);
+ ADD_INSN(ret, node, intern);
}
else {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
- case NODE_ATTRASGN:{
- DECL_ANCHOR(recv);
- DECL_ANCHOR(args);
- unsigned int flag = 0;
- ID mid = node->nd_mid;
- VALUE argc;
- LABEL *else_label = NULL;
- VALUE branches = Qfalse;
-
- /* optimization shortcut
- * obj["literal"] = value -> opt_aset_with(obj, "literal", value)
- */
- if (mid == idASET && !private_recv_p(node) && node->nd_args &&
- nd_type(node->nd_args) == NODE_LIST && node->nd_args->nd_alen == 2 &&
- nd_type(node->nd_args->nd_head) == NODE_STR &&
- ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
- !ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
- {
- VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
- CHECK(COMPILE(ret, "recv", node->nd_recv));
- CHECK(COMPILE(ret, "value", node->nd_args->nd_next->nd_head));
- if (!popped) {
- ADD_INSN(ret, line_node, swap);
- ADD_INSN1(ret, line_node, topn, INT2FIX(1));
- }
- ADD_INSN2(ret, line_node, opt_aset_with, str,
- new_callinfo(iseq, idASET, 2, 0, NULL, FALSE));
- RB_OBJ_WRITTEN(iseq, Qundef, str);
- ADD_INSN(ret, line_node, pop);
- break;
- }
-
- INIT_ANCHOR(recv);
- INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
- CHECK(!NIL_P(argc));
-
- int asgnflag = COMPILE_RECV(recv, "recv", node);
- CHECK(asgnflag != -1);
- flag |= (unsigned int)asgnflag;
-
- debugp_param("argc", argc);
- debugp_param("nd_mid", ID2SYM(mid));
-
- if (!rb_is_attrset_id(mid)) {
- /* safe nav attr */
- mid = rb_id_attrset(mid);
- else_label = qcall_branch_start(iseq, recv, &branches, node, line_node);
- }
- if (!popped) {
- ADD_INSN(ret, line_node, putnil);
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, args);
-
- if (flag & VM_CALL_ARGS_BLOCKARG) {
- ADD_INSN1(ret, line_node, topn, INT2FIX(1));
- if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN1(ret, line_node, putobject, INT2FIX(-1));
- ADD_SEND_WITH_FLAG(ret, line_node, idAREF, INT2FIX(1), INT2FIX(asgnflag));
- }
- ADD_INSN1(ret, line_node, setn, FIXNUM_INC(argc, 3));
- ADD_INSN (ret, line_node, pop);
- }
- else if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN(ret, line_node, dup);
- ADD_INSN1(ret, line_node, putobject, INT2FIX(-1));
- ADD_SEND_WITH_FLAG(ret, line_node, idAREF, INT2FIX(1), INT2FIX(asgnflag));
- ADD_INSN1(ret, line_node, setn, FIXNUM_INC(argc, 2));
- ADD_INSN (ret, line_node, pop);
- }
- else {
- ADD_INSN1(ret, line_node, setn, FIXNUM_INC(argc, 1));
- }
- }
- else {
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, args);
- }
- ADD_SEND_WITH_FLAG(ret, line_node, mid, argc, INT2FIX(flag));
- qcall_branch_end(iseq, ret, else_label, branches, node, line_node);
- ADD_INSN(ret, line_node, pop);
-
+ case NODE_ATTRASGN:
+ CHECK(compile_attrasgn(iseq, ret, node, popped));
break;
- }
case NODE_LAMBDA:{
/* compile same as lambda{...} */
const rb_iseq_t *block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
VALUE argc = INT2FIX(0);
- ADD_INSN1(ret, line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_CALL_WITH_BLOCK(ret, line_node, idLambda, argc, block);
+ ADD_INSN1(ret, node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_CALL_WITH_BLOCK(ret, node, idLambda, argc, block);
RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)block);
if (popped) {
- ADD_INSN(ret, line_node, pop);
+ ADD_INSN(ret, node, pop);
}
break;
}
@@ -9593,7 +9934,7 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
rb_raise(rb_eSyntaxError, "wrong exception entry");
}
type = get_exception_sym2type(RARRAY_AREF(v, 0));
- if (RARRAY_AREF(v, 1) == Qnil) {
+ if (NIL_P(RARRAY_AREF(v, 1))) {
eiseq = NULL;
}
else {
@@ -10281,7 +10622,7 @@ typedef unsigned int ibf_offset_t;
#define IBF_MAJOR_VERSION ISEQ_MAJOR_VERSION
#if RUBY_DEVEL
-#define IBF_DEVEL_VERSION 2
+#define IBF_DEVEL_VERSION 3
#define IBF_MINOR_VERSION (ISEQ_MINOR_VERSION * 10000 + IBF_DEVEL_VERSION)
#else
#define IBF_MINOR_VERSION ISEQ_MINOR_VERSION
@@ -11139,6 +11480,33 @@ ibf_dump_ci_entries(struct ibf_dump *dump, const rb_iseq_t *iseq)
return offset;
}
+static enum rb_id_table_iterator_result
+dump_outer_variable(ID id, VALUE val, void *dump)
+{
+ ibf_dump_write_small_value(dump, ibf_dump_id(dump, id));
+ ibf_dump_write_small_value(dump, val);
+
+ return ID_TABLE_CONTINUE;
+}
+
+static ibf_offset_t
+ibf_dump_outer_variables(struct ibf_dump *dump, const rb_iseq_t *iseq)
+{
+ struct rb_id_table * ovs = iseq->body->outer_variables;
+
+ ibf_offset_t offset = ibf_dump_pos(dump);
+
+ if (ovs) {
+ ibf_dump_write_small_value(dump, (VALUE)rb_id_table_size(ovs));
+ rb_id_table_foreach(ovs, dump_outer_variable, (void *)dump);
+ }
+ else {
+ ibf_dump_write_small_value(dump, (VALUE)0);
+ }
+
+ return offset;
+}
+
/* note that we dump out rb_call_info but load back rb_call_data */
static void
ibf_load_ci_entries(const struct ibf_load *load,
@@ -11183,6 +11551,28 @@ ibf_load_ci_entries(const struct ibf_load *load,
}
}
+static struct rb_id_table *
+ibf_load_outer_variables(const struct ibf_load * load, ibf_offset_t outer_variables_offset)
+{
+ ibf_offset_t reading_pos = outer_variables_offset;
+
+ struct rb_id_table *tbl = NULL;
+
+ size_t table_size = (size_t)ibf_load_small_value(load, &reading_pos);
+
+ if (table_size > 0) {
+ tbl = rb_id_table_create(table_size);
+ }
+
+ for (size_t i = 0; i < table_size; i++) {
+ ID key = ibf_load_id(load, (ID)ibf_load_small_value(load, &reading_pos));
+ VALUE value = ibf_load_small_value(load, &reading_pos);
+ rb_id_table_insert(tbl, key, value);
+ }
+
+ return tbl;
+}
+
static ibf_offset_t
ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
{
@@ -11222,6 +11612,7 @@ ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
const int parent_iseq_index = ibf_dump_iseq(dump, iseq->body->parent_iseq);
const int local_iseq_index = ibf_dump_iseq(dump, iseq->body->local_iseq);
const ibf_offset_t ci_entries_offset = ibf_dump_ci_entries(dump, iseq);
+ const ibf_offset_t outer_variables_offset = ibf_dump_outer_variables(dump, iseq);
#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
ibf_offset_t local_obj_list_offset;
@@ -11283,6 +11674,7 @@ ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
ibf_dump_write_small_value(dump, parent_iseq_index);
ibf_dump_write_small_value(dump, local_iseq_index);
ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(ci_entries_offset));
+ ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(outer_variables_offset));
ibf_dump_write_small_value(dump, body->variable.flip_count);
ibf_dump_write_small_value(dump, body->local_table_size);
ibf_dump_write_small_value(dump, body->is_size);
@@ -11389,6 +11781,7 @@ ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
const int parent_iseq_index = (int)ibf_load_small_value(load, &reading_pos);
const int local_iseq_index = (int)ibf_load_small_value(load, &reading_pos);
const ibf_offset_t ci_entries_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
+ const ibf_offset_t outer_variables_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
const rb_snum_t variable_flip_count = (rb_snum_t)ibf_load_small_value(load, &reading_pos);
const unsigned int local_table_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
const unsigned int is_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
@@ -11438,6 +11831,7 @@ ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
load_body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, is_size);
ibf_load_ci_entries(load, ci_entries_offset, ci_size, &load_body->call_data);
+ load_body->outer_variables = ibf_load_outer_variables(load, outer_variables_offset);
load_body->param.opt_table = ibf_load_param_opt_table(load, param_opt_table_offset, param_opt_num);
load_body->param.keyword = ibf_load_param_keyword(load, param_keyword_offset);
load_body->param.flags.has_kw = (param_flags >> 4) & 1;
@@ -11558,6 +11952,7 @@ enum ibf_object_class_index {
IBF_OBJECT_CLASS_STANDARD_ERROR,
IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_ERROR,
IBF_OBJECT_CLASS_TYPE_ERROR,
+ IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_KEY_ERROR,
};
struct ibf_object_regexp {
@@ -11647,6 +12042,9 @@ ibf_dump_object_class(struct ibf_dump *dump, VALUE obj)
else if (obj == rb_eTypeError) {
cindex = IBF_OBJECT_CLASS_TYPE_ERROR;
}
+ else if (obj == rb_eNoMatchingPatternKeyError) {
+ cindex = IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_KEY_ERROR;
+ }
else {
rb_obj_info_dump(obj);
rb_p(obj);
@@ -11671,6 +12069,8 @@ ibf_load_object_class(const struct ibf_load *load, const struct ibf_object_heade
return rb_eNoMatchingPatternError;
case IBF_OBJECT_CLASS_TYPE_ERROR:
return rb_eTypeError;
+ case IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_KEY_ERROR:
+ return rb_eNoMatchingPatternKeyError;
}
rb_raise(rb_eArgError, "ibf_load_object_class: unknown class (%d)", (int)cindex);
@@ -12059,8 +12459,8 @@ ibf_dump_object_object(struct ibf_dump *dump, VALUE obj)
current_offset = ibf_dump_pos(dump);
if (SPECIAL_CONST_P(obj) &&
- ! (RB_TYPE_P(obj, T_SYMBOL) ||
- RB_TYPE_P(obj, T_FLOAT))) {
+ ! (SYMBOL_P(obj) ||
+ RB_FLOAT_TYPE_P(obj))) {
obj_header.special_const = TRUE;
obj_header.frozen = TRUE;
obj_header.internal = TRUE;
diff --git a/complex.c b/complex.c
index 09e47f8007..ea3c137461 100644
--- a/complex.c
+++ b/complex.c
@@ -34,10 +34,6 @@
#else
static VALUE RFLOAT_0;
#endif
-#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
- !defined(signbit)
-extern int signbit(double);
-#endif
VALUE rb_cComplex;
@@ -54,8 +50,6 @@ static ID id_abs, id_arg,
#define id_quo idQuo
#define id_fdiv idFdiv
-#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
-
#define fun1(n) \
inline static VALUE \
f_##n(VALUE x)\
@@ -340,36 +334,38 @@ f_zero_p(VALUE x)
#define f_nonzero_p(x) (!f_zero_p(x))
+static inline bool
+always_finite_type_p(VALUE x)
+{
+ if (FIXNUM_P(x)) return true;
+ if (FLONUM_P(x)) return true; /* Infinity can't be a flonum */
+ return (RB_INTEGER_TYPE_P(x) || RB_TYPE_P(x, T_RATIONAL));
+}
+
VALUE rb_flo_is_finite_p(VALUE num);
inline static int
f_finite_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
+ if (always_finite_type_p(x)) {
return TRUE;
}
else if (RB_FLOAT_TYPE_P(x)) {
- return (int)rb_flo_is_finite_p(x);
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return TRUE;
+ return isfinite(RFLOAT_VALUE(x));
}
return RTEST(rb_funcallv(x, id_finite_p, 0, 0));
}
VALUE rb_flo_is_infinite_p(VALUE num);
-inline static VALUE
+inline static int
f_infinite_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return Qnil;
+ if (always_finite_type_p(x)) {
+ return FALSE;
}
else if (RB_FLOAT_TYPE_P(x)) {
- return rb_flo_is_infinite_p(x);
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return Qnil;
+ return isinf(RFLOAT_VALUE(x));
}
- return rb_funcallv(x, id_infinite_p, 0, 0);
+ return RTEST(rb_funcallv(x, id_infinite_p, 0, 0));
}
inline static int
@@ -1062,7 +1058,7 @@ rb_complex_pow(VALUE self, VALUE other)
if (k_numeric_p(other) && f_real_p(other)) {
VALUE r, theta;
- if (RB_TYPE_P(other, T_BIGNUM))
+ if (RB_BIGNUM_TYPE_P(other))
rb_warn("in a**b, b may be too big");
r = f_abs(self);
@@ -1092,15 +1088,15 @@ nucomp_eqeq_p(VALUE self, VALUE other)
if (RB_TYPE_P(other, T_COMPLEX)) {
get_dat2(self, other);
- return f_boolcast(f_eqeq_p(adat->real, bdat->real) &&
+ return RBOOL(f_eqeq_p(adat->real, bdat->real) &&
f_eqeq_p(adat->imag, bdat->imag));
}
if (k_numeric_p(other) && f_real_p(other)) {
get_dat1(self);
- return f_boolcast(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag));
+ return RBOOL(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag));
}
- return f_boolcast(f_eqeq_p(other, self));
+ return RBOOL(f_eqeq_p(other, self));
}
static bool
@@ -1354,7 +1350,7 @@ nucomp_eql_p(VALUE self, VALUE other)
if (RB_TYPE_P(other, T_COMPLEX)) {
get_dat2(self, other);
- return f_boolcast((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) &&
+ return RBOOL((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) &&
(CLASS_OF(adat->imag) == CLASS_OF(bdat->imag)) &&
f_eqeq_p(self, other));
@@ -1455,10 +1451,7 @@ rb_complex_finite_p(VALUE self)
{
get_dat1(self);
- if (f_finite_p(dat->real) && f_finite_p(dat->imag)) {
- return Qtrue;
- }
- return Qfalse;
+ return RBOOL(f_finite_p(dat->real) && f_finite_p(dat->imag));
}
/*
@@ -1478,7 +1471,7 @@ rb_complex_infinite_p(VALUE self)
{
get_dat1(self);
- if (NIL_P(f_infinite_p(dat->real)) && NIL_P(f_infinite_p(dat->imag))) {
+ if (!f_infinite_p(dat->real) && !f_infinite_p(dat->imag)) {
return Qnil;
}
return ONE;
@@ -1528,8 +1521,6 @@ nucomp_marshal_load(VALUE self, VALUE a)
return self;
}
-/* --- */
-
VALUE
rb_complex_raw(VALUE x, VALUE y)
{
@@ -1563,13 +1554,6 @@ rb_Complex(VALUE x, VALUE y)
return nucomp_s_convert(2, a, rb_cComplex);
}
-/*!
- * Creates a Complex object.
- *
- * \param real real part value
- * \param imag imaginary part value
- * \return a new Complex object
- */
VALUE
rb_dbl_complex_new(double real, double imag)
{
@@ -2152,8 +2136,6 @@ nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
return nucomp_convert(klass, a1, a2, TRUE);
}
-/* --- */
-
/*
* call-seq:
* num.real -> self
@@ -2408,8 +2390,6 @@ Init_Complex(void)
rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
- /* --- */
-
rb_define_method(rb_cComplex, "to_i", nucomp_to_i, 0);
rb_define_method(rb_cComplex, "to_f", nucomp_to_f, 0);
rb_define_method(rb_cComplex, "to_r", nucomp_to_r, 0);
@@ -2422,8 +2402,6 @@ Init_Complex(void)
rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1);
- /* --- */
-
rb_define_method(rb_cNumeric, "real", numeric_real, 0);
rb_define_method(rb_cNumeric, "imaginary", numeric_imag, 0);
rb_define_method(rb_cNumeric, "imag", numeric_imag, 0);
diff --git a/configure.ac b/configure.ac
index d018e8a6f4..efa39bf26e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -218,7 +218,7 @@ rb_test_CXXFLAGS=${CXXFLAGS+yes}
# BSD's ports and MacPorts prefix GNU binutils with 'g'
dnl Seems necessarily in order to add -std=gnu99 option for gcc 4.9.
-m4_version_prereq([2.70], [], [AC_PROG_CC_C99])
+m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
AC_PROG_CXX
AC_PROG_CPP
@@ -450,11 +450,13 @@ AS_CASE(["$target_os"],
[[FILE* volatile f = stdin; return 0;]])],
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
tr A-Z a-z |
- sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
+ sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;};
+ /^[[ ]]*dll name: \(ucrtbase\|api-ms-win-crt-.*\)\.dll$/{s//ucrt/p;q;}'`],
[rb_cv_msvcrt=msvcrt])
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
test "$RT_VER" = "" && RT_VER=60
+ test "$rb_cv_msvcrt" = "ucrt" && RT_VER=140
AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
sysconfdir=
])
@@ -799,7 +801,7 @@ AS_IF([test "$GCC" = yes], [
])
],
[cygwin*|msys*|darwin*|netbsd*], [
- # need lgamma_r(), finite()
+ # need lgamma_r()
])
# ANSI (no XCFLAGS because this is C only)
@@ -1104,16 +1106,13 @@ main()
])
])
],
-[haiku*], [
- LIBS="$LIBS -lssp" # m lib is include in root
- ],
[cygwin*|msys*], [
ac_cv_header_langinfo_h=yes
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_GNU_SOURCE)
AC_CHECK_FUNCS(cygwin_conv_path)
AC_LIBOBJ([langinfo])
],
-[mingw*], [ LIBS="-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi $LIBS"
+[mingw*], [ LIBS="-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt $LIBS"
ac_cv_header_pwd_h=no
ac_cv_header_utime_h=no
ac_cv_header_sys_ioctl_h=no
@@ -1281,6 +1280,7 @@ AC_CHECK_HEADERS(utime.h)
AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
AC_CHECK_HEADERS(x86intrin.h)
])
+RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
AC_ARG_WITH([gmp],
[AS_HELP_STRING([--without-gmp],
@@ -1383,7 +1383,7 @@ AS_CASE(["$target_os"],
])
])
-AC_C_BIGENDIAN
+AC_C_BIGENDIAN([], [], [], [AC_DEFINE(AC_APPLE_UNIVERSAL_BUILD, 1)])
AC_C_CONST
AC_C_CHAR_UNSIGNED
AC_C_INLINE
@@ -1662,7 +1662,7 @@ AC_CACHE_CHECK(for function name string predefined identifier,
RUBY_WERROR_FLAG([
for func in __func__ __FUNCTION__; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
- [[puts($func);]])],
+ [[puts($func);]])],
[rb_cv_function_name_string=$func
break])
done
@@ -1906,9 +1906,7 @@ AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(strstr)
AC_REPLACE_FUNCS(tgamma)
-RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>])
-RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>])
-RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>])
+AC_DEFINE(HAVE_ISFINITE) # C99; backward compatibility
# for missing/setproctitle.c
AS_CASE(["$target_os"],
@@ -1918,17 +1916,7 @@ AS_CASE(["$target_os"],
AC_CHECK_HEADERS(sys/pstat.h)
-AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <math.h>
-]], [[int v = signbit(-0.0);]])],
- rb_cv_have_signbit=yes,
- rb_cv_have_signbit=no)])
-AS_IF([test "$rb_cv_have_signbit" = yes], [
- AC_DEFINE(HAVE_SIGNBIT)
-], [
- AC_LIBOBJ([signbit])
-])
+AC_DEFINE(HAVE_SIGNBIT) # C99; backward compatibility
AC_FUNC_FORK
@@ -2518,10 +2506,10 @@ AS_CASE([$coroutine_type], [yes|''], [
[*86-linux*], [
coroutine_type=x86
],
- [x64-mingw32], [
+ [x64-mingw*], [
coroutine_type=win64
],
- [*86-mingw32], [
+ [*86-mingw*], [
coroutine_type=win32
],
[arm*-linux*], [
@@ -2536,6 +2524,24 @@ AS_CASE([$coroutine_type], [yes|''], [
[riscv64-linux*], [
coroutine_type=riscv64
],
+ [x86_64-freebsd*], [
+ coroutine_type=amd64
+ ],
+ [i386-freebsd*], [
+ coroutine_type=x86
+ ],
+ [aarch64-freebsd*], [
+ coroutine_type=arm64
+ ],
+ [x86_64-netbsd*], [
+ coroutine_type=amd64
+ ],
+ [i386-netbsd*], [
+ coroutine_type=x86
+ ],
+ [aarch64-netbsd*], [
+ coroutine_type=arm64
+ ],
[x86_64-openbsd*], [
coroutine_type=amd64
],
@@ -2545,6 +2551,9 @@ AS_CASE([$coroutine_type], [yes|''], [
[*-openbsd*], [
coroutine_type=pthread
],
+ [x86_64-dragonfly*], [
+ coroutine_type=amd64
+ ],
[*-haiku*], [
coroutine_type=pthread
],
@@ -2564,14 +2573,9 @@ AS_CASE([$coroutine_type], [yes|''], [
COROUTINE_H=coroutine/$coroutine_type/Context.h
AS_IF([test ! -f "$srcdir/$COROUTINE_H"],
[AC_MSG_ERROR('$coroutine_type' is not supported as coroutine)])
-AS_CASE([$coroutine_type],
- [ucontext|pthread], [
- COROUTINE_SRC=coroutine/$coroutine_type/Context.c
- ],
- [
- COROUTINE_SRC=coroutine/$coroutine_type/Context.'$(ASMEXT)'
- ]
-)
+COROUTINE_SRC=coroutine/$coroutine_type/Context.c
+AS_IF([test ! -f "$srcdir/$COROUTINE_SRC"],
+ [COROUTINE_SRC=coroutine/$coroutine_type/Context.'$(ASMEXT)'])
AC_DEFINE_UNQUOTED(COROUTINE_H, ["$COROUTINE_H"])
AC_SUBST(X_COROUTINE_H, [$COROUTINE_H])
AC_SUBST(X_COROUTINE_SRC, [$COROUTINE_SRC])
@@ -2861,7 +2865,6 @@ AC_SUBST(CCDLFLAGS)dnl
AC_SUBST(LDSHARED)dnl
AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
-AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
AC_SUBST(ASMEXT, S)dnl
@@ -3181,10 +3184,8 @@ AS_IF([test x"$LOAD_RELATIVE" = x1], [
len=2 # .rb
n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
-n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
-test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
AC_SUBST(DLEXT)
: "strip" && {
@@ -3674,7 +3675,10 @@ AC_SUBST(MJIT_SUPPORT)
AC_ARG_ENABLE(install-static-library,
AS_HELP_STRING([--disable-install-static-library], [do not install static ruby library]),
- [INSTALL_STATIC_LIBRARY=$enableval],
+ [INSTALL_STATIC_LIBRARY=$enableval
+ AS_IF([test x"$enable_shared" = xno -a x"$INSTALL_STATIC_LIBRARY" = xno],
+ [AC_MSG_ERROR([must install either static or shared library])],
+ [])],
AS_IF([test x"$enable_shared" = xyes],
[INSTALL_STATIC_LIBRARY=no],
[INSTALL_STATIC_LIBRARY=yes]))
@@ -3750,7 +3754,7 @@ AS_CASE(["$target_os"],
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
])
EXPORT_PREFIX=' '
- DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
+ EXTDLDFLAGS='$(DEFFILE)'
AC_LIBOBJ([win32/win32])
AC_LIBOBJ([win32/file])
COMMON_LIBS=m
@@ -4070,7 +4074,11 @@ AS_IF([test "${universal_binary-no}" = yes ], [
AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-" RUBY_PLATFORM_OS)
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal." RUBY_PLATFORM_CPU "-" RUBY_PLATFORM_OS)
], [
- arch="${target_cpu}-${target_os}"
+ AS_IF([test "${target_os}-${rb_cv_msvcrt}" = "mingw32-ucrt" ], [
+ arch="${target_cpu}-mingw-ucrt"
+ ], [
+ arch="${target_cpu}-${target_os}"
+ ])
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")
])
@@ -4271,21 +4279,6 @@ AC_ARG_WITH(destdir,
[DESTDIR="$withval"])
AC_SUBST(DESTDIR)
-AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
- [
- AS_IF([sed ['s/\$(\([A-Za-z_][A-Za-z0-9_]*\))/${\1}/g;s/@[A-Za-z_][A-Za-z0-9_]*@//'] $ruby_pc > ruby.tmp.pc &&
- {
- test -z "$PKG_CONFIG" ||
- PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
- }],
- [
- mv -f ruby.tmp.pc $ruby_pc
- ], [
- exit 1
- ])
- ],
- [ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
-
AC_OUTPUT
}
}
diff --git a/cont.c b/cont.c
index 22c5ce5e46..8a56fa6735 100644
--- a/cont.c
+++ b/cont.c
@@ -235,7 +235,7 @@ struct rb_fiber_struct {
rb_context_t cont;
VALUE first_proc;
struct rb_fiber_struct *prev;
- VALUE resuming_fiber;
+ struct rb_fiber_struct *resuming_fiber;
BITFIELD(enum fiber_status, status, 2);
/* Whether the fiber is allowed to implicitly yield. */
@@ -561,7 +561,7 @@ fiber_pool_allocation_free(struct fiber_pool_allocation * allocation)
VM_ASSERT(allocation->used == 0);
- if (DEBUG) fprintf(stderr, "fiber_pool_allocation_free: %p base=%p count=%"PRIuSIZE"\n", allocation, allocation->base, allocation->count);
+ if (DEBUG) fprintf(stderr, "fiber_pool_allocation_free: %p base=%p count=%"PRIuSIZE"\n", (void*)allocation, allocation->base, allocation->count);
size_t i;
for (i = 0; i < allocation->count; i += 1) {
@@ -711,8 +711,6 @@ fiber_pool_stack_release(struct fiber_pool_stack * stack)
#endif
}
-void rb_fiber_start(rb_fiber_t*);
-
static inline void
ec_switch(rb_thread_t *th, rb_fiber_t *fiber)
{
@@ -1054,7 +1052,7 @@ fiber_free(void *ptr)
rb_fiber_t *fiber = ptr;
RUBY_FREE_ENTER("fiber");
- if (DEBUG) fprintf(stderr, "fiber_free: %p[%p]\n", fiber, fiber->stack.base);
+ if (DEBUG) fprintf(stderr, "fiber_free: %p[%p]\n", (void *)fiber, fiber->stack.base);
if (fiber->cont.saved_ec.local_storage) {
rb_id_table_free(fiber->cont.saved_ec.local_storage);
@@ -1085,12 +1083,7 @@ fiber_memsize(const void *ptr)
VALUE
rb_obj_is_fiber(VALUE obj)
{
- if (rb_typeddata_is_kind_of(obj, &fiber_data_type)) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
+ return RBOOL(rb_typeddata_is_kind_of(obj, &fiber_data_type));
}
static void
@@ -1374,7 +1367,7 @@ fiber_setcontext(rb_fiber_t *new_fiber, rb_fiber_t *old_fiber)
/* old_fiber->machine.stack_end should be NULL */
old_fiber->cont.saved_ec.machine.stack_end = NULL;
- // if (DEBUG) fprintf(stderr, "fiber_setcontext: %p[%p] -> %p[%p]\n", old_fiber, old_fiber->stack.base, new_fiber, new_fiber->stack.base);
+ // if (DEBUG) fprintf(stderr, "fiber_setcontext: %p[%p] -> %p[%p]\n", (void*)old_fiber, old_fiber->stack.base, (void*)new_fiber, new_fiber->stack.base);
/* swap machine context */
struct coroutine_context * from = coroutine_transfer(&old_fiber->context, &new_fiber->context);
@@ -1387,7 +1380,7 @@ fiber_setcontext(rb_fiber_t *new_fiber, rb_fiber_t *old_fiber)
fiber_restore_thread(th, old_fiber);
// It's possible to get here, and new_fiber is already freed.
- // if (DEBUG) fprintf(stderr, "fiber_setcontext: %p[%p] <- %p[%p]\n", old_fiber, old_fiber->stack.base, new_fiber, new_fiber->stack.base);
+ // if (DEBUG) fprintf(stderr, "fiber_setcontext: %p[%p] <- %p[%p]\n", (void*)old_fiber, old_fiber->stack.base, (void*)new_fiber, new_fiber->stack.base);
}
NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *)));
@@ -2181,7 +2174,7 @@ return_fiber(bool terminate)
if (prev) {
fiber->prev = NULL;
- prev->resuming_fiber = Qnil;
+ prev->resuming_fiber = NULL;
return prev;
}
else {
@@ -2195,9 +2188,7 @@ return_fiber(bool terminate)
VM_ASSERT(root_fiber != NULL);
// search resuming fiber
- for (fiber = root_fiber;
- RTEST(fiber->resuming_fiber);
- fiber = fiber_ptr(fiber->resuming_fiber)) {
+ for (fiber = root_fiber; fiber->resuming_fiber; fiber = fiber->resuming_fiber) {
}
return fiber;
@@ -2238,7 +2229,7 @@ fiber_store(rb_fiber_t *next_fiber, rb_thread_t *th)
}
static inline VALUE
-fiber_switch(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat, VALUE resuming_fiber, bool yielding)
+fiber_switch(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat, rb_fiber_t *resuming_fiber, bool yielding)
{
VALUE value;
rb_context_t *cont = &fiber->cont;
@@ -2285,8 +2276,9 @@ fiber_switch(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat, VALUE
rb_fiber_t *current_fiber = fiber_current();
- VM_ASSERT(!RTEST(current_fiber->resuming_fiber));
- if (RTEST(resuming_fiber)) {
+ VM_ASSERT(!current_fiber->resuming_fiber);
+
+ if (resuming_fiber) {
current_fiber->resuming_fiber = resuming_fiber;
fiber->prev = fiber_current();
fiber->yielding = 0;
@@ -2309,7 +2301,7 @@ fiber_switch(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat, VALUE
// We cannot free the stack until the pthread is joined:
#ifndef COROUTINE_PTHREAD_CONTEXT
- if (RTEST(resuming_fiber) && FIBER_TERMINATED_P(fiber)) {
+ if (resuming_fiber && FIBER_TERMINATED_P(fiber)) {
fiber_stack_release(fiber);
}
#endif
@@ -2331,7 +2323,7 @@ fiber_switch(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat, VALUE
VALUE
rb_fiber_transfer(VALUE fiber_value, int argc, const VALUE *argv)
{
- return fiber_switch(fiber_ptr(fiber_value), argc, argv, RB_NO_KEYWORDS, Qfalse, false);
+ return fiber_switch(fiber_ptr(fiber_value), argc, argv, RB_NO_KEYWORDS, NULL, false);
}
/*
@@ -2351,7 +2343,7 @@ rb_fiber_transfer(VALUE fiber_value, int argc, const VALUE *argv)
VALUE
rb_fiber_blocking_p(VALUE fiber)
{
- return (fiber_ptr(fiber)->blocking == 0) ? Qfalse : Qtrue;
+ return RBOOL(fiber_ptr(fiber)->blocking != 0);
}
/*
@@ -2406,15 +2398,14 @@ rb_fiber_terminate(rb_fiber_t *fiber, int need_interrupt, VALUE error)
if (need_interrupt) RUBY_VM_SET_INTERRUPT(&next_fiber->cont.saved_ec);
if (RTEST(error))
- fiber_switch(next_fiber, -1, &error, RB_NO_KEYWORDS, Qfalse, false);
+ fiber_switch(next_fiber, -1, &error, RB_NO_KEYWORDS, NULL, false);
else
- fiber_switch(next_fiber, 1, &value, RB_NO_KEYWORDS, Qfalse, false);
+ fiber_switch(next_fiber, 1, &value, RB_NO_KEYWORDS, NULL, false);
}
-VALUE
-rb_fiber_resume_kw(VALUE fiber_value, int argc, const VALUE *argv, int kw_splat)
+static VALUE
+fiber_resume_kw(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat)
{
- rb_fiber_t *fiber = fiber_ptr(fiber_value);
rb_fiber_t *current_fiber = fiber_current();
if (argc == -1 && FIBER_CREATED_P(fiber)) {
@@ -2429,7 +2420,7 @@ rb_fiber_resume_kw(VALUE fiber_value, int argc, const VALUE *argv, int kw_splat)
else if (fiber->prev != NULL) {
rb_raise(rb_eFiberError, "attempt to resume a resumed fiber (double resume)");
}
- else if (RTEST(fiber->resuming_fiber)) {
+ else if (fiber->resuming_fiber) {
rb_raise(rb_eFiberError, "attempt to resume a resuming fiber");
}
else if (fiber->prev == NULL &&
@@ -2437,27 +2428,33 @@ rb_fiber_resume_kw(VALUE fiber_value, int argc, const VALUE *argv, int kw_splat)
rb_raise(rb_eFiberError, "attempt to resume a transferring fiber");
}
- VALUE result = fiber_switch(fiber, argc, argv, kw_splat, fiber_value, false);
+ VALUE result = fiber_switch(fiber, argc, argv, kw_splat, fiber, false);
return result;
}
VALUE
-rb_fiber_resume(VALUE fiber_value, int argc, const VALUE *argv)
+rb_fiber_resume_kw(VALUE self, int argc, const VALUE *argv, int kw_splat)
+{
+ return fiber_resume_kw(fiber_ptr(self), argc, argv, kw_splat);
+}
+
+VALUE
+rb_fiber_resume(VALUE self, int argc, const VALUE *argv)
{
- return rb_fiber_resume_kw(fiber_value, argc, argv, RB_NO_KEYWORDS);
+ return fiber_resume_kw(fiber_ptr(self), argc, argv, RB_NO_KEYWORDS);
}
VALUE
rb_fiber_yield_kw(int argc, const VALUE *argv, int kw_splat)
{
- return fiber_switch(return_fiber(false), argc, argv, kw_splat, Qfalse, true);
+ return fiber_switch(return_fiber(false), argc, argv, kw_splat, NULL, true);
}
VALUE
rb_fiber_yield(int argc, const VALUE *argv)
{
- return fiber_switch(return_fiber(false), argc, argv, RB_NO_KEYWORDS, Qfalse, true);
+ return fiber_switch(return_fiber(false), argc, argv, RB_NO_KEYWORDS, NULL, true);
}
void
@@ -2503,45 +2500,6 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fiber)
return rb_fiber_resume_kw(fiber, argc, argv, rb_keyword_given_p());
}
-VALUE rb_fiber_transfer_kw(VALUE fiber_value, int argc, const VALUE *argv, int kw_splat);
-
-/*
- * call-seq:
- * fiber.raise -> obj
- * fiber.raise(string) -> obj
- * fiber.raise(exception [, string [, array]]) -> obj
- *
- * Raises an exception in the fiber at the point at which the last
- * +Fiber.yield+ was called. If the fiber has not been started or has
- * already run to completion, raises +FiberError+. If the fiber is
- * yielding, it is resumed. If it is transferring, it is transferred into.
- * But if it is resuming, raises +FiberError+.
- *
- * With no arguments, raises a +RuntimeError+. With a single +String+
- * argument, raises a +RuntimeError+ with the string as a message. Otherwise,
- * the first parameter should be the name of an +Exception+ class (or an
- * object that returns an +Exception+ object when sent an +exception+
- * message). The optional second parameter sets the message associated with
- * the exception, and the third parameter is an array of callback information.
- * Exceptions are caught by the +rescue+ clause of <code>begin...end</code>
- * blocks.
- */
-static VALUE
-rb_fiber_raise(int argc, VALUE *argv, VALUE fiber_value)
-{
- rb_fiber_t *fiber = fiber_ptr(fiber_value);
- VALUE exc = rb_make_exception(argc, argv);
- if (RTEST(fiber->resuming_fiber)) {
- rb_raise(rb_eFiberError, "attempt to raise a resuming fiber");
- }
- else if (FIBER_SUSPENDED_P(fiber) && !fiber->yielding) {
- return rb_fiber_transfer_kw(fiber_value, -1, &exc, RB_NO_KEYWORDS);
- }
- else {
- return rb_fiber_resume_kw(fiber_value, -1, &exc, RB_NO_KEYWORDS);
- }
-}
-
/*
* call-seq:
* fiber.backtrace -> array
@@ -2702,22 +2660,29 @@ rb_fiber_backtrace_locations(int argc, VALUE *argv, VALUE fiber)
*
*/
static VALUE
-rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fiber_value)
+rb_fiber_m_transfer(int argc, VALUE *argv, VALUE self)
+{
+ return rb_fiber_transfer_kw(self, argc, argv, rb_keyword_given_p());
+}
+
+static VALUE
+fiber_transfer_kw(rb_fiber_t *fiber, int argc, const VALUE *argv, int kw_splat)
{
- return rb_fiber_transfer_kw(fiber_value, argc, argv, rb_keyword_given_p());
+ if (fiber->resuming_fiber) {
+ rb_raise(rb_eFiberError, "attempt to transfer to a resuming fiber");
+ }
+
+ if (fiber->yielding) {
+ rb_raise(rb_eFiberError, "attempt to transfer to a yielding fiber");
+ }
+
+ return fiber_switch(fiber, argc, argv, kw_splat, NULL, false);
}
VALUE
-rb_fiber_transfer_kw(VALUE fiber_value, int argc, const VALUE *argv, int kw_splat)
+rb_fiber_transfer_kw(VALUE self, int argc, const VALUE *argv, int kw_splat)
{
- rb_fiber_t *fiber = fiber_ptr(fiber_value);
- if (RTEST(fiber->resuming_fiber)) {
- rb_raise(rb_eFiberError, "attempt to transfer to a resuming fiber");
- }
- if (fiber->yielding) {
- rb_raise(rb_eFiberError, "attempt to transfer to a yielding fiber");
- }
- return fiber_switch(fiber, argc, argv, kw_splat, Qfalse, false);
+ return fiber_transfer_kw(fiber_ptr(self), argc, argv, kw_splat);
}
/*
@@ -2736,6 +2701,55 @@ rb_fiber_s_yield(int argc, VALUE *argv, VALUE klass)
return rb_fiber_yield_kw(argc, argv, rb_keyword_given_p());
}
+static VALUE
+fiber_raise(rb_fiber_t *fiber, int argc, const VALUE *argv)
+{
+ VALUE exception = rb_make_exception(argc, argv);
+
+ if (fiber->resuming_fiber) {
+ rb_raise(rb_eFiberError, "attempt to raise a resuming fiber");
+ }
+ else if (FIBER_SUSPENDED_P(fiber) && !fiber->yielding) {
+ return fiber_transfer_kw(fiber, -1, &exception, RB_NO_KEYWORDS);
+ }
+ else {
+ return fiber_resume_kw(fiber, -1, &exception, RB_NO_KEYWORDS);
+ }
+}
+
+VALUE
+rb_fiber_raise(VALUE fiber, int argc, const VALUE *argv)
+{
+ return fiber_raise(fiber_ptr(fiber), argc, argv);
+}
+
+/*
+ * call-seq:
+ * fiber.raise -> obj
+ * fiber.raise(string) -> obj
+ * fiber.raise(exception [, string [, array]]) -> obj
+ *
+ * Raises an exception in the fiber at the point at which the last
+ * +Fiber.yield+ was called. If the fiber has not been started or has
+ * already run to completion, raises +FiberError+. If the fiber is
+ * yielding, it is resumed. If it is transferring, it is transferred into.
+ * But if it is resuming, raises +FiberError+.
+ *
+ * With no arguments, raises a +RuntimeError+. With a single +String+
+ * argument, raises a +RuntimeError+ with the string as a message. Otherwise,
+ * the first parameter should be the name of an +Exception+ class (or an
+ * object that returns an +Exception+ object when sent an +exception+
+ * message). The optional second parameter sets the message associated with
+ * the exception, and the third parameter is an array of callback information.
+ * Exceptions are caught by the +rescue+ clause of <code>begin...end</code>
+ * blocks.
+ */
+static VALUE
+rb_fiber_m_raise(int argc, VALUE *argv, VALUE self)
+{
+ return rb_fiber_raise(self, argc, argv);
+}
+
/*
* call-seq:
* Fiber.current -> fiber
@@ -2756,7 +2770,7 @@ fiber_to_s(VALUE fiber_value)
const rb_proc_t *proc;
char status_info[0x20];
- if (RTEST(fiber->resuming_fiber)) {
+ if (fiber->resuming_fiber) {
snprintf(status_info, 0x20, " (%s by resuming)", fiber_status_name(fiber->status));
}
else {
@@ -3090,7 +3104,7 @@ Init_Cont(void)
rb_define_method(rb_cFiber, "initialize", rb_fiber_initialize, -1);
rb_define_method(rb_cFiber, "blocking?", rb_fiber_blocking_p, 0);
rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
- rb_define_method(rb_cFiber, "raise", rb_fiber_raise, -1);
+ rb_define_method(rb_cFiber, "raise", rb_fiber_m_raise, -1);
rb_define_method(rb_cFiber, "backtrace", rb_fiber_backtrace, -1);
rb_define_method(rb_cFiber, "backtrace_locations", rb_fiber_backtrace_locations, -1);
rb_define_method(rb_cFiber, "to_s", fiber_to_s, 0);
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 095d9d8d1e..b13c3d9c8a 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -16,6 +16,9 @@ else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
VPATH := $(VPATH):$(srcdir)/win32
+ ifneq ($(filter -flto%,$(LDFLAGS)),)
+ miniruby$(EXEEXT): XLDFLAGS += -Wno-maybe-uninitialized
+ endif
endif
ifneq ($(ENABLE_SHARED),yes)
diff --git a/debug.c b/debug.c
index 75d4cc6569..52bd0f7fb7 100644
--- a/debug.c
+++ b/debug.c
@@ -14,9 +14,9 @@
#include <stdio.h>
#include "eval_intern.h"
+#include "encindex.h"
#include "id.h"
#include "internal/signal.h"
-#include "internal/util.h"
#include "ruby/encoding.h"
#include "ruby/io.h"
#include "ruby/ruby.h"
@@ -51,6 +51,7 @@ const union {
enum ruby_coderange_type enc_coderange_types;
enum ruby_econv_flag_type econv_flag_types;
rb_econv_result_t econv_result;
+ enum ruby_preserved_encindex encoding_index;
enum ruby_robject_flags robject_flags;
enum ruby_robject_consts robject_consts;
enum ruby_rmodule_flags rmodule_flags;
diff --git a/defs/gmake.mk b/defs/gmake.mk
index dc749b8d8a..e533396bae 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -6,6 +6,11 @@ override mflags := $(filter-out -j%,$(MFLAGS))
MSPECOPT += $(if $(filter -j%,$(MFLAGS)),-j)
nproc = $(subst -j,,$(filter -j%,$(MFLAGS)))
+ifeq ($(GITHUB_ACTIONS),true)
+override ACTIONS_GROUP = @echo "\#\#[group]$(@:yes-=)"
+override ACTIONS_ENDGROUP = @echo "\#\#[endgroup]"
+endif
+
ifneq ($(filter %darwin%,$(arch)),)
INSTRUBY_ENV += SDKROOT=/
endif
@@ -101,12 +106,16 @@ yes-test-bundler-parallel: PARALLELRSPECOPTS += $(if $(nproc),-n$(shell expr $(n
# Cross reference needs to parse all files at once
love install reinstall: RDOCFLAGS = --force-update
+ifneq ($(if $(filter -flto%,$(CFLAGS)),$(subst darwin,,$(arch)),$(arch)),$(arch))
+override EXE_LDFLAGS = $(filter-out -g%,$(LDFLAGS))
+endif
+
$(srcdir)/missing/des_tables.c: $(srcdir)/missing/crypt.c
ifeq ($(if $(filter yes,$(CROSS_COMPILING)),,$(CC)),)
touch $@
else
@$(ECHO) building make_des_table
- $(CC) $(INCFLAGS) $(CPPFLAGS) -DDUMP $(LDFLAGS) $(XLDFLAGS) $(LIBS) -omake_des_table $(srcdir)/missing/crypt.c
+ $(CC) $(INCFLAGS) $(CPPFLAGS) -DDUMP $(EXE_LDFLAGS) $(XLDFLAGS) $(LIBS) -omake_des_table $(srcdir)/missing/crypt.c
@[ -x ./make_des_table ]
@$(ECHO) generating $@
$(Q) $(MAKEDIRS) $(@D)
@@ -135,7 +144,7 @@ $(STUBPROGRAM): rubystub.$(OBJEXT) $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SE
rubystub$(EXEEXT):
@rm -f $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) rubystub.$(OBJEXT) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) rubystub.$(OBJEXT) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
$(Q) $(POSTLINK)
$(if $(STRIP),$(Q) $(STRIP) $@)
@@ -351,8 +360,12 @@ spec/bundler/%: PHONY
spec/bundler: test-bundler-parallel
$(Q)$(NULLCMD)
-spec/%: programs exts PHONY
- $(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec-run -B $(srcdir)/spec/default.mspec $(SPECOPTS) $(patsubst %,$(srcdir)/%,$@)
+# workaround to avoid matching non ruby files with "spec/%/" under GNU make 3.81
+spec/%_spec.c spec/%_spec.$(DLEXT):
+ $(empty)
+
+spec/%/ spec/%_spec.rb: programs exts PHONY
+ +$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec-run -B $(srcdir)/spec/default.mspec $(SPECOPTS) $(patsubst %,$(srcdir)/%,$@)
benchmark/%: miniruby$(EXEEXT) update-benchmark-driver PHONY
$(Q)$(BASERUBY) -rrubygems -I$(srcdir)/benchmark/lib $(srcdir)/benchmark/benchmark-driver/exe/benchmark-driver \
@@ -391,11 +404,15 @@ update-deps:
# order-only-prerequisites doesn't work for $(RUBYSPEC_CAPIEXT)
# because the same named directory exists in the source tree.
-$(RUBYSPEC_CAPIEXT)/%.$(DLEXT): $(srcdir)/$(RUBYSPEC_CAPIEXT)/%.c $(srcdir)/$(RUBYSPEC_CAPIEXT)/rubyspec.h $(RUBY_H_INCLUDES) $(LIBRUBY_SO)
+$(RUBYSPEC_CAPIEXT)/%.$(DLEXT): $(srcdir)/$(RUBYSPEC_CAPIEXT)/%.c $(srcdir)/$(RUBYSPEC_CAPIEXT)/rubyspec.h $(RUBY_H_INCLUDES) $(LIBRUBY)
$(ECHO) building $@
$(Q) $(MAKEDIRS) $(@D)
- $(Q) $(DLDSHARED) $(XDLDFLAGS) $(XLDFLAGS) $(ARCH_FLAG) $(ARCH_FLAG) $(CFLAGS) $(INCFLAGS) $(CPPFLAGS) $(OUTFLAG)$@ $< $(LIBRUBY_SO)
+ $(Q) $(DLDSHARED) $(XDLDFLAGS) $(XLDFLAGS) $(LDFLAGS) $(INCFLAGS) $(CPPFLAGS) $(OUTFLAG)$@ $< $(LIBRUBYARG)
$(Q) $(RMALL) $@.*
rubyspec-capiext: $(patsubst %.c,$(RUBYSPEC_CAPIEXT)/%.$(DLEXT),$(notdir $(wildcard $(srcdir)/$(RUBYSPEC_CAPIEXT)/*.c)))
@ $(NULLCMD)
+
+ifeq ($(ENABLE_SHARED),yes)
+exts: rubyspec-capiext
+endif
diff --git a/defs/id.def b/defs/id.def
index 506dc95050..8df6cf12e2 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -87,6 +87,7 @@ firstline, predefined = __LINE__+1, %[\
core#hash_merge_ptr
core#hash_merge_kwd
core#raise
+ core#sprintf
- debug#created_info
diff --git a/dir.c b/dir.c
index 8ac10d2360..4e552d772a 100644
--- a/dir.c
+++ b/dir.c
@@ -989,7 +989,7 @@ chdir_yield(VALUE v)
dir_chdir(args->new_path);
args->done = TRUE;
chdir_blocking++;
- if (chdir_thread == Qnil)
+ if (NIL_P(chdir_thread))
chdir_thread = rb_thread_current();
return rb_yield(args->new_path);
}
@@ -1429,7 +1429,7 @@ with_gvl_gc_for_fd(void *ptr)
{
int *e = ptr;
- return (void *)(rb_gc_for_fd(*e) ? Qtrue : Qfalse);
+ return (void *)RBOOL(rb_gc_for_fd(*e));
}
static int
@@ -1438,7 +1438,7 @@ gc_for_fd_with_gvl(int e)
if (vm_initialized)
return (int)(VALUE)rb_thread_call_with_gvl(with_gvl_gc_for_fd, &e);
else
- return rb_gc_for_fd(e) ? Qtrue : Qfalse;
+ return RBOOL(rb_gc_for_fd(e));
}
static void *
diff --git a/dir.rb b/dir.rb
index 4d27b0093e..a6768939d4 100644
--- a/dir.rb
+++ b/dir.rb
@@ -9,7 +9,13 @@
#
# == What's Here
#
-# \Class \Dir provides methods that are useful for:
+# First, what's elsewhere. \Class \Dir:
+#
+# - Inherits from {class Object}[Object.html#class-Object-label-What-27s+Here].
+# - Includes {module Enumerable}[Enumerable.html#module-Enumerable-label-What-27s+Here],
+# which provides dozens of additional methods.
+#
+# Here, class \Dir provides methods that are useful for:
#
# - {Reading}[#class-Dir-label-Reading]
# - {Setting}[#class-Dir-label-Setting]
@@ -224,13 +230,13 @@ class << File
# Matches any file. Can be restricted by other values in the glob.
# Equivalent to <code>/.*/x</code> in regexp.
#
- # <code>*</code>:: Matches all files regular files
+ # <code>*</code>:: Matches all regular files
# <code>c*</code>:: Matches all files beginning with <code>c</code>
# <code>*c</code>:: Matches all files ending with <code>c</code>
# <code>\*c*</code>:: Matches all files that have <code>c</code> in them
# (including at the beginning or end).
#
- # To match hidden files (that start with a <code>.</code> set the
+ # To match hidden files (that start with a <code>.</code>) set the
# File::FNM_DOTMATCH flag.
#
# <code>**</code>::
diff --git a/dln.c b/dln.c
index ac09430492..7d0447db6c 100644
--- a/dln.c
+++ b/dln.c
@@ -23,6 +23,7 @@ static void dln_loaderror(const char *format, ...);
#endif
#include "dln.h"
#include "internal.h"
+#include "internal/compilers.h"
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
diff --git a/doc/NEWS-3.0.0.md b/doc/NEWS-3.0.0.md
index 6ec5a09d79..00c26fe585 100644
--- a/doc/NEWS-3.0.0.md
+++ b/doc/NEWS-3.0.0.md
@@ -86,7 +86,7 @@ Note that each entry is kept to a minimum, see links for details.
`# frozen-string-literal: true` is used. [[Feature #17104]]
* Magic comment `shareable_constant_value` added to freeze constants.
- See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
+ See {Magic Comments}[rdoc-ref:syntax/comments.rdoc@Magic+Comments] for more details.
[[Feature #17273]]
* A {static analysis}[rdoc-label:label-Static+analysis] foundation is
diff --git a/doc/bsearch.rdoc b/doc/bsearch.rdoc
new file mode 100644
index 0000000000..ca8091fc0d
--- /dev/null
+++ b/doc/bsearch.rdoc
@@ -0,0 +1,120 @@
+== Binary Searching
+
+A few Ruby methods support binary searching in a collection:
+
+Array#bsearch:: Returns an element selected via a binary search
+ as determined by a given block.
+Array#bsearch_index:: Returns the index of an element selected via a binary search
+ as determined by a given block.
+Range#bsearch:: Returns an element selected via a binary search
+ as determined by a given block.
+
+Each of these methods returns an enumerator if no block is given.
+
+Given a block, each of these methods returns an element (or element index) from +self+
+as determined by a binary search.
+The search finds an element of +self+ which meets
+the given condition in <tt>O(log n)</tt> operations, where +n+ is the count of elements.
++self+ should be sorted, but this is not checked.
+
+There are two search modes:
+
+Find-minimum mode:: method +bsearch+ returns the first element for which
+ the block returns +true+;
+ the block must return +true+ or +false+.
+Find-any mode:: method +bsearch+ some element, if any, for which
+ the block returns zero.
+ the block must return a numeric value.
+
+The block should not mix the modes by sometimes returning +true+ or +false+
+and other times returning a numeric value, but this is not checked.
+
+<b>Find-Minimum Mode</b>
+
+In find-minimum mode, the block must return +true+ or +false+.
+The further requirement (though not checked) is that
+there are no indexes +i+ and +j+ such that:
+
+- <tt>0 <= i < j <= self.size</tt>.
+- The block returns +true+ for <tt>self[i]</tt> and +false+ for <tt>self[j]</tt>.
+
+Less formally: the block is such that all +false+-evaluating elements
+precede all +true+-evaluating elements.
+
+In find-minimum mode, method +bsearch+ returns the first element
+for which the block returns +true+.
+
+Examples:
+
+ a = [0, 4, 7, 10, 12]
+ a.bsearch {|x| x >= 4 } # => 4
+ a.bsearch {|x| x >= 6 } # => 7
+ a.bsearch {|x| x >= -1 } # => 0
+ a.bsearch {|x| x >= 100 } # => nil
+
+ r = (0...a.size)
+ r.bsearch {|i| a[i] >= 4 } #=> 1
+ r.bsearch {|i| a[i] >= 6 } #=> 2
+ r.bsearch {|i| a[i] >= 8 } #=> 3
+ r.bsearch {|i| a[i] >= 100 } #=> nil
+ r = (0.0...Float::INFINITY)
+ r.bsearch {|x| Math.log(x) >= 0 } #=> 1.0
+
+These blocks make sense in find-minimum mode:
+
+ a = [0, 4, 7, 10, 12]
+ a.map {|x| x >= 4 } # => [false, true, true, true, true]
+ a.map {|x| x >= 6 } # => [false, false, true, true, true]
+ a.map {|x| x >= -1 } # => [true, true, true, true, true]
+ a.map {|x| x >= 100 } # => [false, false, false, false, false]
+
+This would not make sense:
+
+ a.map {|x| x == 7 } # => [false, false, true, false, false]
+
+<b>Find-Any Mode</b>
+
+In find-any mode, the block must return a numeric value.
+The further requirement (though not checked) is that
+there are no indexes +i+ and +j+ such that:
+
+- <tt>0 <= i < j <= self.size</tt>.
+- The block returns a negative value for <tt>self[i]</tt>
+ and a positive value for <tt>self[j]</tt>.
+- The block returns a negative value for <tt>self[i]</tt> and zero <tt>self[j]</tt>.
+- The block returns zero for <tt>self[i]</tt> and a positive value for <tt>self[j]</tt>.
+
+Less formally: the block is such that:
+
+- All positive-evaluating elements precede all zero-evaluating elements.
+- All positive-evaluating elements precede all negative-evaluating elements.
+- All zero-evaluating elements precede all negative-evaluating elements.
+
+In find-any mode, method +bsearch+ returns some element
+for which the block returns zero, or +nil+ if no such element is found.
+
+Examples:
+
+ a = [0, 4, 7, 10, 12]
+ a.bsearch {|element| 7 <=> element } # => 7
+ a.bsearch {|element| -1 <=> element } # => nil
+ a.bsearch {|element| 5 <=> element } # => nil
+ a.bsearch {|element| 15 <=> element } # => nil
+
+ a = [0, 100, 100, 100, 200]
+ r = (0..4)
+ r.bsearch {|i| 100 - a[i] } #=> 1, 2 or 3
+ r.bsearch {|i| 300 - a[i] } #=> nil
+ r.bsearch {|i| 50 - a[i] } #=> nil
+
+These blocks make sense in find-any mode:
+
+ a = [0, 4, 7, 10, 12]
+ a.map {|element| 7 <=> element } # => [1, 1, 0, -1, -1]
+ a.map {|element| -1 <=> element } # => [-1, -1, -1, -1, -1]
+ a.map {|element| 5 <=> element } # => [1, 1, -1, -1, -1]
+ a.map {|element| 15 <=> element } # => [1, 1, 1, 1, 1]
+
+This would not make sense:
+
+ a.map {|element| element <=> 7 } # => [-1, -1, 0, 1, 1]
diff --git a/doc/contributing.rdoc b/doc/contributing.rdoc
index d7395627ca..00875d1428 100644
--- a/doc/contributing.rdoc
+++ b/doc/contributing.rdoc
@@ -59,32 +59,6 @@ You can report downstream issues for the following distributions via their bug t
* {macports}[https://trac.macports.org/query?status=assigned&status=new&status=reopened&port=~ruby]
* etc (add your distribution bug tracker here)
-=== Platform Maintainers
-
-For platform specific bugs in Ruby, you can assign your ticket to the current
-maintainer for a specific platform.
-
-The current active platform maintainers are as follows:
-
-[mswin64 (Microsoft Windows)]
- NAKAMURA Usaku (usa)
-[mingw32 (Minimalist GNU for Windows)]
- Nobuyoshi Nakada (nobu)
-[AIX]
- Yutaka Kanemoto (kanemoto)
-[FreeBSD]
- Akinori MUSHA (knu)
-[Solaris]
- Naohisa Goto (ngoto)
-[RHEL, CentOS]
- KOSAKI Motohiro (kosaki)
-[macOS]
- Kenta Murata (mrkn)
-[OpenBSD]
- Jeremy Evans (jeremyevans0)
-[cygwin, ...]
- none. (Maintainer WANTED)
-
== Reporting Security Issues
Security vulnerabilities receive special treatment since they may negatively
@@ -265,7 +239,7 @@ Now let's build CRuby:
* Generate the configuration files and build:
cd ruby-master
- autoconf
+ ./autogen.sh
mkdir build && cd build # its good practice to build outside of source dir
mkdir ~/.rubies # we will install to .rubies/ruby-master in our home dir
../configure --prefix="${HOME}/.rubies/ruby-master"
diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc
index a6f7719792..5087b6785a 100644
--- a/doc/extension.ja.rdoc
+++ b/doc/extension.ja.rdoc
@@ -697,30 +697,28 @@ Cの世界で定義されたデータ(構造体)をRubyのオブジェクトと
このマクロの戻り値は生成されたオブジェクトを表すVALUE値です.
-klassはこのオブジェクトのクラスです.data_typeはこの構造体を
-Rubyが管理するための情報を記述したconst rb_data_type_t型への
-ポインタです.
+klassはこのオブジェクトのクラスです.klassは, Objectクラスか
+ら派生し, 必ずrb_define_alloc_funcかrb_undef_alloc_funcを呼
+び出してallocatorを設定してください.
-なお, klassは, Objectや他のクラスではなくData (rb_cData)とい
-う特別なクラスから派生することが推奨されます.
-Dataから派生しない場合には, 必ずrb_undef_alloc_func(klass)
-を呼び出してください.
+data_typeはこの構造体をRubyが管理するための情報を記述した
+const rb_data_type_t型へのポインタです.
rb_data_type_tは次のように定義されています.
typedef struct rb_data_type_struct rb_data_type_t;
struct rb_data_type_struct {
- const char *wrap_struct_name;
- struct {
- void (*dmark)(void*);
- void (*dfree)(void*);
- size_t (*dsize)(const void *);
- void *reserved[2];
- } function;
- const rb_data_type_t *parent;
- void *data;
- VALUE flags;
+ const char *wrap_struct_name;
+ struct {
+ void (*dmark)(void*);
+ void (*dfree)(void*);
+ size_t (*dsize)(const void *);
+ void *reserved[2];
+ } function;
+ const rb_data_type_t *parent;
+ void *data;
+ VALUE flags;
};
wrap_struct_nameはこの構造体を識別する名前です.主に統計情報
@@ -743,8 +741,8 @@ dmarkはガーベージコレクタがオブジェクトへの参照をマーク
++
dfreeはこの構造体がもう不要になった時に呼ばれる関数です.こ
-の関数がガーベージコレクタから呼ばれます.これが-1の場合は,
-単純に構造体が解放されます.
+の関数がガーベージコレクタから呼ばれます.これが
+RUBY_DEFAULT_FREEの場合は,単純に構造体が解放されます.
dsizeは構造体が消費しているメモリのバイト数を返す関数です.
引数として構造体へのポインタが渡されます.実装困難であれば0
diff --git a/doc/extension.rdoc b/doc/extension.rdoc
index f8e0a1ec3d..a1ad930d7e 100644
--- a/doc/extension.rdoc
+++ b/doc/extension.rdoc
@@ -657,8 +657,10 @@ with the next macro.
TypedData_Wrap_Struct() returns a created Ruby object as a VALUE.
-The klass argument is the class for the object. It is recommended
-that klass derives from rb_cObject.
+The klass argument is the class for the object. The klass should
+derive from rb_cObject, and the allocator must be set by calling
+rb_define_alloc_func or rb_undef_alloc_func.
+
data_type is a pointer to a const rb_data_type_t which describes
how Ruby should manage the struct.
@@ -668,17 +670,17 @@ member of the struct.
typedef struct rb_data_type_struct rb_data_type_t;
struct rb_data_type_struct {
- const char *wrap_struct_name;
- struct {
- void (*dmark)(void*);
- void (*dfree)(void*);
- size_t (*dsize)(const void *);
- void (*dcompact)(void*);
- void *reserved[1];
- } function;
- const rb_data_type_t *parent;
- void *data;
- VALUE flags;
+ const char *wrap_struct_name;
+ struct {
+ void (*dmark)(void*);
+ void (*dfree)(void*);
+ size_t (*dsize)(const void *);
+ void (*dcompact)(void*);
+ void *reserved[1];
+ } function;
+ const rb_data_type_t *parent;
+ void *data;
+ VALUE flags;
};
wrap_struct_name is an identifier of this instance of the struct.
@@ -699,7 +701,7 @@ Note that it is recommended to avoid such a reference.
++
dfree is a function to free the pointer allocation.
-If this is -1, the pointer will be just freed.
+If this is RUBY_DEFAULT_FREE, the pointer will be just freed.
dsize calculates memory consumption in bytes by the struct.
Its parameter is a pointer to your struct.
diff --git a/doc/irb/irb.rd.ja b/doc/irb/irb.rd.ja
index 9d03651a8e..633c08cbd4 100644
--- a/doc/irb/irb.rd.ja
+++ b/doc/irb/irb.rd.ja
@@ -51,6 +51,12 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
オブジェクトの作成方法を 0 から 3 のいずれかに設定する.
--echo 実行結果を表示する(デフォルト).
--noecho 実行結果を表示しない.
+ --echo-on-assignment
+ 代入時に実行結果を表示する.
+ --noecho-on-assignment
+ 代入時に実行結果を表示しない.
+ --truncate-echo-on-assignment
+ 代入時に省略された実行結果を表示する(デフォルト).
--inspect 結果出力にinspectを用いる.
--noinspect 結果出力にinspectを用いない.
--singleline シングルラインエディタを利用する.
@@ -59,7 +65,10 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
用しようとする.
--colorize 色付けを利用する.
--nocolorize 色付けを利用しない.
- --prompt prompt-mode/--prompt-mode prompt-mode
+ --autocomplete オートコンプリートを利用する.
+ --noautocomplete オートコンプリートを利用しない.
+ --prompt prompt-mode
+ --prompt-mode prompt-mode
プロンプトモードを切替えます. 現在定義されているプ
ロンプトモードは, default, simple, xmp, inf-rubyが
用意されています.
diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc
index dc893ecdf1..b56a3d887f 100644
--- a/doc/maintainers.rdoc
+++ b/doc/maintainers.rdoc
@@ -391,3 +391,24 @@ Yukihiro Matsumoto (matz)
https://github.com/ruby/rbs
[typeprof]
https://github.com/ruby/typeprof
+
+=== Platform Maintainers
+
+[mswin64 (Microsoft Windows)]
+ NAKAMURA Usaku (usa)
+[mingw32 (Minimalist GNU for Windows)]
+ Nobuyoshi Nakada (nobu)
+[AIX]
+ Yutaka Kanemoto (kanemoto)
+[FreeBSD]
+ Akinori MUSHA (knu)
+[Solaris]
+ Naohisa Goto (ngoto)
+[RHEL, CentOS]
+ KOSAKI Motohiro (kosaki)
+[macOS]
+ Kenta Murata (mrkn)
+[OpenBSD]
+ Jeremy Evans (jeremyevans0)
+[cygwin, ...]
+ none. (Maintainer WANTED)
diff --git a/doc/make_cheatsheet.md b/doc/make_cheatsheet.md
index bf245bea03..6b056a4f0b 100644
--- a/doc/make_cheatsheet.md
+++ b/doc/make_cheatsheet.md
@@ -6,7 +6,7 @@ If you are a user of Ruby, please see README.md.
## In-place build
```
-$ autoconf
+$ ./autogen.sh
$ ./configure --prefix=$PWD/local
$ make
$ make install
@@ -17,7 +17,7 @@ Hello
## Out-of-place build
```
-$ autoconf
+$ ./autogen.sh
$ mkdir ../ruby-build
$ cd ../ruby-build
$ ../ruby-src/configure --prefix=$PWD/local
@@ -100,7 +100,7 @@ $ make test-bundler BUNDLER_SPECS=commands/exec_spec.rb:58
You need to be able to use gcc (gcov) and lcov visualizer.
```
-$ autoconf
+$ ./autogen.sh
$ ./configure --enable-gcov
$ make
$ make update-coverage
diff --git a/doc/marshal.rdoc b/doc/marshal.rdoc
index 78a3d29d4a..abf9467262 100644
--- a/doc/marshal.rdoc
+++ b/doc/marshal.rdoc
@@ -83,7 +83,7 @@ The first byte has the following special values:
of stream objects full precision may be used.
"\xfc"::
- The total size of the integer is two bytes. The following four bytes are a
+ The total size of the integer is five bytes. The following four bytes are a
negative little-endian integer. For compatibility with 32 bit ruby,
only Fixnums greater than -10737341824 should be represented this way. For
sizes of stream objects full precision may be used.
diff --git a/doc/memory_view.md b/doc/memory_view.md
index 646a35423a..a24700d0b1 100644
--- a/doc/memory_view.md
+++ b/doc/memory_view.md
@@ -89,7 +89,7 @@ The MemoryView structure consists of the following members.
A `ndim` size array consisting of the offsets in each dimension when the MemoryView exposes a nested array.
This can be `NULL` when the MemoryView exposes a flat array.
-- `void *const private`
+- `void *private_data`
The private data that MemoryView provider uses internally.
This can be `NULL` when any private data is unnecessary.
diff --git a/doc/ractor.md b/doc/ractor.md
index 1c77f50e36..dd1d44e098 100644
--- a/doc/ractor.md
+++ b/doc/ractor.md
@@ -674,7 +674,7 @@ TABLE = Ractor.make_shareable( {a: 'ko1', b: 'ko2', c: 'ko3'} )
To make it easy, Ruby 3.0 introduced new `shareable_constant_value` Directive.
```ruby
-shareable_constant_value: literal
+# shareable_constant_value: literal
TABLE = {a: 'ko1', b: 'ko2', c: 'ko3'}
#=> Same as: TABLE = Ractor.make_shareable( {a: 'ko1', b: 'ko2', c: 'ko3'} )
diff --git a/doc/syntax/pattern_matching.rdoc b/doc/syntax/pattern_matching.rdoc
index f80703d5c6..b7d614770c 100644
--- a/doc/syntax/pattern_matching.rdoc
+++ b/doc/syntax/pattern_matching.rdoc
@@ -140,7 +140,7 @@ Both array and hash patterns support "rest" specification:
end
#=> "matched"
-In +case+ (but not in <code>=></code> and +in+) expressions, parentheses around both kinds of patterns could be omitted:
+Parentheses around both kinds of patterns could be omitted:
case [1, 2]
in Integer, Integer
@@ -158,6 +158,12 @@ In +case+ (but not in <code>=></code> and +in+) expressions, parentheses around
end
#=> "matched"
+ [1, 2] => a, b
+ [1, 2] in a, b
+
+ {a: 1, b: 2, c: 3} => a:
+ {a: 1, b: 2, c: 3} in a:
+
Find pattern is similar to array pattern but it can be used to check if the given object has any elements that match the pattern:
case ["a", 1, "b", "c", 2]
diff --git a/enc/depend b/enc/depend
index 7034d9c762..bbbf57a473 100644
--- a/enc/depend
+++ b/enc/depend
@@ -181,6 +181,21 @@ clean-srcs:
enc/ascii.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/ascii.$(OBJEXT): $(top_srcdir)/encindex.h
enc/ascii.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/ascii.$(OBJEXT): assert.h
+enc/ascii.$(OBJEXT): backward/2/assume.h
+enc/ascii.$(OBJEXT): backward/2/attributes.h
+enc/ascii.$(OBJEXT): backward/2/bool.h
+enc/ascii.$(OBJEXT): backward/2/gcc_version_since.h
+enc/ascii.$(OBJEXT): backward/2/inttypes.h
+enc/ascii.$(OBJEXT): backward/2/limits.h
+enc/ascii.$(OBJEXT): backward/2/long_long.h
+enc/ascii.$(OBJEXT): backward/2/stdalign.h
+enc/ascii.$(OBJEXT): backward/2/stdarg.h
+enc/ascii.$(OBJEXT): config.h
+enc/ascii.$(OBJEXT): defines.h
+enc/ascii.$(OBJEXT): enc/ascii.c
+enc/ascii.$(OBJEXT): encoding.h
+enc/ascii.$(OBJEXT): intern.h
enc/ascii.$(OBJEXT): internal/anyargs.h
enc/ascii.$(OBJEXT): internal/arithmetic.h
enc/ascii.$(OBJEXT): internal/arithmetic/char.h
@@ -250,6 +265,15 @@ enc/ascii.$(OBJEXT): internal/core/rtypeddata.h
enc/ascii.$(OBJEXT): internal/ctype.h
enc/ascii.$(OBJEXT): internal/dllexport.h
enc/ascii.$(OBJEXT): internal/dosish.h
+enc/ascii.$(OBJEXT): internal/encoding/coderange.h
+enc/ascii.$(OBJEXT): internal/encoding/ctype.h
+enc/ascii.$(OBJEXT): internal/encoding/encoding.h
+enc/ascii.$(OBJEXT): internal/encoding/pathname.h
+enc/ascii.$(OBJEXT): internal/encoding/re.h
+enc/ascii.$(OBJEXT): internal/encoding/sprintf.h
+enc/ascii.$(OBJEXT): internal/encoding/string.h
+enc/ascii.$(OBJEXT): internal/encoding/symbol.h
+enc/ascii.$(OBJEXT): internal/encoding/transcode.h
enc/ascii.$(OBJEXT): internal/error.h
enc/ascii.$(OBJEXT): internal/eval.h
enc/ascii.$(OBJEXT): internal/event.h
@@ -320,27 +344,23 @@ enc/ascii.$(OBJEXT): internal/value_type.h
enc/ascii.$(OBJEXT): internal/variable.h
enc/ascii.$(OBJEXT): internal/warning_push.h
enc/ascii.$(OBJEXT): internal/xmalloc.h
-enc/ascii.$(OBJEXT): assert.h
-enc/ascii.$(OBJEXT): backward/2/assume.h
-enc/ascii.$(OBJEXT): backward/2/attributes.h
-enc/ascii.$(OBJEXT): backward/2/bool.h
-enc/ascii.$(OBJEXT): backward/2/gcc_version_since.h
-enc/ascii.$(OBJEXT): backward/2/inttypes.h
-enc/ascii.$(OBJEXT): backward/2/limits.h
-enc/ascii.$(OBJEXT): backward/2/long_long.h
-enc/ascii.$(OBJEXT): backward/2/stdalign.h
-enc/ascii.$(OBJEXT): backward/2/stdarg.h
-enc/ascii.$(OBJEXT): config.h
-enc/ascii.$(OBJEXT): defines.h
-enc/ascii.$(OBJEXT): enc/ascii.c
-enc/ascii.$(OBJEXT): encoding.h
-enc/ascii.$(OBJEXT): intern.h
enc/ascii.$(OBJEXT): missing.h
enc/ascii.$(OBJEXT): onigmo.h
enc/ascii.$(OBJEXT): oniguruma.h
enc/ascii.$(OBJEXT): st.h
enc/ascii.$(OBJEXT): subst.h
enc/big5.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/big5.$(OBJEXT): assert.h
+enc/big5.$(OBJEXT): backward/2/assume.h
+enc/big5.$(OBJEXT): backward/2/attributes.h
+enc/big5.$(OBJEXT): backward/2/bool.h
+enc/big5.$(OBJEXT): backward/2/gcc_version_since.h
+enc/big5.$(OBJEXT): backward/2/long_long.h
+enc/big5.$(OBJEXT): backward/2/stdalign.h
+enc/big5.$(OBJEXT): backward/2/stdarg.h
+enc/big5.$(OBJEXT): config.h
+enc/big5.$(OBJEXT): defines.h
+enc/big5.$(OBJEXT): enc/big5.c
enc/big5.$(OBJEXT): internal/assume.h
enc/big5.$(OBJEXT): internal/attr/alloc_size.h
enc/big5.$(OBJEXT): internal/attr/cold.h
@@ -383,22 +403,27 @@ enc/big5.$(OBJEXT): internal/stdalign.h
enc/big5.$(OBJEXT): internal/stdbool.h
enc/big5.$(OBJEXT): internal/warning_push.h
enc/big5.$(OBJEXT): internal/xmalloc.h
-enc/big5.$(OBJEXT): assert.h
-enc/big5.$(OBJEXT): backward/2/assume.h
-enc/big5.$(OBJEXT): backward/2/attributes.h
-enc/big5.$(OBJEXT): backward/2/bool.h
-enc/big5.$(OBJEXT): backward/2/gcc_version_since.h
-enc/big5.$(OBJEXT): backward/2/long_long.h
-enc/big5.$(OBJEXT): backward/2/stdalign.h
-enc/big5.$(OBJEXT): backward/2/stdarg.h
-enc/big5.$(OBJEXT): config.h
-enc/big5.$(OBJEXT): defines.h
-enc/big5.$(OBJEXT): enc/big5.c
enc/big5.$(OBJEXT): missing.h
enc/big5.$(OBJEXT): onigmo.h
enc/cesu_8.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/cesu_8.$(OBJEXT): $(top_srcdir)/encindex.h
enc/cesu_8.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/cesu_8.$(OBJEXT): assert.h
+enc/cesu_8.$(OBJEXT): backward.h
+enc/cesu_8.$(OBJEXT): backward/2/assume.h
+enc/cesu_8.$(OBJEXT): backward/2/attributes.h
+enc/cesu_8.$(OBJEXT): backward/2/bool.h
+enc/cesu_8.$(OBJEXT): backward/2/gcc_version_since.h
+enc/cesu_8.$(OBJEXT): backward/2/inttypes.h
+enc/cesu_8.$(OBJEXT): backward/2/limits.h
+enc/cesu_8.$(OBJEXT): backward/2/long_long.h
+enc/cesu_8.$(OBJEXT): backward/2/stdalign.h
+enc/cesu_8.$(OBJEXT): backward/2/stdarg.h
+enc/cesu_8.$(OBJEXT): config.h
+enc/cesu_8.$(OBJEXT): defines.h
+enc/cesu_8.$(OBJEXT): enc/cesu_8.c
+enc/cesu_8.$(OBJEXT): encoding.h
+enc/cesu_8.$(OBJEXT): intern.h
enc/cesu_8.$(OBJEXT): internal/anyargs.h
enc/cesu_8.$(OBJEXT): internal/arithmetic.h
enc/cesu_8.$(OBJEXT): internal/arithmetic/char.h
@@ -468,6 +493,15 @@ enc/cesu_8.$(OBJEXT): internal/core/rtypeddata.h
enc/cesu_8.$(OBJEXT): internal/ctype.h
enc/cesu_8.$(OBJEXT): internal/dllexport.h
enc/cesu_8.$(OBJEXT): internal/dosish.h
+enc/cesu_8.$(OBJEXT): internal/encoding/coderange.h
+enc/cesu_8.$(OBJEXT): internal/encoding/ctype.h
+enc/cesu_8.$(OBJEXT): internal/encoding/encoding.h
+enc/cesu_8.$(OBJEXT): internal/encoding/pathname.h
+enc/cesu_8.$(OBJEXT): internal/encoding/re.h
+enc/cesu_8.$(OBJEXT): internal/encoding/sprintf.h
+enc/cesu_8.$(OBJEXT): internal/encoding/string.h
+enc/cesu_8.$(OBJEXT): internal/encoding/symbol.h
+enc/cesu_8.$(OBJEXT): internal/encoding/transcode.h
enc/cesu_8.$(OBJEXT): internal/error.h
enc/cesu_8.$(OBJEXT): internal/eval.h
enc/cesu_8.$(OBJEXT): internal/event.h
@@ -538,28 +572,23 @@ enc/cesu_8.$(OBJEXT): internal/value_type.h
enc/cesu_8.$(OBJEXT): internal/variable.h
enc/cesu_8.$(OBJEXT): internal/warning_push.h
enc/cesu_8.$(OBJEXT): internal/xmalloc.h
-enc/cesu_8.$(OBJEXT): assert.h
-enc/cesu_8.$(OBJEXT): backward.h
-enc/cesu_8.$(OBJEXT): backward/2/assume.h
-enc/cesu_8.$(OBJEXT): backward/2/attributes.h
-enc/cesu_8.$(OBJEXT): backward/2/bool.h
-enc/cesu_8.$(OBJEXT): backward/2/gcc_version_since.h
-enc/cesu_8.$(OBJEXT): backward/2/inttypes.h
-enc/cesu_8.$(OBJEXT): backward/2/limits.h
-enc/cesu_8.$(OBJEXT): backward/2/long_long.h
-enc/cesu_8.$(OBJEXT): backward/2/stdalign.h
-enc/cesu_8.$(OBJEXT): backward/2/stdarg.h
-enc/cesu_8.$(OBJEXT): config.h
-enc/cesu_8.$(OBJEXT): defines.h
-enc/cesu_8.$(OBJEXT): enc/cesu_8.c
-enc/cesu_8.$(OBJEXT): encoding.h
-enc/cesu_8.$(OBJEXT): intern.h
enc/cesu_8.$(OBJEXT): missing.h
enc/cesu_8.$(OBJEXT): onigmo.h
enc/cesu_8.$(OBJEXT): oniguruma.h
enc/cesu_8.$(OBJEXT): st.h
enc/cesu_8.$(OBJEXT): subst.h
enc/cp949.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/cp949.$(OBJEXT): assert.h
+enc/cp949.$(OBJEXT): backward/2/assume.h
+enc/cp949.$(OBJEXT): backward/2/attributes.h
+enc/cp949.$(OBJEXT): backward/2/bool.h
+enc/cp949.$(OBJEXT): backward/2/gcc_version_since.h
+enc/cp949.$(OBJEXT): backward/2/long_long.h
+enc/cp949.$(OBJEXT): backward/2/stdalign.h
+enc/cp949.$(OBJEXT): backward/2/stdarg.h
+enc/cp949.$(OBJEXT): config.h
+enc/cp949.$(OBJEXT): defines.h
+enc/cp949.$(OBJEXT): enc/cp949.c
enc/cp949.$(OBJEXT): internal/assume.h
enc/cp949.$(OBJEXT): internal/attr/alloc_size.h
enc/cp949.$(OBJEXT): internal/attr/cold.h
@@ -602,20 +631,20 @@ enc/cp949.$(OBJEXT): internal/stdalign.h
enc/cp949.$(OBJEXT): internal/stdbool.h
enc/cp949.$(OBJEXT): internal/warning_push.h
enc/cp949.$(OBJEXT): internal/xmalloc.h
-enc/cp949.$(OBJEXT): assert.h
-enc/cp949.$(OBJEXT): backward/2/assume.h
-enc/cp949.$(OBJEXT): backward/2/attributes.h
-enc/cp949.$(OBJEXT): backward/2/bool.h
-enc/cp949.$(OBJEXT): backward/2/gcc_version_since.h
-enc/cp949.$(OBJEXT): backward/2/long_long.h
-enc/cp949.$(OBJEXT): backward/2/stdalign.h
-enc/cp949.$(OBJEXT): backward/2/stdarg.h
-enc/cp949.$(OBJEXT): config.h
-enc/cp949.$(OBJEXT): defines.h
-enc/cp949.$(OBJEXT): enc/cp949.c
enc/cp949.$(OBJEXT): missing.h
enc/cp949.$(OBJEXT): onigmo.h
enc/emacs_mule.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/emacs_mule.$(OBJEXT): assert.h
+enc/emacs_mule.$(OBJEXT): backward/2/assume.h
+enc/emacs_mule.$(OBJEXT): backward/2/attributes.h
+enc/emacs_mule.$(OBJEXT): backward/2/bool.h
+enc/emacs_mule.$(OBJEXT): backward/2/gcc_version_since.h
+enc/emacs_mule.$(OBJEXT): backward/2/long_long.h
+enc/emacs_mule.$(OBJEXT): backward/2/stdalign.h
+enc/emacs_mule.$(OBJEXT): backward/2/stdarg.h
+enc/emacs_mule.$(OBJEXT): config.h
+enc/emacs_mule.$(OBJEXT): defines.h
+enc/emacs_mule.$(OBJEXT): enc/emacs_mule.c
enc/emacs_mule.$(OBJEXT): internal/assume.h
enc/emacs_mule.$(OBJEXT): internal/attr/alloc_size.h
enc/emacs_mule.$(OBJEXT): internal/attr/cold.h
@@ -658,23 +687,29 @@ enc/emacs_mule.$(OBJEXT): internal/stdalign.h
enc/emacs_mule.$(OBJEXT): internal/stdbool.h
enc/emacs_mule.$(OBJEXT): internal/warning_push.h
enc/emacs_mule.$(OBJEXT): internal/xmalloc.h
-enc/emacs_mule.$(OBJEXT): assert.h
-enc/emacs_mule.$(OBJEXT): backward/2/assume.h
-enc/emacs_mule.$(OBJEXT): backward/2/attributes.h
-enc/emacs_mule.$(OBJEXT): backward/2/bool.h
-enc/emacs_mule.$(OBJEXT): backward/2/gcc_version_since.h
-enc/emacs_mule.$(OBJEXT): backward/2/long_long.h
-enc/emacs_mule.$(OBJEXT): backward/2/stdalign.h
-enc/emacs_mule.$(OBJEXT): backward/2/stdarg.h
-enc/emacs_mule.$(OBJEXT): config.h
-enc/emacs_mule.$(OBJEXT): defines.h
-enc/emacs_mule.$(OBJEXT): enc/emacs_mule.c
enc/emacs_mule.$(OBJEXT): missing.h
enc/emacs_mule.$(OBJEXT): onigmo.h
enc/encdb.$(OBJEXT): $(hdrdir)/ruby.h
enc/encdb.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/encdb.$(OBJEXT): $(top_srcdir)/internal.h
enc/encdb.$(OBJEXT): $(top_srcdir)/internal/encoding.h
+enc/encdb.$(OBJEXT): assert.h
+enc/encdb.$(OBJEXT): backward.h
+enc/encdb.$(OBJEXT): backward/2/assume.h
+enc/encdb.$(OBJEXT): backward/2/attributes.h
+enc/encdb.$(OBJEXT): backward/2/bool.h
+enc/encdb.$(OBJEXT): backward/2/gcc_version_since.h
+enc/encdb.$(OBJEXT): backward/2/inttypes.h
+enc/encdb.$(OBJEXT): backward/2/limits.h
+enc/encdb.$(OBJEXT): backward/2/long_long.h
+enc/encdb.$(OBJEXT): backward/2/stdalign.h
+enc/encdb.$(OBJEXT): backward/2/stdarg.h
+enc/encdb.$(OBJEXT): config.h
+enc/encdb.$(OBJEXT): defines.h
+enc/encdb.$(OBJEXT): enc/encdb.c
+enc/encdb.$(OBJEXT): encdb.h
+enc/encdb.$(OBJEXT): encoding.h
+enc/encdb.$(OBJEXT): intern.h
enc/encdb.$(OBJEXT): internal/anyargs.h
enc/encdb.$(OBJEXT): internal/arithmetic.h
enc/encdb.$(OBJEXT): internal/arithmetic/char.h
@@ -744,6 +779,15 @@ enc/encdb.$(OBJEXT): internal/core/rtypeddata.h
enc/encdb.$(OBJEXT): internal/ctype.h
enc/encdb.$(OBJEXT): internal/dllexport.h
enc/encdb.$(OBJEXT): internal/dosish.h
+enc/encdb.$(OBJEXT): internal/encoding/coderange.h
+enc/encdb.$(OBJEXT): internal/encoding/ctype.h
+enc/encdb.$(OBJEXT): internal/encoding/encoding.h
+enc/encdb.$(OBJEXT): internal/encoding/pathname.h
+enc/encdb.$(OBJEXT): internal/encoding/re.h
+enc/encdb.$(OBJEXT): internal/encoding/sprintf.h
+enc/encdb.$(OBJEXT): internal/encoding/string.h
+enc/encdb.$(OBJEXT): internal/encoding/symbol.h
+enc/encdb.$(OBJEXT): internal/encoding/transcode.h
enc/encdb.$(OBJEXT): internal/error.h
enc/encdb.$(OBJEXT): internal/eval.h
enc/encdb.$(OBJEXT): internal/event.h
@@ -814,29 +858,25 @@ enc/encdb.$(OBJEXT): internal/value_type.h
enc/encdb.$(OBJEXT): internal/variable.h
enc/encdb.$(OBJEXT): internal/warning_push.h
enc/encdb.$(OBJEXT): internal/xmalloc.h
-enc/encdb.$(OBJEXT): assert.h
-enc/encdb.$(OBJEXT): backward.h
-enc/encdb.$(OBJEXT): backward/2/assume.h
-enc/encdb.$(OBJEXT): backward/2/attributes.h
-enc/encdb.$(OBJEXT): backward/2/bool.h
-enc/encdb.$(OBJEXT): backward/2/gcc_version_since.h
-enc/encdb.$(OBJEXT): backward/2/inttypes.h
-enc/encdb.$(OBJEXT): backward/2/limits.h
-enc/encdb.$(OBJEXT): backward/2/long_long.h
-enc/encdb.$(OBJEXT): backward/2/stdalign.h
-enc/encdb.$(OBJEXT): backward/2/stdarg.h
-enc/encdb.$(OBJEXT): config.h
-enc/encdb.$(OBJEXT): defines.h
-enc/encdb.$(OBJEXT): enc/encdb.c
-enc/encdb.$(OBJEXT): encdb.h
-enc/encdb.$(OBJEXT): encoding.h
-enc/encdb.$(OBJEXT): intern.h
enc/encdb.$(OBJEXT): missing.h
enc/encdb.$(OBJEXT): onigmo.h
enc/encdb.$(OBJEXT): oniguruma.h
enc/encdb.$(OBJEXT): st.h
enc/encdb.$(OBJEXT): subst.h
enc/euc_jp.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_jp.$(OBJEXT): assert.h
+enc/euc_jp.$(OBJEXT): backward/2/assume.h
+enc/euc_jp.$(OBJEXT): backward/2/attributes.h
+enc/euc_jp.$(OBJEXT): backward/2/bool.h
+enc/euc_jp.$(OBJEXT): backward/2/gcc_version_since.h
+enc/euc_jp.$(OBJEXT): backward/2/long_long.h
+enc/euc_jp.$(OBJEXT): backward/2/stdalign.h
+enc/euc_jp.$(OBJEXT): backward/2/stdarg.h
+enc/euc_jp.$(OBJEXT): config.h
+enc/euc_jp.$(OBJEXT): defines.h
+enc/euc_jp.$(OBJEXT): enc/euc_jp.c
+enc/euc_jp.$(OBJEXT): enc/jis/props.h
+enc/euc_jp.$(OBJEXT): enc/jis/props.kwd
enc/euc_jp.$(OBJEXT): internal/assume.h
enc/euc_jp.$(OBJEXT): internal/attr/alloc_size.h
enc/euc_jp.$(OBJEXT): internal/attr/cold.h
@@ -879,22 +919,20 @@ enc/euc_jp.$(OBJEXT): internal/stdalign.h
enc/euc_jp.$(OBJEXT): internal/stdbool.h
enc/euc_jp.$(OBJEXT): internal/warning_push.h
enc/euc_jp.$(OBJEXT): internal/xmalloc.h
-enc/euc_jp.$(OBJEXT): assert.h
-enc/euc_jp.$(OBJEXT): backward/2/assume.h
-enc/euc_jp.$(OBJEXT): backward/2/attributes.h
-enc/euc_jp.$(OBJEXT): backward/2/bool.h
-enc/euc_jp.$(OBJEXT): backward/2/gcc_version_since.h
-enc/euc_jp.$(OBJEXT): backward/2/long_long.h
-enc/euc_jp.$(OBJEXT): backward/2/stdalign.h
-enc/euc_jp.$(OBJEXT): backward/2/stdarg.h
-enc/euc_jp.$(OBJEXT): config.h
-enc/euc_jp.$(OBJEXT): defines.h
-enc/euc_jp.$(OBJEXT): enc/euc_jp.c
-enc/euc_jp.$(OBJEXT): enc/jis/props.h
-enc/euc_jp.$(OBJEXT): enc/jis/props.kwd
enc/euc_jp.$(OBJEXT): missing.h
enc/euc_jp.$(OBJEXT): onigmo.h
enc/euc_kr.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_kr.$(OBJEXT): assert.h
+enc/euc_kr.$(OBJEXT): backward/2/assume.h
+enc/euc_kr.$(OBJEXT): backward/2/attributes.h
+enc/euc_kr.$(OBJEXT): backward/2/bool.h
+enc/euc_kr.$(OBJEXT): backward/2/gcc_version_since.h
+enc/euc_kr.$(OBJEXT): backward/2/long_long.h
+enc/euc_kr.$(OBJEXT): backward/2/stdalign.h
+enc/euc_kr.$(OBJEXT): backward/2/stdarg.h
+enc/euc_kr.$(OBJEXT): config.h
+enc/euc_kr.$(OBJEXT): defines.h
+enc/euc_kr.$(OBJEXT): enc/euc_kr.c
enc/euc_kr.$(OBJEXT): internal/assume.h
enc/euc_kr.$(OBJEXT): internal/attr/alloc_size.h
enc/euc_kr.$(OBJEXT): internal/attr/cold.h
@@ -937,20 +975,20 @@ enc/euc_kr.$(OBJEXT): internal/stdalign.h
enc/euc_kr.$(OBJEXT): internal/stdbool.h
enc/euc_kr.$(OBJEXT): internal/warning_push.h
enc/euc_kr.$(OBJEXT): internal/xmalloc.h
-enc/euc_kr.$(OBJEXT): assert.h
-enc/euc_kr.$(OBJEXT): backward/2/assume.h
-enc/euc_kr.$(OBJEXT): backward/2/attributes.h
-enc/euc_kr.$(OBJEXT): backward/2/bool.h
-enc/euc_kr.$(OBJEXT): backward/2/gcc_version_since.h
-enc/euc_kr.$(OBJEXT): backward/2/long_long.h
-enc/euc_kr.$(OBJEXT): backward/2/stdalign.h
-enc/euc_kr.$(OBJEXT): backward/2/stdarg.h
-enc/euc_kr.$(OBJEXT): config.h
-enc/euc_kr.$(OBJEXT): defines.h
-enc/euc_kr.$(OBJEXT): enc/euc_kr.c
enc/euc_kr.$(OBJEXT): missing.h
enc/euc_kr.$(OBJEXT): onigmo.h
enc/euc_tw.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_tw.$(OBJEXT): assert.h
+enc/euc_tw.$(OBJEXT): backward/2/assume.h
+enc/euc_tw.$(OBJEXT): backward/2/attributes.h
+enc/euc_tw.$(OBJEXT): backward/2/bool.h
+enc/euc_tw.$(OBJEXT): backward/2/gcc_version_since.h
+enc/euc_tw.$(OBJEXT): backward/2/long_long.h
+enc/euc_tw.$(OBJEXT): backward/2/stdalign.h
+enc/euc_tw.$(OBJEXT): backward/2/stdarg.h
+enc/euc_tw.$(OBJEXT): config.h
+enc/euc_tw.$(OBJEXT): defines.h
+enc/euc_tw.$(OBJEXT): enc/euc_tw.c
enc/euc_tw.$(OBJEXT): internal/assume.h
enc/euc_tw.$(OBJEXT): internal/attr/alloc_size.h
enc/euc_tw.$(OBJEXT): internal/attr/cold.h
@@ -993,20 +1031,20 @@ enc/euc_tw.$(OBJEXT): internal/stdalign.h
enc/euc_tw.$(OBJEXT): internal/stdbool.h
enc/euc_tw.$(OBJEXT): internal/warning_push.h
enc/euc_tw.$(OBJEXT): internal/xmalloc.h
-enc/euc_tw.$(OBJEXT): assert.h
-enc/euc_tw.$(OBJEXT): backward/2/assume.h
-enc/euc_tw.$(OBJEXT): backward/2/attributes.h
-enc/euc_tw.$(OBJEXT): backward/2/bool.h
-enc/euc_tw.$(OBJEXT): backward/2/gcc_version_since.h
-enc/euc_tw.$(OBJEXT): backward/2/long_long.h
-enc/euc_tw.$(OBJEXT): backward/2/stdalign.h
-enc/euc_tw.$(OBJEXT): backward/2/stdarg.h
-enc/euc_tw.$(OBJEXT): config.h
-enc/euc_tw.$(OBJEXT): defines.h
-enc/euc_tw.$(OBJEXT): enc/euc_tw.c
enc/euc_tw.$(OBJEXT): missing.h
enc/euc_tw.$(OBJEXT): onigmo.h
enc/gb18030.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/gb18030.$(OBJEXT): assert.h
+enc/gb18030.$(OBJEXT): backward/2/assume.h
+enc/gb18030.$(OBJEXT): backward/2/attributes.h
+enc/gb18030.$(OBJEXT): backward/2/bool.h
+enc/gb18030.$(OBJEXT): backward/2/gcc_version_since.h
+enc/gb18030.$(OBJEXT): backward/2/long_long.h
+enc/gb18030.$(OBJEXT): backward/2/stdalign.h
+enc/gb18030.$(OBJEXT): backward/2/stdarg.h
+enc/gb18030.$(OBJEXT): config.h
+enc/gb18030.$(OBJEXT): defines.h
+enc/gb18030.$(OBJEXT): enc/gb18030.c
enc/gb18030.$(OBJEXT): internal/assume.h
enc/gb18030.$(OBJEXT): internal/attr/alloc_size.h
enc/gb18030.$(OBJEXT): internal/attr/cold.h
@@ -1049,20 +1087,20 @@ enc/gb18030.$(OBJEXT): internal/stdalign.h
enc/gb18030.$(OBJEXT): internal/stdbool.h
enc/gb18030.$(OBJEXT): internal/warning_push.h
enc/gb18030.$(OBJEXT): internal/xmalloc.h
-enc/gb18030.$(OBJEXT): assert.h
-enc/gb18030.$(OBJEXT): backward/2/assume.h
-enc/gb18030.$(OBJEXT): backward/2/attributes.h
-enc/gb18030.$(OBJEXT): backward/2/bool.h
-enc/gb18030.$(OBJEXT): backward/2/gcc_version_since.h
-enc/gb18030.$(OBJEXT): backward/2/long_long.h
-enc/gb18030.$(OBJEXT): backward/2/stdalign.h
-enc/gb18030.$(OBJEXT): backward/2/stdarg.h
-enc/gb18030.$(OBJEXT): config.h
-enc/gb18030.$(OBJEXT): defines.h
-enc/gb18030.$(OBJEXT): enc/gb18030.c
enc/gb18030.$(OBJEXT): missing.h
enc/gb18030.$(OBJEXT): onigmo.h
enc/gb2312.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/gb2312.$(OBJEXT): assert.h
+enc/gb2312.$(OBJEXT): backward/2/assume.h
+enc/gb2312.$(OBJEXT): backward/2/attributes.h
+enc/gb2312.$(OBJEXT): backward/2/bool.h
+enc/gb2312.$(OBJEXT): backward/2/gcc_version_since.h
+enc/gb2312.$(OBJEXT): backward/2/long_long.h
+enc/gb2312.$(OBJEXT): backward/2/stdalign.h
+enc/gb2312.$(OBJEXT): backward/2/stdarg.h
+enc/gb2312.$(OBJEXT): config.h
+enc/gb2312.$(OBJEXT): defines.h
+enc/gb2312.$(OBJEXT): enc/gb2312.c
enc/gb2312.$(OBJEXT): internal/assume.h
enc/gb2312.$(OBJEXT): internal/attr/alloc_size.h
enc/gb2312.$(OBJEXT): internal/attr/cold.h
@@ -1105,20 +1143,20 @@ enc/gb2312.$(OBJEXT): internal/stdalign.h
enc/gb2312.$(OBJEXT): internal/stdbool.h
enc/gb2312.$(OBJEXT): internal/warning_push.h
enc/gb2312.$(OBJEXT): internal/xmalloc.h
-enc/gb2312.$(OBJEXT): assert.h
-enc/gb2312.$(OBJEXT): backward/2/assume.h
-enc/gb2312.$(OBJEXT): backward/2/attributes.h
-enc/gb2312.$(OBJEXT): backward/2/bool.h
-enc/gb2312.$(OBJEXT): backward/2/gcc_version_since.h
-enc/gb2312.$(OBJEXT): backward/2/long_long.h
-enc/gb2312.$(OBJEXT): backward/2/stdalign.h
-enc/gb2312.$(OBJEXT): backward/2/stdarg.h
-enc/gb2312.$(OBJEXT): config.h
-enc/gb2312.$(OBJEXT): defines.h
-enc/gb2312.$(OBJEXT): enc/gb2312.c
enc/gb2312.$(OBJEXT): missing.h
enc/gb2312.$(OBJEXT): onigmo.h
enc/gbk.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/gbk.$(OBJEXT): assert.h
+enc/gbk.$(OBJEXT): backward/2/assume.h
+enc/gbk.$(OBJEXT): backward/2/attributes.h
+enc/gbk.$(OBJEXT): backward/2/bool.h
+enc/gbk.$(OBJEXT): backward/2/gcc_version_since.h
+enc/gbk.$(OBJEXT): backward/2/long_long.h
+enc/gbk.$(OBJEXT): backward/2/stdalign.h
+enc/gbk.$(OBJEXT): backward/2/stdarg.h
+enc/gbk.$(OBJEXT): config.h
+enc/gbk.$(OBJEXT): defines.h
+enc/gbk.$(OBJEXT): enc/gbk.c
enc/gbk.$(OBJEXT): internal/assume.h
enc/gbk.$(OBJEXT): internal/attr/alloc_size.h
enc/gbk.$(OBJEXT): internal/attr/cold.h
@@ -1161,20 +1199,21 @@ enc/gbk.$(OBJEXT): internal/stdalign.h
enc/gbk.$(OBJEXT): internal/stdbool.h
enc/gbk.$(OBJEXT): internal/warning_push.h
enc/gbk.$(OBJEXT): internal/xmalloc.h
-enc/gbk.$(OBJEXT): assert.h
-enc/gbk.$(OBJEXT): backward/2/assume.h
-enc/gbk.$(OBJEXT): backward/2/attributes.h
-enc/gbk.$(OBJEXT): backward/2/bool.h
-enc/gbk.$(OBJEXT): backward/2/gcc_version_since.h
-enc/gbk.$(OBJEXT): backward/2/long_long.h
-enc/gbk.$(OBJEXT): backward/2/stdalign.h
-enc/gbk.$(OBJEXT): backward/2/stdarg.h
-enc/gbk.$(OBJEXT): config.h
-enc/gbk.$(OBJEXT): defines.h
-enc/gbk.$(OBJEXT): enc/gbk.c
enc/gbk.$(OBJEXT): missing.h
enc/gbk.$(OBJEXT): onigmo.h
enc/iso_8859_1.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_1.$(OBJEXT): assert.h
+enc/iso_8859_1.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_1.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_1.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_1.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_1.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_1.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_1.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_1.$(OBJEXT): config.h
+enc/iso_8859_1.$(OBJEXT): defines.h
+enc/iso_8859_1.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_1.$(OBJEXT): enc/iso_8859_1.c
enc/iso_8859_1.$(OBJEXT): internal/assume.h
enc/iso_8859_1.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_1.$(OBJEXT): internal/attr/cold.h
@@ -1217,21 +1256,21 @@ enc/iso_8859_1.$(OBJEXT): internal/stdalign.h
enc/iso_8859_1.$(OBJEXT): internal/stdbool.h
enc/iso_8859_1.$(OBJEXT): internal/warning_push.h
enc/iso_8859_1.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_1.$(OBJEXT): assert.h
-enc/iso_8859_1.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_1.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_1.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_1.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_1.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_1.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_1.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_1.$(OBJEXT): config.h
-enc/iso_8859_1.$(OBJEXT): defines.h
-enc/iso_8859_1.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_1.$(OBJEXT): enc/iso_8859_1.c
enc/iso_8859_1.$(OBJEXT): missing.h
enc/iso_8859_1.$(OBJEXT): onigmo.h
enc/iso_8859_10.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_10.$(OBJEXT): assert.h
+enc/iso_8859_10.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_10.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_10.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_10.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_10.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_10.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_10.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_10.$(OBJEXT): config.h
+enc/iso_8859_10.$(OBJEXT): defines.h
+enc/iso_8859_10.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_10.$(OBJEXT): enc/iso_8859_10.c
enc/iso_8859_10.$(OBJEXT): internal/assume.h
enc/iso_8859_10.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_10.$(OBJEXT): internal/attr/cold.h
@@ -1274,21 +1313,20 @@ enc/iso_8859_10.$(OBJEXT): internal/stdalign.h
enc/iso_8859_10.$(OBJEXT): internal/stdbool.h
enc/iso_8859_10.$(OBJEXT): internal/warning_push.h
enc/iso_8859_10.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_10.$(OBJEXT): assert.h
-enc/iso_8859_10.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_10.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_10.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_10.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_10.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_10.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_10.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_10.$(OBJEXT): config.h
-enc/iso_8859_10.$(OBJEXT): defines.h
-enc/iso_8859_10.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_10.$(OBJEXT): enc/iso_8859_10.c
enc/iso_8859_10.$(OBJEXT): missing.h
enc/iso_8859_10.$(OBJEXT): onigmo.h
enc/iso_8859_11.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_11.$(OBJEXT): assert.h
+enc/iso_8859_11.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_11.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_11.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_11.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_11.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_11.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_11.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_11.$(OBJEXT): config.h
+enc/iso_8859_11.$(OBJEXT): defines.h
+enc/iso_8859_11.$(OBJEXT): enc/iso_8859_11.c
enc/iso_8859_11.$(OBJEXT): internal/assume.h
enc/iso_8859_11.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_11.$(OBJEXT): internal/attr/cold.h
@@ -1331,20 +1369,21 @@ enc/iso_8859_11.$(OBJEXT): internal/stdalign.h
enc/iso_8859_11.$(OBJEXT): internal/stdbool.h
enc/iso_8859_11.$(OBJEXT): internal/warning_push.h
enc/iso_8859_11.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_11.$(OBJEXT): assert.h
-enc/iso_8859_11.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_11.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_11.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_11.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_11.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_11.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_11.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_11.$(OBJEXT): config.h
-enc/iso_8859_11.$(OBJEXT): defines.h
-enc/iso_8859_11.$(OBJEXT): enc/iso_8859_11.c
enc/iso_8859_11.$(OBJEXT): missing.h
enc/iso_8859_11.$(OBJEXT): onigmo.h
enc/iso_8859_13.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_13.$(OBJEXT): assert.h
+enc/iso_8859_13.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_13.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_13.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_13.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_13.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_13.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_13.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_13.$(OBJEXT): config.h
+enc/iso_8859_13.$(OBJEXT): defines.h
+enc/iso_8859_13.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_13.$(OBJEXT): enc/iso_8859_13.c
enc/iso_8859_13.$(OBJEXT): internal/assume.h
enc/iso_8859_13.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_13.$(OBJEXT): internal/attr/cold.h
@@ -1387,21 +1426,21 @@ enc/iso_8859_13.$(OBJEXT): internal/stdalign.h
enc/iso_8859_13.$(OBJEXT): internal/stdbool.h
enc/iso_8859_13.$(OBJEXT): internal/warning_push.h
enc/iso_8859_13.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_13.$(OBJEXT): assert.h
-enc/iso_8859_13.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_13.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_13.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_13.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_13.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_13.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_13.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_13.$(OBJEXT): config.h
-enc/iso_8859_13.$(OBJEXT): defines.h
-enc/iso_8859_13.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_13.$(OBJEXT): enc/iso_8859_13.c
enc/iso_8859_13.$(OBJEXT): missing.h
enc/iso_8859_13.$(OBJEXT): onigmo.h
enc/iso_8859_14.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_14.$(OBJEXT): assert.h
+enc/iso_8859_14.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_14.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_14.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_14.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_14.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_14.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_14.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_14.$(OBJEXT): config.h
+enc/iso_8859_14.$(OBJEXT): defines.h
+enc/iso_8859_14.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_14.$(OBJEXT): enc/iso_8859_14.c
enc/iso_8859_14.$(OBJEXT): internal/assume.h
enc/iso_8859_14.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_14.$(OBJEXT): internal/attr/cold.h
@@ -1444,21 +1483,21 @@ enc/iso_8859_14.$(OBJEXT): internal/stdalign.h
enc/iso_8859_14.$(OBJEXT): internal/stdbool.h
enc/iso_8859_14.$(OBJEXT): internal/warning_push.h
enc/iso_8859_14.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_14.$(OBJEXT): assert.h
-enc/iso_8859_14.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_14.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_14.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_14.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_14.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_14.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_14.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_14.$(OBJEXT): config.h
-enc/iso_8859_14.$(OBJEXT): defines.h
-enc/iso_8859_14.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_14.$(OBJEXT): enc/iso_8859_14.c
enc/iso_8859_14.$(OBJEXT): missing.h
enc/iso_8859_14.$(OBJEXT): onigmo.h
enc/iso_8859_15.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_15.$(OBJEXT): assert.h
+enc/iso_8859_15.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_15.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_15.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_15.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_15.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_15.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_15.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_15.$(OBJEXT): config.h
+enc/iso_8859_15.$(OBJEXT): defines.h
+enc/iso_8859_15.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_15.$(OBJEXT): enc/iso_8859_15.c
enc/iso_8859_15.$(OBJEXT): internal/assume.h
enc/iso_8859_15.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_15.$(OBJEXT): internal/attr/cold.h
@@ -1501,21 +1540,21 @@ enc/iso_8859_15.$(OBJEXT): internal/stdalign.h
enc/iso_8859_15.$(OBJEXT): internal/stdbool.h
enc/iso_8859_15.$(OBJEXT): internal/warning_push.h
enc/iso_8859_15.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_15.$(OBJEXT): assert.h
-enc/iso_8859_15.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_15.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_15.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_15.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_15.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_15.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_15.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_15.$(OBJEXT): config.h
-enc/iso_8859_15.$(OBJEXT): defines.h
-enc/iso_8859_15.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_15.$(OBJEXT): enc/iso_8859_15.c
enc/iso_8859_15.$(OBJEXT): missing.h
enc/iso_8859_15.$(OBJEXT): onigmo.h
enc/iso_8859_16.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_16.$(OBJEXT): assert.h
+enc/iso_8859_16.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_16.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_16.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_16.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_16.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_16.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_16.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_16.$(OBJEXT): config.h
+enc/iso_8859_16.$(OBJEXT): defines.h
+enc/iso_8859_16.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_16.$(OBJEXT): enc/iso_8859_16.c
enc/iso_8859_16.$(OBJEXT): internal/assume.h
enc/iso_8859_16.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_16.$(OBJEXT): internal/attr/cold.h
@@ -1558,21 +1597,21 @@ enc/iso_8859_16.$(OBJEXT): internal/stdalign.h
enc/iso_8859_16.$(OBJEXT): internal/stdbool.h
enc/iso_8859_16.$(OBJEXT): internal/warning_push.h
enc/iso_8859_16.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_16.$(OBJEXT): assert.h
-enc/iso_8859_16.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_16.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_16.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_16.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_16.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_16.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_16.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_16.$(OBJEXT): config.h
-enc/iso_8859_16.$(OBJEXT): defines.h
-enc/iso_8859_16.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_16.$(OBJEXT): enc/iso_8859_16.c
enc/iso_8859_16.$(OBJEXT): missing.h
enc/iso_8859_16.$(OBJEXT): onigmo.h
enc/iso_8859_2.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_2.$(OBJEXT): assert.h
+enc/iso_8859_2.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_2.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_2.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_2.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_2.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_2.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_2.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_2.$(OBJEXT): config.h
+enc/iso_8859_2.$(OBJEXT): defines.h
+enc/iso_8859_2.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_2.$(OBJEXT): enc/iso_8859_2.c
enc/iso_8859_2.$(OBJEXT): internal/assume.h
enc/iso_8859_2.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_2.$(OBJEXT): internal/attr/cold.h
@@ -1615,21 +1654,21 @@ enc/iso_8859_2.$(OBJEXT): internal/stdalign.h
enc/iso_8859_2.$(OBJEXT): internal/stdbool.h
enc/iso_8859_2.$(OBJEXT): internal/warning_push.h
enc/iso_8859_2.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_2.$(OBJEXT): assert.h
-enc/iso_8859_2.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_2.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_2.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_2.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_2.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_2.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_2.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_2.$(OBJEXT): config.h
-enc/iso_8859_2.$(OBJEXT): defines.h
-enc/iso_8859_2.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_2.$(OBJEXT): enc/iso_8859_2.c
enc/iso_8859_2.$(OBJEXT): missing.h
enc/iso_8859_2.$(OBJEXT): onigmo.h
enc/iso_8859_3.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_3.$(OBJEXT): assert.h
+enc/iso_8859_3.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_3.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_3.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_3.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_3.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_3.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_3.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_3.$(OBJEXT): config.h
+enc/iso_8859_3.$(OBJEXT): defines.h
+enc/iso_8859_3.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_3.$(OBJEXT): enc/iso_8859_3.c
enc/iso_8859_3.$(OBJEXT): internal/assume.h
enc/iso_8859_3.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_3.$(OBJEXT): internal/attr/cold.h
@@ -1672,21 +1711,21 @@ enc/iso_8859_3.$(OBJEXT): internal/stdalign.h
enc/iso_8859_3.$(OBJEXT): internal/stdbool.h
enc/iso_8859_3.$(OBJEXT): internal/warning_push.h
enc/iso_8859_3.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_3.$(OBJEXT): assert.h
-enc/iso_8859_3.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_3.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_3.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_3.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_3.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_3.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_3.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_3.$(OBJEXT): config.h
-enc/iso_8859_3.$(OBJEXT): defines.h
-enc/iso_8859_3.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_3.$(OBJEXT): enc/iso_8859_3.c
enc/iso_8859_3.$(OBJEXT): missing.h
enc/iso_8859_3.$(OBJEXT): onigmo.h
enc/iso_8859_4.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_4.$(OBJEXT): assert.h
+enc/iso_8859_4.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_4.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_4.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_4.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_4.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_4.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_4.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_4.$(OBJEXT): config.h
+enc/iso_8859_4.$(OBJEXT): defines.h
+enc/iso_8859_4.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_4.$(OBJEXT): enc/iso_8859_4.c
enc/iso_8859_4.$(OBJEXT): internal/assume.h
enc/iso_8859_4.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_4.$(OBJEXT): internal/attr/cold.h
@@ -1729,21 +1768,20 @@ enc/iso_8859_4.$(OBJEXT): internal/stdalign.h
enc/iso_8859_4.$(OBJEXT): internal/stdbool.h
enc/iso_8859_4.$(OBJEXT): internal/warning_push.h
enc/iso_8859_4.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_4.$(OBJEXT): assert.h
-enc/iso_8859_4.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_4.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_4.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_4.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_4.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_4.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_4.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_4.$(OBJEXT): config.h
-enc/iso_8859_4.$(OBJEXT): defines.h
-enc/iso_8859_4.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_4.$(OBJEXT): enc/iso_8859_4.c
enc/iso_8859_4.$(OBJEXT): missing.h
enc/iso_8859_4.$(OBJEXT): onigmo.h
enc/iso_8859_5.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_5.$(OBJEXT): assert.h
+enc/iso_8859_5.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_5.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_5.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_5.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_5.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_5.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_5.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_5.$(OBJEXT): config.h
+enc/iso_8859_5.$(OBJEXT): defines.h
+enc/iso_8859_5.$(OBJEXT): enc/iso_8859_5.c
enc/iso_8859_5.$(OBJEXT): internal/assume.h
enc/iso_8859_5.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_5.$(OBJEXT): internal/attr/cold.h
@@ -1786,20 +1824,20 @@ enc/iso_8859_5.$(OBJEXT): internal/stdalign.h
enc/iso_8859_5.$(OBJEXT): internal/stdbool.h
enc/iso_8859_5.$(OBJEXT): internal/warning_push.h
enc/iso_8859_5.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_5.$(OBJEXT): assert.h
-enc/iso_8859_5.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_5.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_5.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_5.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_5.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_5.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_5.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_5.$(OBJEXT): config.h
-enc/iso_8859_5.$(OBJEXT): defines.h
-enc/iso_8859_5.$(OBJEXT): enc/iso_8859_5.c
enc/iso_8859_5.$(OBJEXT): missing.h
enc/iso_8859_5.$(OBJEXT): onigmo.h
enc/iso_8859_6.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_6.$(OBJEXT): assert.h
+enc/iso_8859_6.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_6.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_6.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_6.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_6.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_6.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_6.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_6.$(OBJEXT): config.h
+enc/iso_8859_6.$(OBJEXT): defines.h
+enc/iso_8859_6.$(OBJEXT): enc/iso_8859_6.c
enc/iso_8859_6.$(OBJEXT): internal/assume.h
enc/iso_8859_6.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_6.$(OBJEXT): internal/attr/cold.h
@@ -1842,20 +1880,20 @@ enc/iso_8859_6.$(OBJEXT): internal/stdalign.h
enc/iso_8859_6.$(OBJEXT): internal/stdbool.h
enc/iso_8859_6.$(OBJEXT): internal/warning_push.h
enc/iso_8859_6.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_6.$(OBJEXT): assert.h
-enc/iso_8859_6.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_6.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_6.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_6.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_6.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_6.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_6.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_6.$(OBJEXT): config.h
-enc/iso_8859_6.$(OBJEXT): defines.h
-enc/iso_8859_6.$(OBJEXT): enc/iso_8859_6.c
enc/iso_8859_6.$(OBJEXT): missing.h
enc/iso_8859_6.$(OBJEXT): onigmo.h
enc/iso_8859_7.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_7.$(OBJEXT): assert.h
+enc/iso_8859_7.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_7.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_7.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_7.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_7.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_7.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_7.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_7.$(OBJEXT): config.h
+enc/iso_8859_7.$(OBJEXT): defines.h
+enc/iso_8859_7.$(OBJEXT): enc/iso_8859_7.c
enc/iso_8859_7.$(OBJEXT): internal/assume.h
enc/iso_8859_7.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_7.$(OBJEXT): internal/attr/cold.h
@@ -1898,20 +1936,20 @@ enc/iso_8859_7.$(OBJEXT): internal/stdalign.h
enc/iso_8859_7.$(OBJEXT): internal/stdbool.h
enc/iso_8859_7.$(OBJEXT): internal/warning_push.h
enc/iso_8859_7.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_7.$(OBJEXT): assert.h
-enc/iso_8859_7.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_7.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_7.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_7.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_7.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_7.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_7.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_7.$(OBJEXT): config.h
-enc/iso_8859_7.$(OBJEXT): defines.h
-enc/iso_8859_7.$(OBJEXT): enc/iso_8859_7.c
enc/iso_8859_7.$(OBJEXT): missing.h
enc/iso_8859_7.$(OBJEXT): onigmo.h
enc/iso_8859_8.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_8.$(OBJEXT): assert.h
+enc/iso_8859_8.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_8.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_8.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_8.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_8.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_8.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_8.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_8.$(OBJEXT): config.h
+enc/iso_8859_8.$(OBJEXT): defines.h
+enc/iso_8859_8.$(OBJEXT): enc/iso_8859_8.c
enc/iso_8859_8.$(OBJEXT): internal/assume.h
enc/iso_8859_8.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_8.$(OBJEXT): internal/attr/cold.h
@@ -1954,20 +1992,21 @@ enc/iso_8859_8.$(OBJEXT): internal/stdalign.h
enc/iso_8859_8.$(OBJEXT): internal/stdbool.h
enc/iso_8859_8.$(OBJEXT): internal/warning_push.h
enc/iso_8859_8.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_8.$(OBJEXT): assert.h
-enc/iso_8859_8.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_8.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_8.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_8.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_8.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_8.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_8.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_8.$(OBJEXT): config.h
-enc/iso_8859_8.$(OBJEXT): defines.h
-enc/iso_8859_8.$(OBJEXT): enc/iso_8859_8.c
enc/iso_8859_8.$(OBJEXT): missing.h
enc/iso_8859_8.$(OBJEXT): onigmo.h
enc/iso_8859_9.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/iso_8859_9.$(OBJEXT): assert.h
+enc/iso_8859_9.$(OBJEXT): backward/2/assume.h
+enc/iso_8859_9.$(OBJEXT): backward/2/attributes.h
+enc/iso_8859_9.$(OBJEXT): backward/2/bool.h
+enc/iso_8859_9.$(OBJEXT): backward/2/gcc_version_since.h
+enc/iso_8859_9.$(OBJEXT): backward/2/long_long.h
+enc/iso_8859_9.$(OBJEXT): backward/2/stdalign.h
+enc/iso_8859_9.$(OBJEXT): backward/2/stdarg.h
+enc/iso_8859_9.$(OBJEXT): config.h
+enc/iso_8859_9.$(OBJEXT): defines.h
+enc/iso_8859_9.$(OBJEXT): enc/iso_8859.h
+enc/iso_8859_9.$(OBJEXT): enc/iso_8859_9.c
enc/iso_8859_9.$(OBJEXT): internal/assume.h
enc/iso_8859_9.$(OBJEXT): internal/attr/alloc_size.h
enc/iso_8859_9.$(OBJEXT): internal/attr/cold.h
@@ -2010,21 +2049,20 @@ enc/iso_8859_9.$(OBJEXT): internal/stdalign.h
enc/iso_8859_9.$(OBJEXT): internal/stdbool.h
enc/iso_8859_9.$(OBJEXT): internal/warning_push.h
enc/iso_8859_9.$(OBJEXT): internal/xmalloc.h
-enc/iso_8859_9.$(OBJEXT): assert.h
-enc/iso_8859_9.$(OBJEXT): backward/2/assume.h
-enc/iso_8859_9.$(OBJEXT): backward/2/attributes.h
-enc/iso_8859_9.$(OBJEXT): backward/2/bool.h
-enc/iso_8859_9.$(OBJEXT): backward/2/gcc_version_since.h
-enc/iso_8859_9.$(OBJEXT): backward/2/long_long.h
-enc/iso_8859_9.$(OBJEXT): backward/2/stdalign.h
-enc/iso_8859_9.$(OBJEXT): backward/2/stdarg.h
-enc/iso_8859_9.$(OBJEXT): config.h
-enc/iso_8859_9.$(OBJEXT): defines.h
-enc/iso_8859_9.$(OBJEXT): enc/iso_8859.h
-enc/iso_8859_9.$(OBJEXT): enc/iso_8859_9.c
enc/iso_8859_9.$(OBJEXT): missing.h
enc/iso_8859_9.$(OBJEXT): onigmo.h
enc/koi8_r.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/koi8_r.$(OBJEXT): assert.h
+enc/koi8_r.$(OBJEXT): backward/2/assume.h
+enc/koi8_r.$(OBJEXT): backward/2/attributes.h
+enc/koi8_r.$(OBJEXT): backward/2/bool.h
+enc/koi8_r.$(OBJEXT): backward/2/gcc_version_since.h
+enc/koi8_r.$(OBJEXT): backward/2/long_long.h
+enc/koi8_r.$(OBJEXT): backward/2/stdalign.h
+enc/koi8_r.$(OBJEXT): backward/2/stdarg.h
+enc/koi8_r.$(OBJEXT): config.h
+enc/koi8_r.$(OBJEXT): defines.h
+enc/koi8_r.$(OBJEXT): enc/koi8_r.c
enc/koi8_r.$(OBJEXT): internal/assume.h
enc/koi8_r.$(OBJEXT): internal/attr/alloc_size.h
enc/koi8_r.$(OBJEXT): internal/attr/cold.h
@@ -2067,20 +2105,20 @@ enc/koi8_r.$(OBJEXT): internal/stdalign.h
enc/koi8_r.$(OBJEXT): internal/stdbool.h
enc/koi8_r.$(OBJEXT): internal/warning_push.h
enc/koi8_r.$(OBJEXT): internal/xmalloc.h
-enc/koi8_r.$(OBJEXT): assert.h
-enc/koi8_r.$(OBJEXT): backward/2/assume.h
-enc/koi8_r.$(OBJEXT): backward/2/attributes.h
-enc/koi8_r.$(OBJEXT): backward/2/bool.h
-enc/koi8_r.$(OBJEXT): backward/2/gcc_version_since.h
-enc/koi8_r.$(OBJEXT): backward/2/long_long.h
-enc/koi8_r.$(OBJEXT): backward/2/stdalign.h
-enc/koi8_r.$(OBJEXT): backward/2/stdarg.h
-enc/koi8_r.$(OBJEXT): config.h
-enc/koi8_r.$(OBJEXT): defines.h
-enc/koi8_r.$(OBJEXT): enc/koi8_r.c
enc/koi8_r.$(OBJEXT): missing.h
enc/koi8_r.$(OBJEXT): onigmo.h
enc/koi8_u.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/koi8_u.$(OBJEXT): assert.h
+enc/koi8_u.$(OBJEXT): backward/2/assume.h
+enc/koi8_u.$(OBJEXT): backward/2/attributes.h
+enc/koi8_u.$(OBJEXT): backward/2/bool.h
+enc/koi8_u.$(OBJEXT): backward/2/gcc_version_since.h
+enc/koi8_u.$(OBJEXT): backward/2/long_long.h
+enc/koi8_u.$(OBJEXT): backward/2/stdalign.h
+enc/koi8_u.$(OBJEXT): backward/2/stdarg.h
+enc/koi8_u.$(OBJEXT): config.h
+enc/koi8_u.$(OBJEXT): defines.h
+enc/koi8_u.$(OBJEXT): enc/koi8_u.c
enc/koi8_u.$(OBJEXT): internal/assume.h
enc/koi8_u.$(OBJEXT): internal/attr/alloc_size.h
enc/koi8_u.$(OBJEXT): internal/attr/cold.h
@@ -2123,20 +2161,23 @@ enc/koi8_u.$(OBJEXT): internal/stdalign.h
enc/koi8_u.$(OBJEXT): internal/stdbool.h
enc/koi8_u.$(OBJEXT): internal/warning_push.h
enc/koi8_u.$(OBJEXT): internal/xmalloc.h
-enc/koi8_u.$(OBJEXT): assert.h
-enc/koi8_u.$(OBJEXT): backward/2/assume.h
-enc/koi8_u.$(OBJEXT): backward/2/attributes.h
-enc/koi8_u.$(OBJEXT): backward/2/bool.h
-enc/koi8_u.$(OBJEXT): backward/2/gcc_version_since.h
-enc/koi8_u.$(OBJEXT): backward/2/long_long.h
-enc/koi8_u.$(OBJEXT): backward/2/stdalign.h
-enc/koi8_u.$(OBJEXT): backward/2/stdarg.h
-enc/koi8_u.$(OBJEXT): config.h
-enc/koi8_u.$(OBJEXT): defines.h
-enc/koi8_u.$(OBJEXT): enc/koi8_u.c
enc/koi8_u.$(OBJEXT): missing.h
enc/koi8_u.$(OBJEXT): onigmo.h
enc/shift_jis.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/shift_jis.$(OBJEXT): assert.h
+enc/shift_jis.$(OBJEXT): backward/2/assume.h
+enc/shift_jis.$(OBJEXT): backward/2/attributes.h
+enc/shift_jis.$(OBJEXT): backward/2/bool.h
+enc/shift_jis.$(OBJEXT): backward/2/gcc_version_since.h
+enc/shift_jis.$(OBJEXT): backward/2/long_long.h
+enc/shift_jis.$(OBJEXT): backward/2/stdalign.h
+enc/shift_jis.$(OBJEXT): backward/2/stdarg.h
+enc/shift_jis.$(OBJEXT): config.h
+enc/shift_jis.$(OBJEXT): defines.h
+enc/shift_jis.$(OBJEXT): enc/jis/props.h
+enc/shift_jis.$(OBJEXT): enc/jis/props.kwd
+enc/shift_jis.$(OBJEXT): enc/shift_jis.c
+enc/shift_jis.$(OBJEXT): enc/shift_jis.h
enc/shift_jis.$(OBJEXT): internal/assume.h
enc/shift_jis.$(OBJEXT): internal/attr/alloc_size.h
enc/shift_jis.$(OBJEXT): internal/attr/cold.h
@@ -2179,24 +2220,25 @@ enc/shift_jis.$(OBJEXT): internal/stdalign.h
enc/shift_jis.$(OBJEXT): internal/stdbool.h
enc/shift_jis.$(OBJEXT): internal/warning_push.h
enc/shift_jis.$(OBJEXT): internal/xmalloc.h
-enc/shift_jis.$(OBJEXT): assert.h
-enc/shift_jis.$(OBJEXT): backward/2/assume.h
-enc/shift_jis.$(OBJEXT): backward/2/attributes.h
-enc/shift_jis.$(OBJEXT): backward/2/bool.h
-enc/shift_jis.$(OBJEXT): backward/2/gcc_version_since.h
-enc/shift_jis.$(OBJEXT): backward/2/long_long.h
-enc/shift_jis.$(OBJEXT): backward/2/stdalign.h
-enc/shift_jis.$(OBJEXT): backward/2/stdarg.h
-enc/shift_jis.$(OBJEXT): config.h
-enc/shift_jis.$(OBJEXT): defines.h
-enc/shift_jis.$(OBJEXT): enc/jis/props.h
-enc/shift_jis.$(OBJEXT): enc/jis/props.kwd
-enc/shift_jis.$(OBJEXT): enc/shift_jis.c
-enc/shift_jis.$(OBJEXT): enc/shift_jis.h
enc/shift_jis.$(OBJEXT): missing.h
enc/shift_jis.$(OBJEXT): onigmo.h
enc/trans/big5.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/big5.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/big5.$(OBJEXT): assert.h
+enc/trans/big5.$(OBJEXT): backward.h
+enc/trans/big5.$(OBJEXT): backward/2/assume.h
+enc/trans/big5.$(OBJEXT): backward/2/attributes.h
+enc/trans/big5.$(OBJEXT): backward/2/bool.h
+enc/trans/big5.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/big5.$(OBJEXT): backward/2/inttypes.h
+enc/trans/big5.$(OBJEXT): backward/2/limits.h
+enc/trans/big5.$(OBJEXT): backward/2/long_long.h
+enc/trans/big5.$(OBJEXT): backward/2/stdalign.h
+enc/trans/big5.$(OBJEXT): backward/2/stdarg.h
+enc/trans/big5.$(OBJEXT): config.h
+enc/trans/big5.$(OBJEXT): defines.h
+enc/trans/big5.$(OBJEXT): enc/trans/big5.c
+enc/trans/big5.$(OBJEXT): intern.h
enc/trans/big5.$(OBJEXT): internal/anyargs.h
enc/trans/big5.$(OBJEXT): internal/arithmetic.h
enc/trans/big5.$(OBJEXT): internal/arithmetic/char.h
@@ -2336,26 +2378,26 @@ enc/trans/big5.$(OBJEXT): internal/value_type.h
enc/trans/big5.$(OBJEXT): internal/variable.h
enc/trans/big5.$(OBJEXT): internal/warning_push.h
enc/trans/big5.$(OBJEXT): internal/xmalloc.h
-enc/trans/big5.$(OBJEXT): assert.h
-enc/trans/big5.$(OBJEXT): backward.h
-enc/trans/big5.$(OBJEXT): backward/2/assume.h
-enc/trans/big5.$(OBJEXT): backward/2/attributes.h
-enc/trans/big5.$(OBJEXT): backward/2/bool.h
-enc/trans/big5.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/big5.$(OBJEXT): backward/2/inttypes.h
-enc/trans/big5.$(OBJEXT): backward/2/limits.h
-enc/trans/big5.$(OBJEXT): backward/2/long_long.h
-enc/trans/big5.$(OBJEXT): backward/2/stdalign.h
-enc/trans/big5.$(OBJEXT): backward/2/stdarg.h
-enc/trans/big5.$(OBJEXT): config.h
-enc/trans/big5.$(OBJEXT): defines.h
-enc/trans/big5.$(OBJEXT): enc/trans/big5.c
-enc/trans/big5.$(OBJEXT): intern.h
enc/trans/big5.$(OBJEXT): missing.h
enc/trans/big5.$(OBJEXT): st.h
enc/trans/big5.$(OBJEXT): subst.h
enc/trans/cesu_8.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/cesu_8.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/cesu_8.$(OBJEXT): assert.h
+enc/trans/cesu_8.$(OBJEXT): backward.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/assume.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/attributes.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/bool.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/inttypes.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/limits.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/long_long.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/stdalign.h
+enc/trans/cesu_8.$(OBJEXT): backward/2/stdarg.h
+enc/trans/cesu_8.$(OBJEXT): config.h
+enc/trans/cesu_8.$(OBJEXT): defines.h
+enc/trans/cesu_8.$(OBJEXT): enc/trans/cesu_8.c
+enc/trans/cesu_8.$(OBJEXT): intern.h
enc/trans/cesu_8.$(OBJEXT): internal/anyargs.h
enc/trans/cesu_8.$(OBJEXT): internal/arithmetic.h
enc/trans/cesu_8.$(OBJEXT): internal/arithmetic/char.h
@@ -2495,26 +2537,26 @@ enc/trans/cesu_8.$(OBJEXT): internal/value_type.h
enc/trans/cesu_8.$(OBJEXT): internal/variable.h
enc/trans/cesu_8.$(OBJEXT): internal/warning_push.h
enc/trans/cesu_8.$(OBJEXT): internal/xmalloc.h
-enc/trans/cesu_8.$(OBJEXT): assert.h
-enc/trans/cesu_8.$(OBJEXT): backward.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/assume.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/attributes.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/bool.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/inttypes.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/limits.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/long_long.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/stdalign.h
-enc/trans/cesu_8.$(OBJEXT): backward/2/stdarg.h
-enc/trans/cesu_8.$(OBJEXT): config.h
-enc/trans/cesu_8.$(OBJEXT): defines.h
-enc/trans/cesu_8.$(OBJEXT): enc/trans/cesu_8.c
-enc/trans/cesu_8.$(OBJEXT): intern.h
enc/trans/cesu_8.$(OBJEXT): missing.h
enc/trans/cesu_8.$(OBJEXT): st.h
enc/trans/cesu_8.$(OBJEXT): subst.h
enc/trans/chinese.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/chinese.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/chinese.$(OBJEXT): assert.h
+enc/trans/chinese.$(OBJEXT): backward.h
+enc/trans/chinese.$(OBJEXT): backward/2/assume.h
+enc/trans/chinese.$(OBJEXT): backward/2/attributes.h
+enc/trans/chinese.$(OBJEXT): backward/2/bool.h
+enc/trans/chinese.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/chinese.$(OBJEXT): backward/2/inttypes.h
+enc/trans/chinese.$(OBJEXT): backward/2/limits.h
+enc/trans/chinese.$(OBJEXT): backward/2/long_long.h
+enc/trans/chinese.$(OBJEXT): backward/2/stdalign.h
+enc/trans/chinese.$(OBJEXT): backward/2/stdarg.h
+enc/trans/chinese.$(OBJEXT): config.h
+enc/trans/chinese.$(OBJEXT): defines.h
+enc/trans/chinese.$(OBJEXT): enc/trans/chinese.c
+enc/trans/chinese.$(OBJEXT): intern.h
enc/trans/chinese.$(OBJEXT): internal/anyargs.h
enc/trans/chinese.$(OBJEXT): internal/arithmetic.h
enc/trans/chinese.$(OBJEXT): internal/arithmetic/char.h
@@ -2654,26 +2696,26 @@ enc/trans/chinese.$(OBJEXT): internal/value_type.h
enc/trans/chinese.$(OBJEXT): internal/variable.h
enc/trans/chinese.$(OBJEXT): internal/warning_push.h
enc/trans/chinese.$(OBJEXT): internal/xmalloc.h
-enc/trans/chinese.$(OBJEXT): assert.h
-enc/trans/chinese.$(OBJEXT): backward.h
-enc/trans/chinese.$(OBJEXT): backward/2/assume.h
-enc/trans/chinese.$(OBJEXT): backward/2/attributes.h
-enc/trans/chinese.$(OBJEXT): backward/2/bool.h
-enc/trans/chinese.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/chinese.$(OBJEXT): backward/2/inttypes.h
-enc/trans/chinese.$(OBJEXT): backward/2/limits.h
-enc/trans/chinese.$(OBJEXT): backward/2/long_long.h
-enc/trans/chinese.$(OBJEXT): backward/2/stdalign.h
-enc/trans/chinese.$(OBJEXT): backward/2/stdarg.h
-enc/trans/chinese.$(OBJEXT): config.h
-enc/trans/chinese.$(OBJEXT): defines.h
-enc/trans/chinese.$(OBJEXT): enc/trans/chinese.c
-enc/trans/chinese.$(OBJEXT): intern.h
enc/trans/chinese.$(OBJEXT): missing.h
enc/trans/chinese.$(OBJEXT): st.h
enc/trans/chinese.$(OBJEXT): subst.h
enc/trans/ebcdic.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/ebcdic.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/ebcdic.$(OBJEXT): assert.h
+enc/trans/ebcdic.$(OBJEXT): backward.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/assume.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/attributes.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/bool.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/inttypes.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/limits.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/long_long.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/stdalign.h
+enc/trans/ebcdic.$(OBJEXT): backward/2/stdarg.h
+enc/trans/ebcdic.$(OBJEXT): config.h
+enc/trans/ebcdic.$(OBJEXT): defines.h
+enc/trans/ebcdic.$(OBJEXT): enc/trans/ebcdic.c
+enc/trans/ebcdic.$(OBJEXT): intern.h
enc/trans/ebcdic.$(OBJEXT): internal/anyargs.h
enc/trans/ebcdic.$(OBJEXT): internal/arithmetic.h
enc/trans/ebcdic.$(OBJEXT): internal/arithmetic/char.h
@@ -2813,26 +2855,26 @@ enc/trans/ebcdic.$(OBJEXT): internal/value_type.h
enc/trans/ebcdic.$(OBJEXT): internal/variable.h
enc/trans/ebcdic.$(OBJEXT): internal/warning_push.h
enc/trans/ebcdic.$(OBJEXT): internal/xmalloc.h
-enc/trans/ebcdic.$(OBJEXT): assert.h
-enc/trans/ebcdic.$(OBJEXT): backward.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/assume.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/attributes.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/bool.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/inttypes.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/limits.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/long_long.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/stdalign.h
-enc/trans/ebcdic.$(OBJEXT): backward/2/stdarg.h
-enc/trans/ebcdic.$(OBJEXT): config.h
-enc/trans/ebcdic.$(OBJEXT): defines.h
-enc/trans/ebcdic.$(OBJEXT): enc/trans/ebcdic.c
-enc/trans/ebcdic.$(OBJEXT): intern.h
enc/trans/ebcdic.$(OBJEXT): missing.h
enc/trans/ebcdic.$(OBJEXT): st.h
enc/trans/ebcdic.$(OBJEXT): subst.h
enc/trans/emoji.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/emoji.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji.$(OBJEXT): assert.h
+enc/trans/emoji.$(OBJEXT): backward.h
+enc/trans/emoji.$(OBJEXT): backward/2/assume.h
+enc/trans/emoji.$(OBJEXT): backward/2/attributes.h
+enc/trans/emoji.$(OBJEXT): backward/2/bool.h
+enc/trans/emoji.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/emoji.$(OBJEXT): backward/2/inttypes.h
+enc/trans/emoji.$(OBJEXT): backward/2/limits.h
+enc/trans/emoji.$(OBJEXT): backward/2/long_long.h
+enc/trans/emoji.$(OBJEXT): backward/2/stdalign.h
+enc/trans/emoji.$(OBJEXT): backward/2/stdarg.h
+enc/trans/emoji.$(OBJEXT): config.h
+enc/trans/emoji.$(OBJEXT): defines.h
+enc/trans/emoji.$(OBJEXT): enc/trans/emoji.c
+enc/trans/emoji.$(OBJEXT): intern.h
enc/trans/emoji.$(OBJEXT): internal/anyargs.h
enc/trans/emoji.$(OBJEXT): internal/arithmetic.h
enc/trans/emoji.$(OBJEXT): internal/arithmetic/char.h
@@ -2972,26 +3014,26 @@ enc/trans/emoji.$(OBJEXT): internal/value_type.h
enc/trans/emoji.$(OBJEXT): internal/variable.h
enc/trans/emoji.$(OBJEXT): internal/warning_push.h
enc/trans/emoji.$(OBJEXT): internal/xmalloc.h
-enc/trans/emoji.$(OBJEXT): assert.h
-enc/trans/emoji.$(OBJEXT): backward.h
-enc/trans/emoji.$(OBJEXT): backward/2/assume.h
-enc/trans/emoji.$(OBJEXT): backward/2/attributes.h
-enc/trans/emoji.$(OBJEXT): backward/2/bool.h
-enc/trans/emoji.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/emoji.$(OBJEXT): backward/2/inttypes.h
-enc/trans/emoji.$(OBJEXT): backward/2/limits.h
-enc/trans/emoji.$(OBJEXT): backward/2/long_long.h
-enc/trans/emoji.$(OBJEXT): backward/2/stdalign.h
-enc/trans/emoji.$(OBJEXT): backward/2/stdarg.h
-enc/trans/emoji.$(OBJEXT): config.h
-enc/trans/emoji.$(OBJEXT): defines.h
-enc/trans/emoji.$(OBJEXT): enc/trans/emoji.c
-enc/trans/emoji.$(OBJEXT): intern.h
enc/trans/emoji.$(OBJEXT): missing.h
enc/trans/emoji.$(OBJEXT): st.h
enc/trans/emoji.$(OBJEXT): subst.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): assert.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/assume.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/attributes.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/bool.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/inttypes.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/limits.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/long_long.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/stdalign.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/stdarg.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): config.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): defines.h
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): enc/trans/emoji_iso2022_kddi.c
+enc/trans/emoji_iso2022_kddi.$(OBJEXT): intern.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/anyargs.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/arithmetic.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/arithmetic/char.h
@@ -3131,26 +3173,26 @@ enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/value_type.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/variable.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/warning_push.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): internal/xmalloc.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): assert.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/assume.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/attributes.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/bool.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/inttypes.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/limits.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/long_long.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/stdalign.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): backward/2/stdarg.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): config.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): defines.h
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): enc/trans/emoji_iso2022_kddi.c
-enc/trans/emoji_iso2022_kddi.$(OBJEXT): intern.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): missing.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): st.h
enc/trans/emoji_iso2022_kddi.$(OBJEXT): subst.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): assert.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/assume.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/attributes.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/bool.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/inttypes.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/limits.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/long_long.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/stdalign.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/stdarg.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): config.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): defines.h
+enc/trans/emoji_sjis_docomo.$(OBJEXT): enc/trans/emoji_sjis_docomo.c
+enc/trans/emoji_sjis_docomo.$(OBJEXT): intern.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/anyargs.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/arithmetic.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/arithmetic/char.h
@@ -3290,26 +3332,26 @@ enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/value_type.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/variable.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/warning_push.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): internal/xmalloc.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): assert.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/assume.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/attributes.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/bool.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/inttypes.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/limits.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/long_long.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/stdalign.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): backward/2/stdarg.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): config.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): defines.h
-enc/trans/emoji_sjis_docomo.$(OBJEXT): enc/trans/emoji_sjis_docomo.c
-enc/trans/emoji_sjis_docomo.$(OBJEXT): intern.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): missing.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): st.h
enc/trans/emoji_sjis_docomo.$(OBJEXT): subst.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): assert.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/assume.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/attributes.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/bool.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/inttypes.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/limits.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/long_long.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/stdalign.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/stdarg.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): config.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): defines.h
+enc/trans/emoji_sjis_kddi.$(OBJEXT): enc/trans/emoji_sjis_kddi.c
+enc/trans/emoji_sjis_kddi.$(OBJEXT): intern.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/anyargs.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/arithmetic.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/arithmetic/char.h
@@ -3449,26 +3491,26 @@ enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/value_type.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/variable.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/warning_push.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): internal/xmalloc.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): assert.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/assume.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/attributes.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/bool.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/inttypes.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/limits.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/long_long.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/stdalign.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): backward/2/stdarg.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): config.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): defines.h
-enc/trans/emoji_sjis_kddi.$(OBJEXT): enc/trans/emoji_sjis_kddi.c
-enc/trans/emoji_sjis_kddi.$(OBJEXT): intern.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): missing.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): st.h
enc/trans/emoji_sjis_kddi.$(OBJEXT): subst.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): assert.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/assume.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/attributes.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/bool.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/inttypes.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/limits.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/long_long.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/stdalign.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/stdarg.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): config.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): defines.h
+enc/trans/emoji_sjis_softbank.$(OBJEXT): enc/trans/emoji_sjis_softbank.c
+enc/trans/emoji_sjis_softbank.$(OBJEXT): intern.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/anyargs.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/arithmetic.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/arithmetic/char.h
@@ -3608,26 +3650,26 @@ enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/value_type.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/variable.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/warning_push.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): internal/xmalloc.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): assert.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/assume.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/attributes.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/bool.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/inttypes.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/limits.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/long_long.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/stdalign.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): backward/2/stdarg.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): config.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): defines.h
-enc/trans/emoji_sjis_softbank.$(OBJEXT): enc/trans/emoji_sjis_softbank.c
-enc/trans/emoji_sjis_softbank.$(OBJEXT): intern.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): missing.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): st.h
enc/trans/emoji_sjis_softbank.$(OBJEXT): subst.h
enc/trans/escape.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/escape.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/escape.$(OBJEXT): assert.h
+enc/trans/escape.$(OBJEXT): backward.h
+enc/trans/escape.$(OBJEXT): backward/2/assume.h
+enc/trans/escape.$(OBJEXT): backward/2/attributes.h
+enc/trans/escape.$(OBJEXT): backward/2/bool.h
+enc/trans/escape.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/escape.$(OBJEXT): backward/2/inttypes.h
+enc/trans/escape.$(OBJEXT): backward/2/limits.h
+enc/trans/escape.$(OBJEXT): backward/2/long_long.h
+enc/trans/escape.$(OBJEXT): backward/2/stdalign.h
+enc/trans/escape.$(OBJEXT): backward/2/stdarg.h
+enc/trans/escape.$(OBJEXT): config.h
+enc/trans/escape.$(OBJEXT): defines.h
+enc/trans/escape.$(OBJEXT): enc/trans/escape.c
+enc/trans/escape.$(OBJEXT): intern.h
enc/trans/escape.$(OBJEXT): internal/anyargs.h
enc/trans/escape.$(OBJEXT): internal/arithmetic.h
enc/trans/escape.$(OBJEXT): internal/arithmetic/char.h
@@ -3767,26 +3809,26 @@ enc/trans/escape.$(OBJEXT): internal/value_type.h
enc/trans/escape.$(OBJEXT): internal/variable.h
enc/trans/escape.$(OBJEXT): internal/warning_push.h
enc/trans/escape.$(OBJEXT): internal/xmalloc.h
-enc/trans/escape.$(OBJEXT): assert.h
-enc/trans/escape.$(OBJEXT): backward.h
-enc/trans/escape.$(OBJEXT): backward/2/assume.h
-enc/trans/escape.$(OBJEXT): backward/2/attributes.h
-enc/trans/escape.$(OBJEXT): backward/2/bool.h
-enc/trans/escape.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/escape.$(OBJEXT): backward/2/inttypes.h
-enc/trans/escape.$(OBJEXT): backward/2/limits.h
-enc/trans/escape.$(OBJEXT): backward/2/long_long.h
-enc/trans/escape.$(OBJEXT): backward/2/stdalign.h
-enc/trans/escape.$(OBJEXT): backward/2/stdarg.h
-enc/trans/escape.$(OBJEXT): config.h
-enc/trans/escape.$(OBJEXT): defines.h
-enc/trans/escape.$(OBJEXT): enc/trans/escape.c
-enc/trans/escape.$(OBJEXT): intern.h
enc/trans/escape.$(OBJEXT): missing.h
enc/trans/escape.$(OBJEXT): st.h
enc/trans/escape.$(OBJEXT): subst.h
enc/trans/gb18030.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/gb18030.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/gb18030.$(OBJEXT): assert.h
+enc/trans/gb18030.$(OBJEXT): backward.h
+enc/trans/gb18030.$(OBJEXT): backward/2/assume.h
+enc/trans/gb18030.$(OBJEXT): backward/2/attributes.h
+enc/trans/gb18030.$(OBJEXT): backward/2/bool.h
+enc/trans/gb18030.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/gb18030.$(OBJEXT): backward/2/inttypes.h
+enc/trans/gb18030.$(OBJEXT): backward/2/limits.h
+enc/trans/gb18030.$(OBJEXT): backward/2/long_long.h
+enc/trans/gb18030.$(OBJEXT): backward/2/stdalign.h
+enc/trans/gb18030.$(OBJEXT): backward/2/stdarg.h
+enc/trans/gb18030.$(OBJEXT): config.h
+enc/trans/gb18030.$(OBJEXT): defines.h
+enc/trans/gb18030.$(OBJEXT): enc/trans/gb18030.c
+enc/trans/gb18030.$(OBJEXT): intern.h
enc/trans/gb18030.$(OBJEXT): internal/anyargs.h
enc/trans/gb18030.$(OBJEXT): internal/arithmetic.h
enc/trans/gb18030.$(OBJEXT): internal/arithmetic/char.h
@@ -3926,26 +3968,26 @@ enc/trans/gb18030.$(OBJEXT): internal/value_type.h
enc/trans/gb18030.$(OBJEXT): internal/variable.h
enc/trans/gb18030.$(OBJEXT): internal/warning_push.h
enc/trans/gb18030.$(OBJEXT): internal/xmalloc.h
-enc/trans/gb18030.$(OBJEXT): assert.h
-enc/trans/gb18030.$(OBJEXT): backward.h
-enc/trans/gb18030.$(OBJEXT): backward/2/assume.h
-enc/trans/gb18030.$(OBJEXT): backward/2/attributes.h
-enc/trans/gb18030.$(OBJEXT): backward/2/bool.h
-enc/trans/gb18030.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/gb18030.$(OBJEXT): backward/2/inttypes.h
-enc/trans/gb18030.$(OBJEXT): backward/2/limits.h
-enc/trans/gb18030.$(OBJEXT): backward/2/long_long.h
-enc/trans/gb18030.$(OBJEXT): backward/2/stdalign.h
-enc/trans/gb18030.$(OBJEXT): backward/2/stdarg.h
-enc/trans/gb18030.$(OBJEXT): config.h
-enc/trans/gb18030.$(OBJEXT): defines.h
-enc/trans/gb18030.$(OBJEXT): enc/trans/gb18030.c
-enc/trans/gb18030.$(OBJEXT): intern.h
enc/trans/gb18030.$(OBJEXT): missing.h
enc/trans/gb18030.$(OBJEXT): st.h
enc/trans/gb18030.$(OBJEXT): subst.h
enc/trans/gbk.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/gbk.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/gbk.$(OBJEXT): assert.h
+enc/trans/gbk.$(OBJEXT): backward.h
+enc/trans/gbk.$(OBJEXT): backward/2/assume.h
+enc/trans/gbk.$(OBJEXT): backward/2/attributes.h
+enc/trans/gbk.$(OBJEXT): backward/2/bool.h
+enc/trans/gbk.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/gbk.$(OBJEXT): backward/2/inttypes.h
+enc/trans/gbk.$(OBJEXT): backward/2/limits.h
+enc/trans/gbk.$(OBJEXT): backward/2/long_long.h
+enc/trans/gbk.$(OBJEXT): backward/2/stdalign.h
+enc/trans/gbk.$(OBJEXT): backward/2/stdarg.h
+enc/trans/gbk.$(OBJEXT): config.h
+enc/trans/gbk.$(OBJEXT): defines.h
+enc/trans/gbk.$(OBJEXT): enc/trans/gbk.c
+enc/trans/gbk.$(OBJEXT): intern.h
enc/trans/gbk.$(OBJEXT): internal/anyargs.h
enc/trans/gbk.$(OBJEXT): internal/arithmetic.h
enc/trans/gbk.$(OBJEXT): internal/arithmetic/char.h
@@ -4085,26 +4127,26 @@ enc/trans/gbk.$(OBJEXT): internal/value_type.h
enc/trans/gbk.$(OBJEXT): internal/variable.h
enc/trans/gbk.$(OBJEXT): internal/warning_push.h
enc/trans/gbk.$(OBJEXT): internal/xmalloc.h
-enc/trans/gbk.$(OBJEXT): assert.h
-enc/trans/gbk.$(OBJEXT): backward.h
-enc/trans/gbk.$(OBJEXT): backward/2/assume.h
-enc/trans/gbk.$(OBJEXT): backward/2/attributes.h
-enc/trans/gbk.$(OBJEXT): backward/2/bool.h
-enc/trans/gbk.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/gbk.$(OBJEXT): backward/2/inttypes.h
-enc/trans/gbk.$(OBJEXT): backward/2/limits.h
-enc/trans/gbk.$(OBJEXT): backward/2/long_long.h
-enc/trans/gbk.$(OBJEXT): backward/2/stdalign.h
-enc/trans/gbk.$(OBJEXT): backward/2/stdarg.h
-enc/trans/gbk.$(OBJEXT): config.h
-enc/trans/gbk.$(OBJEXT): defines.h
-enc/trans/gbk.$(OBJEXT): enc/trans/gbk.c
-enc/trans/gbk.$(OBJEXT): intern.h
enc/trans/gbk.$(OBJEXT): missing.h
enc/trans/gbk.$(OBJEXT): st.h
enc/trans/gbk.$(OBJEXT): subst.h
enc/trans/iso2022.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/iso2022.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/iso2022.$(OBJEXT): assert.h
+enc/trans/iso2022.$(OBJEXT): backward.h
+enc/trans/iso2022.$(OBJEXT): backward/2/assume.h
+enc/trans/iso2022.$(OBJEXT): backward/2/attributes.h
+enc/trans/iso2022.$(OBJEXT): backward/2/bool.h
+enc/trans/iso2022.$(OBJEXT): backward/2/gcc_version_since.h
+enc/trans/iso2022.$(OBJEXT): backward/2/inttypes.h
+enc/trans/iso2022.$(OBJEXT): backward/2/limits.h
+enc/trans/iso2022.$(OBJEXT): backward/2/long_long.h
+enc/trans/iso2022.$(OBJEXT): backward/2/stdalign.h
+enc/trans/iso2022.$(OBJEXT): backward/2/stdarg.h
+enc/trans/iso2022.$(OBJEXT): config.h
+enc/trans/iso2022.$(OBJEXT): defines.h
+enc/trans/iso2022.$(OBJEXT): enc/trans/iso2022.c
+enc/trans/iso2022.$(OBJEXT): intern.h
enc/trans/iso2022.$(OBJEXT): internal/anyargs.h
enc/trans/iso2022.$(OBJEXT): internal/arithmetic.h
enc/trans/iso2022.$(OBJEXT): internal/arithmetic/char.h
@@ -4244,26 +4286,26 @@ enc/trans/iso2022.$(OBJEXT): internal/value_type.h
enc/trans/iso2022.$(OBJEXT): internal/variable.h
enc/trans/iso2022.$(OBJEXT): internal/warning_push.h
enc/trans/iso2022.$(OBJEXT): internal/xmalloc.h
-enc/trans/iso2022.$(OBJEXT): assert.h
-enc/trans/iso2022.$(OBJEXT): backward.h
-enc/trans/iso2022.$(OBJEXT): backward/2/assume.h
-enc/trans/iso2022.$(OBJEXT): backward/2/attributes.h
-enc/trans/iso2022.$(OBJEXT): backward/2/bool.h
-enc/trans/iso2022.$(OBJEXT): backward/2/gcc_version_since.h
-enc/trans/iso2022.$(OBJEXT): backward/2/inttypes.h
-enc/trans/iso2022.$(OBJEXT): backward/2/limits.h
-enc/trans/iso2022.$(OBJEXT): backward/2/long_long.h
-enc/trans/iso2022.$(OBJEXT): backward/2/stdalign.h
-enc/trans/iso2022.$(OBJEXT): backward/2/stdarg.h
-enc/trans/iso2022.$(OBJEXT): config.h
-enc/trans/iso2022.$(OBJEXT): defines.h
-enc/trans/iso2022.$(OBJEXT): enc/trans/iso2022.c
-enc/trans/iso2022.$(OBJEXT): intern.h
enc/trans/iso2022.$(OBJEXT): missing.h
enc/trans/iso2022.$(OBJEXT): st.h
enc/trans/iso2022.$(OBJEXT): subst.h
enc/trans/japanese.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/japanese.$(OBJEXT): $(top_srcdir)/transcode_data.h
+enc/trans/japanese.$(OBJEXT): assert.h
+enc/trans/japanese.$(OBJEXT): backward.h
+enc/trans/japanese.$(OBJEXT): backward/2/assume.h
+enc/trans/japanese.$(OBJEXT): backward/2/attributes.h
+enc/trans/japanese.$(OBJEXT): backward/2/bool.h
+enc/trans/japanese.$(OBJEXT): backward/2/gcc_version_since.h