Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Ractor-Local-GC-v…
Browse files Browse the repository at this point in the history
…ersion-2
  • Loading branch information
rm155 committed Mar 27, 2024
2 parents 804f00a + e4d6479 commit 814f4b8
Show file tree
Hide file tree
Showing 198 changed files with 2,847 additions and 1,128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
timeout-minutes: 60
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'minitest,test-unit,debug,bigdecimal,drb,typeprof'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
PRECHECK_BUNDLED_GEMS: 'no'

- name: make skipped tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
timeout-minutes: 40
env:
GNUMAKEFLAGS: ''
RUBY_TESTOPTS: '-q --tty=no --excludes-dir="../src/test/.excludes-prism" --exclude="test_ast.rb" --exclude="test_regexp.rb" --exclude="error_highlight/test_error_highlight.rb" --exclude="prism/encoding_test.rb"'
RUBY_TESTOPTS: '-q --tty=no --excludes-dir="../src/test/.excludes-prism" --exclude="test_ast.rb" --exclude="error_highlight/test_error_highlight.rb" --exclude="prism/encoding_test.rb"'
RUN_OPTS: ${{ matrix.run_opts }}

- name: make test-prism-spec
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
timeout-minutes: 40
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'minitest,test-unit,debug,bigdecimal,drb,typeprof'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
PRECHECK_BUNDLED_GEMS: 'no'

- name: make skipped tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
timeout-minutes: 60
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'minitest,test-unit,debug,bigdecimal,drb,typeprof'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
PRECHECK_BUNDLED_GEMS: 'no'
SYNTAX_SUGGEST_TIMEOUT: '5'
YJIT_BINDGEN_DIFF_OPTS: '--exit-code'
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The following bundled gems are updated.
* test-unit 3.6.2
* net-ftp 0.3.4
* net-imap 0.4.10
* net-smtp 0.4.0.1
* net-smtp 0.5.0
* rbs 3.4.4
* typeprof 0.21.11
* debug 1.9.1
Expand Down
44 changes: 44 additions & 0 deletions bootstraptest/test_yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4725,3 +4725,47 @@ def test_cases(file, chain)
test_cases(File, Enumerator::Chain)
}

# singleton class should invalidate Type::CString assumption
assert_equal 'foo', %q{
def define_singleton(str, define)
if define
# Wrap a C method frame to avoid exiting JIT code on defineclass
[nil].reverse_each do
class << str
def +(_)
"foo"
end
end
end
end
"bar"
end
def entry(define)
str = ""
# When `define` is false, #+ compiles to rb_str_plus() without a class guard.
# When the code is reused with `define` is true, the class of `str` is changed
# to a singleton class, so the block should be invalidated.
str + define_singleton(str, define)
end
entry(false)
entry(true)
}

assert_equal '[:ok, :ok, :ok]', %q{
def identity(x) = x
def foo(x, _) = x
def bar(_, _, _, _, x) = x
def tests
[
identity(:ok),
foo(:ok, 2),
bar(1, 2, 3, 4, :ok),
]
end
tests
}
2 changes: 2 additions & 0 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "ractor_core.h"
#include "ruby/st.h"
#include "vm_core.h"
#include "yjit.h"

