Skip to content

Commit

Permalink
Merge remote-tracking branch 'official/master' into mmtk
Browse files Browse the repository at this point in the history
  • Loading branch information
wks committed Nov 21, 2023
2 parents e0f307a + 4de54c9 commit b4cc207
Show file tree
Hide file tree
Showing 256 changed files with 7,110 additions and 3,158 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ jobs:
- name: test
timeout-minutes: 30
run: make test
shell: cmd
env:
GNUMAKEFLAGS: ''
RUBY_TESTOPTS: '-v --tty=no'
if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test' }}

- name: test-all
timeout-minutes: 45
shell: cmd
run: |
# Actions uses UTF8, causes test failures, similar to normal OS setup
chcp.com 437
make ${{ StartsWith(matrix.test_task, 'test/') && matrix.test_task || 'test-all' }}
env:
RUBY_TESTOPTS: >-
Expand All @@ -147,6 +147,7 @@ jobs:
timeout-minutes: 10
run: |
make ${{ StartsWith(matrix.test_task, 'spec/') && matrix.test_task || 'test-spec' }}
shell: cmd
if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/') }}

- uses: ./src/.github/actions/slack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
../src/configure \
--host wasm32-unknown-wasi \
--with-static-linked-ext \
--with-ext=bigdecimal,ripper,monitor,stringio,pathname \
--with-ext=bigdecimal,cgi/escape,continuation,coverage,date,dbm,digest/bubblebabble,digest,digest/md5,digest/rmd160,digest/sha1,digest/sha2,etc,fcntl,fiber,gdbm,json,json/generator,json/parser,nkf,objspace,pathname,racc/cparse,rbconfig/sizeof,ripper,stringio,strscan,monitor \
LDFLAGS=" \
-Xlinker --stack-first \
-Xlinker -z -Xlinker stack-size=16777216 \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ lcov*.info
# prism
/lib/prism/compiler.rb
/lib/prism/dispatcher.rb
/lib/prism/dot_visitor.rb
/lib/prism/dsl.rb
/lib/prism/mutation_compiler.rb
/lib/prism/node.rb
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ The following bundled gems are updated.
* test-unit 3.6.1
* rexml 3.2.6
* rss 0.3.0
* net-imap 0.4.4
* net-imap 0.4.5
* net-smtp 0.4.0
* rbs 3.2.2
* rbs 3.3.1
* typeprof 0.21.8
* debug 1.8.0