/* Flags of T_CLASS
*
Expand Down Expand Up @@ -867,6 +868,7 @@ make_singleton_class(VALUE obj)
FL_SET(klass, FL_SINGLETON);
RBASIC_SET_CLASS(obj, klass);
rb_singleton_class_attached(klass, obj);
rb_yjit_invalidate_no_singleton_class(orig_class);

SET_METACLASS_OF(klass, METACLASS_OF(rb_class_real(orig_class)));
return klass;
Expand Down
1 change: 1 addition & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3106,6 +3106,7 @@ class.$(OBJEXT): {$(VPATH)}vm_core.h
class.$(OBJEXT): {$(VPATH)}vm_debug.h
class.$(OBJEXT): {$(VPATH)}vm_opts.h
class.$(OBJEXT): {$(VPATH)}vm_sync.h
class.$(OBJEXT): {$(VPATH)}yjit.h
compar.$(OBJEXT): $(hdrdir)/ruby/ruby.h
compar.$(OBJEXT): $(hdrdir)/ruby/version.h
compar.$(OBJEXT): $(top_srcdir)/internal/basic_operators.h
Expand Down
28 changes: 14 additions & 14 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ ruby_env_debug_option(const char *str, int len, void *arg)
int ov;
size_t retlen;
unsigned long n;
#define NAME_MATCH(name) (len == sizeof(name) - 1 && strncmp(str, (name), len) == 0)
#define SET_WHEN(name, var, val) do { \
if (len == sizeof(name) - 1 && \
strncmp(str, (name), len) == 0) { \
if (NAME_MATCH(name)) { \
(var) = (val); \
return 1; \
} \
Expand Down Expand Up @@ -219,27 +219,27 @@ ruby_env_debug_option(const char *str, int len, void *arg)
} \
} while (0)
#define SET_WHEN_UINT(name, vals, num, req) \
if (NAME_MATCH_VALUE(name)) SET_UINT_LIST(name, vals, num);
if (NAME_MATCH_VALUE(name)) { \
if (!len) req; \
else SET_UINT_LIST(name, vals, num); \
return 1; \
}

SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
SET_WHEN("core", ruby_enable_coredump, 1);
SET_WHEN("ci", ruby_on_ci, 1);
if (NAME_MATCH_VALUE("rgengc")) {
if (!len) ruby_rgengc_debug = 1;
else SET_UINT_LIST("rgengc", &ruby_rgengc_debug, 1);
if (NAME_MATCH("gc_stress")) {
rb_gc_initial_stress_set(Qtrue);
return 1;
}
SET_WHEN("core", ruby_enable_coredump, 1);
SET_WHEN("ci", ruby_on_ci, 1);
SET_WHEN_UINT("rgengc", &ruby_rgengc_debug, 1, ruby_rgengc_debug = 1);
#if defined _WIN32
# if RUBY_MSVCRT_VERSION >= 80
SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
# endif
#endif
#if defined _WIN32 || defined __CYGWIN__
if (NAME_MATCH_VALUE("codepage")) {
if (!len) fprintf(stderr, "missing codepage argument");
else SET_UINT_LIST("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage));
return 1;
}
SET_WHEN_UINT("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage),
fprintf(stderr, "missing codepage argument"));
#endif
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion doc/syntax/calling_methods.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ definition. If a keyword argument is given that the method did not list,
and the method definition does not accept arbitrary keyword arguments, an
ArgumentError will be raised.

Keyword argument value can be omitted, meaning the value will be be fetched
Keyword argument value can be omitted, meaning the value will be fetched
from the context by the name of the key

keyword1 = 'some value'
Expand Down
13 changes: 13 additions & 0 deletions ext/-test-/string/chilled.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "ruby.h"

static VALUE
bug_s_rb_str_chilled_p(VALUE self, VALUE str)
{
return rb_str_chilled_p(str) ? Qtrue : Qfalse;
}

void
Init_string_chilled(VALUE klass)
{
rb_define_singleton_method(klass, "rb_str_chilled_p", bug_s_rb_str_chilled_p, 1);
}
159 changes: 159 additions & 0 deletions ext/-test-/string/depend
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,165 @@ capacity.o: $(hdrdir)/ruby/subst.h
capacity.o: $(top_srcdir)/internal/compilers.h
capacity.o: $(top_srcdir)/internal/string.h
capacity.o: capacity.c
chilled.o: $(RUBY_EXTCONF_H)
chilled.o: $(arch_hdrdir)/ruby/config.h
chilled.o: $(hdrdir)/ruby.h
chilled.o: $(hdrdir)/ruby/assert.h
chilled.o: $(hdrdir)/ruby/backward.h
chilled.o: $(hdrdir)/ruby/backward/2/assume.h
chilled.o: $(hdrdir)/ruby/backward/2/attributes.h
chilled.o: $(hdrdir)/ruby/backward/2/bool.h
chilled.o: $(hdrdir)/ruby/backward/2/inttypes.h
chilled.o: $(hdrdir)/ruby/backward/2/limits.h
chilled.o: $(hdrdir)/ruby/backward/2/long_long.h
chilled.o: $(hdrdir)/ruby/backward/2/stdalign.h
chilled.o: $(hdrdir)/ruby/backward/2/stdarg.h
chilled.o: $(hdrdir)/ruby/defines.h
chilled.o: $(hdrdir)/ruby/intern.h
chilled.o: $(hdrdir)/ruby/internal/abi.h
chilled.o: $(hdrdir)/ruby/internal/anyargs.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/char.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/double.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/fixnum.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/gid_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/int.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/intptr_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/long.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/long_long.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/mode_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/off_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/pid_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/short.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/size_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/st_data_t.h
chilled.o: $(hdrdir)/ruby/internal/arithmetic/uid_t.h
chilled.o: $(hdrdir)/ruby/internal/assume.h
chilled.o: $(hdrdir)/ruby/internal/attr/alloc_size.h
chilled.o: $(hdrdir)/ruby/internal/attr/artificial.h
chilled.o: $(hdrdir)/ruby/internal/attr/cold.h
chilled.o: $(hdrdir)/ruby/internal/attr/const.h
chilled.o: $(hdrdir)/ruby/internal/attr/constexpr.h
chilled.o: $(hdrdir)/ruby/internal/attr/deprecated.h
chilled.o: $(hdrdir)/ruby/internal/attr/diagnose_if.h
chilled.o: $(hdrdir)/ruby/internal/attr/enum_extensibility.h
chilled.o: $(hdrdir)/ruby/internal/attr/error.h
chilled.o: $(hdrdir)/ruby/internal/attr/flag_enum.h
chilled.o: $(hdrdir)/ruby/internal/attr/forceinline.h
chilled.o: $(hdrdir)/ruby/internal/attr/format.h
chilled.o: $(hdrdir)/ruby/internal/attr/maybe_unused.h
chilled.o: $(hdrdir)/ruby/internal/attr/noalias.h
chilled.o: $(hdrdir)/ruby/internal/attr/nodiscard.h
chilled.o: $(hdrdir)/ruby/internal/attr/noexcept.h
chilled.o: $(hdrdir)/ruby/internal/attr/noinline.h
chilled.o: $(hdrdir)/ruby/internal/attr/nonnull.h
chilled.o: $(hdrdir)/ruby/internal/attr/noreturn.h
chilled.o: $(hdrdir)/ruby/internal/attr/packed_struct.h
chilled.o: $(hdrdir)/ruby/internal/attr/pure.h
chilled.o: $(hdrdir)/ruby/internal/attr/restrict.h
chilled.o: $(hdrdir)/ruby/internal/attr/returns_nonnull.h
chilled.o: $(hdrdir)/ruby/internal/attr/warning.h
chilled.o: $(hdrdir)/ruby/internal/attr/weakref.h
chilled.o: $(hdrdir)/ruby/internal/cast.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is/apple.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is/clang.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is/gcc.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is/intel.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is/msvc.h
chilled.o: $(hdrdir)/ruby/internal/compiler_is/sunpro.h
chilled.o: $(hdrdir)/ruby/internal/compiler_since.h
chilled.o: $(hdrdir)/ruby/internal/config.h
chilled.o: $(hdrdir)/ruby/internal/constant_p.h
chilled.o: $(hdrdir)/ruby/internal/core.h
chilled.o: $(hdrdir)/ruby/internal/core/rarray.h
chilled.o: $(hdrdir)/ruby/internal/core/rbasic.h
chilled.o: $(hdrdir)/ruby/internal/core/rbignum.h
chilled.o: $(hdrdir)/ruby/internal/core/rclass.h
chilled.o: $(hdrdir)/ruby/internal/core/rdata.h
chilled.o: $(hdrdir)/ruby/internal/core/rfile.h
chilled.o: $(hdrdir)/ruby/internal/core/rhash.h
chilled.o: $(hdrdir)/ruby/internal/core/robject.h
chilled.o: $(hdrdir)/ruby/internal/core/rregexp.h
chilled.o: $(hdrdir)/ruby/internal/core/rstring.h
chilled.o: $(hdrdir)/ruby/internal/core/rstruct.h
chilled.o: $(hdrdir)/ruby/internal/core/rtypeddata.h
chilled.o: $(hdrdir)/ruby/internal/ctype.h
chilled.o: $(hdrdir)/ruby/internal/dllexport.h
chilled.o: $(hdrdir)/ruby/internal/dosish.h
chilled.o: $(hdrdir)/ruby/internal/error.h
chilled.o: $(hdrdir)/ruby/internal/eval.h
chilled.o: $(hdrdir)/ruby/internal/event.h
chilled.o: $(hdrdir)/ruby/internal/fl_type.h
chilled.o: $(hdrdir)/ruby/internal/gc.h
chilled.o: $(hdrdir)/ruby/internal/glob.h
chilled.o: $(hdrdir)/ruby/internal/globals.h
chilled.o: $(hdrdir)/ruby/internal/has/attribute.h
chilled.o: $(hdrdir)/ruby/internal/has/builtin.h
chilled.o: $(hdrdir)/ruby/internal/has/c_attribute.h
chilled.o: $(hdrdir)/ruby/internal/has/cpp_attribute.h
chilled.o: $(hdrdir)/ruby/internal/has/declspec_attribute.h
chilled.o: $(hdrdir)/ruby/internal/has/extension.h
chilled.o: $(hdrdir)/ruby/internal/has/feature.h
chilled.o: $(hdrdir)/ruby/internal/has/warning.h
chilled.o: $(hdrdir)/ruby/internal/intern/array.h
chilled.o: $(hdrdir)/ruby/internal/intern/bignum.h
chilled.o: $(hdrdir)/ruby/internal/intern/class.h
chilled.o: $(hdrdir)/ruby/internal/intern/compar.h
chilled.o: $(hdrdir)/ruby/internal/intern/complex.h
chilled.o: $(hdrdir)/ruby/internal/intern/cont.h
chilled.o: $(hdrdir)/ruby/internal/intern/dir.h
chilled.o: $(hdrdir)/ruby/internal/intern/enum.h
chilled.o: $(hdrdir)/ruby/internal/intern/enumerator.h
chilled.o: $(hdrdir)/ruby/internal/intern/error.h
chilled.o: $(hdrdir)/ruby/internal/intern/eval.h
chilled.o: $(hdrdir)/ruby/internal/intern/file.h
chilled.o: $(hdrdir)/ruby/internal/intern/hash.h
chilled.o: $(hdrdir)/ruby/internal/intern/io.h
chilled.o: $(hdrdir)/ruby/internal/intern/load.h
chilled.o: $(hdrdir)/ruby/internal/intern/marshal.h
chilled.o: $(hdrdir)/ruby/internal/intern/numeric.h
chilled.o: $(hdrdir)/ruby/internal/intern/object.h
chilled.o: $(hdrdir)/ruby/internal/intern/parse.h
chilled.o: $(hdrdir)/ruby/internal/intern/proc.h
chilled.o: $(hdrdir)/ruby/internal/intern/process.h
chilled.o: $(hdrdir)/ruby/internal/intern/random.h
chilled.o: $(hdrdir)/ruby/internal/intern/range.h
chilled.o: $(hdrdir)/ruby/internal/intern/rational.h
chilled.o: $(hdrdir)/ruby/internal/intern/re.h
chilled.o: $(hdrdir)/ruby/internal/intern/ruby.h
chilled.o: $(hdrdir)/ruby/internal/intern/select.h
chilled.o: $(hdrdir)/ruby/internal/intern/select/largesize.h
chilled.o: $(hdrdir)/ruby/internal/intern/signal.h
chilled.o: $(hdrdir)/ruby/internal/intern/sprintf.h
chilled.o: $(hdrdir)/ruby/internal/intern/string.h
chilled.o: $(hdrdir)/ruby/internal/intern/struct.h
chilled.o: $(hdrdir)/ruby/internal/intern/thread.h
chilled.o: $(hdrdir)/ruby/internal/intern/time.h
chilled.o: $(hdrdir)/ruby/internal/intern/variable.h
chilled.o: $(hdrdir)/ruby/internal/intern/vm.h
chilled.o: $(hdrdir)/ruby/internal/interpreter.h
chilled.o: $(hdrdir)/ruby/internal/iterator.h
chilled.o: $(hdrdir)/ruby/internal/memory.h
chilled.o: $(hdrdir)/ruby/internal/method.h
chilled.o: $(hdrdir)/ruby/internal/module.h
chilled.o: $(hdrdir)/ruby/internal/newobj.h
chilled.o: $(hdrdir)/ruby/internal/scan_args.h
chilled.o: $(hdrdir)/ruby/internal/special_consts.h
chilled.o: $(hdrdir)/ruby/internal/static_assert.h
chilled.o: $(hdrdir)/ruby/internal/stdalign.h
chilled.o: $(hdrdir)/ruby/internal/stdbool.h
chilled.o: $(hdrdir)/ruby/internal/symbol.h
chilled.o: $(hdrdir)/ruby/internal/value.h
chilled.o: $(hdrdir)/ruby/internal/value_type.h
chilled.o: $(hdrdir)/ruby/internal/variable.h
chilled.o: $(hdrdir)/ruby/internal/warning_push.h
chilled.o: $(hdrdir)/ruby/internal/xmalloc.h
chilled.o: $(hdrdir)/ruby/missing.h
chilled.o: $(hdrdir)/ruby/ruby.h
chilled.o: $(hdrdir)/ruby/st.h
chilled.o: $(hdrdir)/ruby/subst.h
chilled.o: chilled.c
coderange.o: $(RUBY_EXTCONF_H)
coderange.o: $(arch_hdrdir)/ruby/config.h
coderange.o: $(hdrdir)/ruby/assert.h
Expand Down
Loading

0 comments on commit 814f4b8

Please sign in to comment.