Expand Down
7 changes: 7 additions & 0 deletions benchmark/string_dup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
prelude: |
# frozen_string_literal: true
benchmark:
uplus: |
+"A"
dup: |
"A".dup
37 changes: 37 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ PRISM_FILES = prism/api_node.$(OBJEXT) \
prism/api_pack.$(OBJEXT) \
prism/diagnostic.$(OBJEXT) \
prism/enc/pm_big5.$(OBJEXT) \
prism/enc/pm_cp51932.$(OBJEXT) \
prism/enc/pm_euc_jp.$(OBJEXT) \
prism/enc/pm_gbk.$(OBJEXT) \
prism/enc/pm_shift_jis.$(OBJEXT) \
Expand Down Expand Up @@ -3006,7 +3007,9 @@ class.$(OBJEXT): {$(VPATH)}subst.h
class.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
class.$(OBJEXT): {$(VPATH)}thread_native.h
class.$(OBJEXT): {$(VPATH)}vm_core.h
class.$(OBJEXT): {$(VPATH)}vm_debug.h
class.$(OBJEXT): {$(VPATH)}vm_opts.h
class.$(OBJEXT): {$(VPATH)}vm_sync.h
compar.$(OBJEXT): $(hdrdir)/ruby/ruby.h
compar.$(OBJEXT): $(top_srcdir)/internal/basic_operators.h
compar.$(OBJEXT): $(top_srcdir)/internal/compar.h
Expand Down Expand Up @@ -3441,6 +3444,7 @@ compile.$(OBJEXT): {$(VPATH)}vm_callinfo.h
compile.$(OBJEXT): {$(VPATH)}vm_core.h
compile.$(OBJEXT): {$(VPATH)}vm_debug.h
compile.$(OBJEXT): {$(VPATH)}vm_opts.h
compile.$(OBJEXT): {$(VPATH)}vm_sync.h
compile.$(OBJEXT): {$(VPATH)}yjit.h
complex.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
complex.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
Expand Down Expand Up @@ -3480,6 +3484,7 @@ complex.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
complex.$(OBJEXT): {$(VPATH)}complex.c
complex.$(OBJEXT): {$(VPATH)}config.h
complex.$(OBJEXT): {$(VPATH)}constant.h
complex.$(OBJEXT): {$(VPATH)}debug_counter.h
complex.$(OBJEXT): {$(VPATH)}defines.h
complex.$(OBJEXT): {$(VPATH)}encoding.h
complex.$(OBJEXT): {$(VPATH)}id.h
Expand Down Expand Up @@ -3648,7 +3653,9 @@ complex.$(OBJEXT): {$(VPATH)}subst.h
complex.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
complex.$(OBJEXT): {$(VPATH)}thread_native.h
complex.$(OBJEXT): {$(VPATH)}vm_core.h
complex.$(OBJEXT): {$(VPATH)}vm_debug.h
complex.$(OBJEXT): {$(VPATH)}vm_opts.h
complex.$(OBJEXT): {$(VPATH)}vm_sync.h
cont.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
cont.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
cont.$(OBJEXT): $(CCAN_DIR)/list/list.h
Expand Down Expand Up @@ -4075,6 +4082,7 @@ debug.$(OBJEXT): {$(VPATH)}vm_callinfo.h
debug.$(OBJEXT): {$(VPATH)}vm_core.h
debug.$(OBJEXT): {$(VPATH)}vm_debug.h
debug.$(OBJEXT): {$(VPATH)}vm_opts.h
debug.$(OBJEXT): {$(VPATH)}vm_sync.h
debug_counter.$(OBJEXT): $(hdrdir)/ruby/ruby.h
debug_counter.$(OBJEXT): {$(VPATH)}assert.h
debug_counter.$(OBJEXT): {$(VPATH)}backward/2/assume.h
Expand Down Expand Up @@ -6175,6 +6183,7 @@ enumerator.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
enumerator.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
enumerator.$(OBJEXT): {$(VPATH)}config.h
enumerator.$(OBJEXT): {$(VPATH)}constant.h
enumerator.$(OBJEXT): {$(VPATH)}debug_counter.h
enumerator.$(OBJEXT): {$(VPATH)}defines.h
enumerator.$(OBJEXT): {$(VPATH)}encoding.h
enumerator.$(OBJEXT): {$(VPATH)}enumerator.c
Expand Down Expand Up @@ -6344,7 +6353,9 @@ enumerator.$(OBJEXT): {$(VPATH)}subst.h
enumerator.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
enumerator.$(OBJEXT): {$(VPATH)}thread_native.h
enumerator.$(OBJEXT): {$(VPATH)}vm_core.h
enumerator.$(OBJEXT): {$(VPATH)}vm_debug.h
enumerator.$(OBJEXT): {$(VPATH)}vm_opts.h
enumerator.$(OBJEXT): {$(VPATH)}vm_sync.h
error.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
error.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
error.$(OBJEXT): $(CCAN_DIR)/list/list.h
Expand Down Expand Up @@ -6783,6 +6794,7 @@ eval.$(OBJEXT): {$(VPATH)}vm.h
eval.$(OBJEXT): {$(VPATH)}vm_core.h
eval.$(OBJEXT): {$(VPATH)}vm_debug.h
eval.$(OBJEXT): {$(VPATH)}vm_opts.h
eval.$(OBJEXT): {$(VPATH)}vm_sync.h
explicit_bzero.$(OBJEXT): {$(VPATH)}config.h
explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
explicit_bzero.$(OBJEXT): {$(VPATH)}internal/attr/format.h
Expand Down Expand Up @@ -8489,7 +8501,9 @@ iseq.$(OBJEXT): {$(VPATH)}thread_native.h
iseq.$(OBJEXT): {$(VPATH)}util.h
iseq.$(OBJEXT): {$(VPATH)}vm_callinfo.h
iseq.$(OBJEXT): {$(VPATH)}vm_core.h
iseq.$(OBJEXT): {$(VPATH)}vm_debug.h
iseq.$(OBJEXT): {$(VPATH)}vm_opts.h
iseq.$(OBJEXT): {$(VPATH)}vm_sync.h
iseq.$(OBJEXT): {$(VPATH)}yjit.h
load.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
load.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
Expand Down Expand Up @@ -9235,6 +9249,7 @@ marshal.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
marshal.$(OBJEXT): {$(VPATH)}builtin.h
marshal.$(OBJEXT): {$(VPATH)}config.h
marshal.$(OBJEXT): {$(VPATH)}constant.h
marshal.$(OBJEXT): {$(VPATH)}debug_counter.h
marshal.$(OBJEXT): {$(VPATH)}defines.h
marshal.$(OBJEXT): {$(VPATH)}encindex.h
marshal.$(OBJEXT): {$(VPATH)}encoding.h
Expand Down Expand Up @@ -9408,7 +9423,9 @@ marshal.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
marshal.$(OBJEXT): {$(VPATH)}thread_native.h
marshal.$(OBJEXT): {$(VPATH)}util.h
marshal.$(OBJEXT): {$(VPATH)}vm_core.h
marshal.$(OBJEXT): {$(VPATH)}vm_debug.h
marshal.$(OBJEXT): {$(VPATH)}vm_opts.h
marshal.$(OBJEXT): {$(VPATH)}vm_sync.h
math.$(OBJEXT): $(hdrdir)/ruby/ruby.h
math.$(OBJEXT): $(top_srcdir)/internal/bignum.h
math.$(OBJEXT): $(top_srcdir)/internal/class.h
Expand Down Expand Up @@ -10664,6 +10681,7 @@ object.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
object.$(OBJEXT): {$(VPATH)}builtin.h
object.$(OBJEXT): {$(VPATH)}config.h
object.$(OBJEXT): {$(VPATH)}constant.h
object.$(OBJEXT): {$(VPATH)}debug_counter.h
object.$(OBJEXT): {$(VPATH)}defines.h
object.$(OBJEXT): {$(VPATH)}encoding.h
object.$(OBJEXT): {$(VPATH)}id.h
Expand Down Expand Up @@ -10839,7 +10857,9 @@ object.$(OBJEXT): {$(VPATH)}thread_native.h
object.$(OBJEXT): {$(VPATH)}util.h
object.$(OBJEXT): {$(VPATH)}variable.h
object.$(OBJEXT): {$(VPATH)}vm_core.h
object.$(OBJEXT): {$(VPATH)}vm_debug.h
object.$(OBJEXT): {$(VPATH)}vm_opts.h
object.$(OBJEXT): {$(VPATH)}vm_sync.h
pack.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
pack.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
pack.$(OBJEXT): $(CCAN_DIR)/list/list.h
Expand Down Expand Up @@ -11736,6 +11756,10 @@ prism/enc/pm_big5.$(OBJEXT): $(top_srcdir)/prism/defines.h
prism/enc/pm_big5.$(OBJEXT): $(top_srcdir)/prism/enc/pm_big5.c
prism/enc/pm_big5.$(OBJEXT): $(top_srcdir)/prism/enc/pm_encoding.h
prism/enc/pm_big5.$(OBJEXT): {$(VPATH)}config.h
prism/enc/pm_cp51932.$(OBJEXT): $(top_srcdir)/prism/defines.h
prism/enc/pm_cp51932.$(OBJEXT): $(top_srcdir)/prism/enc/pm_cp51932.c
prism/enc/pm_cp51932.$(OBJEXT): $(top_srcdir)/prism/enc/pm_encoding.h
prism/enc/pm_cp51932.$(OBJEXT): {$(VPATH)}config.h
prism/enc/pm_euc_jp.$(OBJEXT): $(top_srcdir)/prism/defines.h
prism/enc/pm_euc_jp.$(OBJEXT): $(top_srcdir)/prism/enc/pm_encoding.h
prism/enc/pm_euc_jp.$(OBJEXT): $(top_srcdir)/prism/enc/pm_euc_jp.c
Expand Down Expand Up @@ -12432,6 +12456,7 @@ proc.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
proc.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
proc.$(OBJEXT): {$(VPATH)}config.h
proc.$(OBJEXT): {$(VPATH)}constant.h
proc.$(OBJEXT): {$(VPATH)}debug_counter.h
proc.$(OBJEXT): {$(VPATH)}defines.h
proc.$(OBJEXT): {$(VPATH)}encoding.h
proc.$(OBJEXT): {$(VPATH)}eval_intern.h
Expand Down Expand Up @@ -12603,7 +12628,9 @@ proc.$(OBJEXT): {$(VPATH)}subst.h
proc.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
proc.$(OBJEXT): {$(VPATH)}thread_native.h
proc.$(OBJEXT): {$(VPATH)}vm_core.h
proc.$(OBJEXT): {$(VPATH)}vm_debug.h
proc.$(OBJEXT): {$(VPATH)}vm_opts.h
proc.$(OBJEXT): {$(VPATH)}vm_sync.h
proc.$(OBJEXT): {$(VPATH)}yjit.h
process.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
process.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
Expand Down Expand Up @@ -15291,9 +15318,11 @@ rjit_c.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
rjit_c.$(OBJEXT): {$(VPATH)}thread_native.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_callinfo.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_core.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_debug.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_exec.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_insnhelper.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_opts.h
rjit_c.$(OBJEXT): {$(VPATH)}vm_sync.h
rjit_c.$(OBJEXT): {$(VPATH)}yjit.h
ruby-runner.$(OBJEXT): {$(VPATH)}config.h
ruby-runner.$(OBJEXT): {$(VPATH)}internal/compiler_is.h
Expand Down Expand Up @@ -17160,6 +17189,7 @@ struct.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
struct.$(OBJEXT): {$(VPATH)}builtin.h
struct.$(OBJEXT): {$(VPATH)}config.h
struct.$(OBJEXT): {$(VPATH)}constant.h
struct.$(OBJEXT): {$(VPATH)}debug_counter.h
struct.$(OBJEXT): {$(VPATH)}defines.h
struct.$(OBJEXT): {$(VPATH)}encoding.h
struct.$(OBJEXT): {$(VPATH)}id.h
Expand Down Expand Up @@ -17329,7 +17359,9 @@ struct.$(OBJEXT): {$(VPATH)}subst.h
struct.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
struct.$(OBJEXT): {$(VPATH)}thread_native.h
struct.$(OBJEXT): {$(VPATH)}vm_core.h
struct.$(OBJEXT): {$(VPATH)}vm_debug.h
struct.$(OBJEXT): {$(VPATH)}vm_opts.h
struct.$(OBJEXT): {$(VPATH)}vm_sync.h
symbol.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
symbol.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
symbol.$(OBJEXT): $(CCAN_DIR)/list/list.h
Expand Down Expand Up @@ -19044,6 +19076,7 @@ vm_backtrace.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
vm_backtrace.$(OBJEXT): {$(VPATH)}config.h
vm_backtrace.$(OBJEXT): {$(VPATH)}constant.h
vm_backtrace.$(OBJEXT): {$(VPATH)}debug.h
vm_backtrace.$(OBJEXT): {$(VPATH)}debug_counter.h
vm_backtrace.$(OBJEXT): {$(VPATH)}defines.h
vm_backtrace.$(OBJEXT): {$(VPATH)}encoding.h
vm_backtrace.$(OBJEXT): {$(VPATH)}eval_intern.h
Expand Down Expand Up @@ -19215,7 +19248,9 @@ vm_backtrace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
vm_backtrace.$(OBJEXT): {$(VPATH)}thread_native.h
vm_backtrace.$(OBJEXT): {$(VPATH)}vm_backtrace.c
vm_backtrace.$(OBJEXT): {$(VPATH)}vm_core.h
vm_backtrace.$(OBJEXT): {$(VPATH)}vm_debug.h
vm_backtrace.$(OBJEXT): {$(VPATH)}vm_opts.h
vm_backtrace.$(OBJEXT): {$(VPATH)}vm_sync.h
vm_dump.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
vm_dump.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
vm_dump.$(OBJEXT): $(CCAN_DIR)/list/list.h
Expand Down Expand Up @@ -19832,7 +19867,9 @@ vm_trace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
vm_trace.$(OBJEXT): {$(VPATH)}thread_native.h
vm_trace.$(OBJEXT): {$(VPATH)}trace_point.rbinc
vm_trace.$(OBJEXT): {$(VPATH)}vm_core.h
vm_trace.$(OBJEXT): {$(VPATH)}vm_debug.h
vm_trace.$(OBJEXT): {$(VPATH)}vm_opts.h
vm_trace.$(OBJEXT): {$(VPATH)}vm_sync.h
vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c
vm_trace.$(OBJEXT): {$(VPATH)}yjit.h
weakmap.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
Expand Down
26 changes: 7 additions & 19 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -11131,7 +11131,7 @@ struct ibf_load {

struct pinned_list {
long size;
VALUE * buffer;
VALUE buffer[1];
};

static void
Expand All @@ -11146,25 +11146,16 @@ pinned_list_mark(void *ptr)
}
}

static void
pinned_list_free(void *ptr)
{
struct pinned_list *list = (struct pinned_list *)ptr;
xfree(list->buffer);
xfree(ptr);
}

static size_t
pinned_list_memsize(const void *ptr)
{
struct pinned_list *list = (struct pinned_list *)ptr;
return sizeof(struct pinned_list) + (list->size * sizeof(VALUE *));
return 0;
}

static const rb_data_type_t pinned_list_type = {
"pinned_list",
{pinned_list_mark, pinned_list_free, pinned_list_memsize,},
0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
{pinned_list_mark, RUBY_DEFAULT_FREE, pinned_list_memsize,},
0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_EMBEDDABLE
};

static VALUE
Expand Down Expand Up @@ -11198,13 +11189,10 @@ pinned_list_store(VALUE list, long offset, VALUE object)
static VALUE
pinned_list_new(long size)
{
struct pinned_list * ptr;
VALUE obj_list =
TypedData_Make_Struct(0, struct pinned_list, &pinned_list_type, ptr);

ptr->buffer = xcalloc(size, sizeof(VALUE));
size_t memsize = offsetof(struct pinned_list, buffer) + size * sizeof(VALUE);
VALUE obj_list = rb_data_typed_object_zalloc(0, memsize, &pinned_list_type);
struct pinned_list * ptr = RTYPEDDATA_GET_DATA(obj_list);
ptr->size = size;

return obj_list;
}

Expand Down
Loading

0 comments on commit b4cc207

Please sign in to comment.