Skip to content

Commit b543ec0

Browse files
committed
New upstream version 3.0.2
1 parent a35d528 commit b543ec0

File tree

374 files changed

+10059
-4693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+10059
-4693
lines changed

ChangeLog

Lines changed: 1527 additions & 0 deletions
Large diffs are not rendered by default.

README.ja.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ Rubyリポジトリの本来のmasterは https://git.ruby-lang.org/ruby.git に
5252

5353
### Subversion
5454

55-
古いRubyのバージョンのソースコードは次のコマンドで取得できます
55+
古いRubyのバージョンのソースコードは次のコマンドでも取得できます
5656

5757
$ svn co https://svn.ruby-lang.org/repos/ruby/branches/ruby_2_6/ ruby
5858

59-
他に開発中のブランチの一覧は次のコマンドで見られます
59+
他のブランチの一覧は次のコマンドで見られます
6060

6161
$ svn ls https://svn.ruby-lang.org/repos/ruby/branches/
6262

@@ -71,31 +71,26 @@ https://www.ruby-lang.org/
7171

7272
## メーリングリスト
7373

74-
Rubyのメーリングリストがあります.参加希望の方は
75-
76-
77-
78-
まで本文に
74+
Rubyのメーリングリストがあります.参加希望の方は [[email protected]] まで本文に
7975

8076
subscribe
8177

8278
と書いて送って下さい.
8379

84-
Ruby開発者向けメーリングリストもあります.こちらではrubyのバグ,将来の仕様拡張など実装上の問題について議論されています. 参加希望の方は
85-
86-
87-
88-
までruby-listと同様の方法でメールしてください.
80+
Ruby開発者向けメーリングリストもあります.こちらではrubyのバグ,将来の仕様拡張など実装上の問題について議論されています.
81+
参加希望の方は [[email protected]] までruby-listと同様の方法でメールしてください.
8982

9083
Ruby拡張モジュールについて話し合うruby-extメーリングリストと数学関係の話題について話し合うruby-mathメーリングリストと
9184
英語でrubyについて話し合うruby-talkメーリングリストもあります.参加方法はどれも同じです.
9285

86+
[[email protected]]: mailto:[email protected]?subject=Join%20Ruby%20Mailing%20List&body=subscribe
87+
[[email protected]]: mailto:[email protected]?subject=Join%20Ruby%20Mailing%20List&body=subscribe
88+
9389
## コンパイル・インストール
9490

9591
以下の手順で行ってください.
9692

97-
1. もし `configure` ファイルが見つからない,もしくは `configure.ac` より古いようなら, `autoconf` を実行して
98-
新しく `configure` を生成する
93+
1. (Gitリポジトリから取得したソースをビルドする場合) `./autogen.sh` を実行して新しく `configure` を生成する
9994

10095
2. `configure` を実行して `Makefile` などを生成する
10196

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ if you are a committer.
5151

5252
### Subversion
5353

54-
Stable branches for older Ruby versions can be checked out with the following command:
54+
Stable branches for older Ruby versions can be checked out with also the
55+
following command:
5556

5657
$ svn co https://svn.ruby-lang.org/repos/ruby/branches/ruby_2_6/ ruby
5758

@@ -71,16 +72,17 @@ send the following phrase:
7172

7273
subscribe
7374

74-
in the mail body (not subject) to the address
75-
[[email protected]](mailto:[email protected]?subject=Join%20Ruby%20Mailing%20List&body=subscribe).
75+
in the mail body (not subject) to the address [[email protected]].
76+
77+
[[email protected]]: mailto:[email protected]?subject=Join%20Ruby%20Mailing%20List&body=subscribe
7678

7779
## How to compile and install
7880

7981
1. If you want to use Microsoft Visual C++ to compile Ruby, read
8082
[win32/README.win32](win32/README.win32) instead of this document.
8183

82-
2. If `./configure` does not exist or is older than `configure.ac`, run
83-
`autoconf` to (re)generate configure.
84+
2. Run `./autogen.sh` to generate configure, when you build the source checked
85+
out from the Git repository.
8486

8587
3. Run `./configure`, which will generate `config.h` and `Makefile`.
8688

aclocal.m4

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +0,0 @@
1-
# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
2-
3-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
4-
5-
# This file is free software; the Free Software Foundation
6-
# gives unlimited permission to copy and/or distribute it,
7-
# with or without modifications, as long as this notice is preserved.
8-
9-
# This program is distributed in the hope that it will be useful,
10-
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11-
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12-
# PARTICULAR PURPOSE.
13-
14-
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15-
m4_include([tool/m4/_colorize_result_prepare.m4])
16-
m4_include([tool/m4/ac_msg_result.m4])
17-
m4_include([tool/m4/colorize_result.m4])
18-
m4_include([tool/m4/ruby_append_option.m4])
19-
m4_include([tool/m4/ruby_append_options.m4])
20-
m4_include([tool/m4/ruby_check_builtin_func.m4])
21-
m4_include([tool/m4/ruby_check_builtin_setjmp.m4])
22-
m4_include([tool/m4/ruby_check_printf_prefix.m4])
23-
m4_include([tool/m4/ruby_check_setjmp.m4])
24-
m4_include([tool/m4/ruby_check_signedness.m4])
25-
m4_include([tool/m4/ruby_check_sizeof.m4])
26-
m4_include([tool/m4/ruby_check_sysconf.m4])
27-
m4_include([tool/m4/ruby_cppoutfile.m4])
28-
m4_include([tool/m4/ruby_decl_attribute.m4])
29-
m4_include([tool/m4/ruby_default_arch.m4])
30-
m4_include([tool/m4/ruby_define_if.m4])
31-
m4_include([tool/m4/ruby_defint.m4])
32-
m4_include([tool/m4/ruby_dtrace_available.m4])
33-
m4_include([tool/m4/ruby_dtrace_postprocess.m4])
34-
m4_include([tool/m4/ruby_func_attribute.m4])
35-
m4_include([tool/m4/ruby_mingw32.m4])
36-
m4_include([tool/m4/ruby_prepend_option.m4])
37-
m4_include([tool/m4/ruby_prog_gnu_ld.m4])
38-
m4_include([tool/m4/ruby_replace_funcs.m4])
39-
m4_include([tool/m4/ruby_replace_type.m4])
40-
m4_include([tool/m4/ruby_rm_recursive.m4])
41-
m4_include([tool/m4/ruby_setjmp_type.m4])
42-
m4_include([tool/m4/ruby_stack_grow_direction.m4])
43-
m4_include([tool/m4/ruby_try_cflags.m4])
44-
m4_include([tool/m4/ruby_try_cxxflags.m4])
45-
m4_include([tool/m4/ruby_try_ldflags.m4])
46-
m4_include([tool/m4/ruby_type_attribute.m4])
47-
m4_include([tool/m4/ruby_universal_arch.m4])
48-
m4_include([tool/m4/ruby_werror_flag.m4])

array.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,6 +3838,7 @@ select_bang_ensure(VALUE a)
38383838

38393839
if (i2 < len && i2 < i1) {
38403840
long tail = 0;
3841+
rb_ary_modify(ary);
38413842
if (i1 < len) {
38423843
tail = len - i1;
38433844
RARRAY_PTR_USE_TRANSIENT(ary, ptr, {

autogen.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
PWD=
4+
case "$0" in
5+
*/*) srcdir=`dirname $0`;;
6+
*) srcdir="";;
7+
esac
8+
9+
exec ${AUTORECONF:-autoreconf} --install --symlink "$@" ${srcdir:+"$srcdir"}

class.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,10 +1134,12 @@ cache_clear_refined_method(ID key, VALUE value, void *data)
11341134
{
11351135
rb_method_entry_t *me = (rb_method_entry_t *) value;
11361136

1137-
if (me->def->type == VM_METHOD_TYPE_REFINED) {
1137+
if (me->def->type == VM_METHOD_TYPE_REFINED && me->def->body.refined.orig_me) {
11381138
VALUE klass = (VALUE)data;
11391139
rb_clear_method_cache(klass, me->called_id);
11401140
}
1141+
// Refined method entries without an orig_me is going to stay in the method
1142+
// table of klass, like before the move, so no need to clear the cache.
11411143

11421144
return ID_TABLE_CONTINUE;
11431145
}

common.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,6 +2803,7 @@ compile.$(OBJEXT): $(top_srcdir)/internal/hash.h
28032803
compile.$(OBJEXT): $(top_srcdir)/internal/imemo.h
28042804
compile.$(OBJEXT): $(top_srcdir)/internal/numeric.h
28052805
compile.$(OBJEXT): $(top_srcdir)/internal/object.h
2806+
compile.$(OBJEXT): $(top_srcdir)/internal/rational.h
28062807
compile.$(OBJEXT): $(top_srcdir)/internal/re.h
28072808
compile.$(OBJEXT): $(top_srcdir)/internal/serial.h
28082809
compile.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
@@ -8428,6 +8429,7 @@ mjit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
84288429
mjit.$(OBJEXT): $(hdrdir)/ruby/version.h
84298430
mjit.$(OBJEXT): $(top_srcdir)/internal/array.h
84308431
mjit.$(OBJEXT): $(top_srcdir)/internal/class.h
8432+
mjit.$(OBJEXT): $(top_srcdir)/internal/compile.h
84318433
mjit.$(OBJEXT): $(top_srcdir)/internal/compilers.h
84328434
mjit.$(OBJEXT): $(top_srcdir)/internal/cont.h
84338435
mjit.$(OBJEXT): $(top_srcdir)/internal/file.h
@@ -8449,6 +8451,7 @@ mjit.$(OBJEXT): {$(VPATH)}backward/2/limits.h
84498451
mjit.$(OBJEXT): {$(VPATH)}backward/2/long_long.h
84508452
mjit.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
84518453
mjit.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
8454+
mjit.$(OBJEXT): {$(VPATH)}builtin.h
84528455
mjit.$(OBJEXT): {$(VPATH)}config.h
84538456
mjit.$(OBJEXT): {$(VPATH)}constant.h
84548457
mjit.$(OBJEXT): {$(VPATH)}debug.h
@@ -8459,6 +8462,9 @@ mjit.$(OBJEXT): {$(VPATH)}encoding.h
84598462
mjit.$(OBJEXT): {$(VPATH)}gc.h
84608463
mjit.$(OBJEXT): {$(VPATH)}id.h
84618464
mjit.$(OBJEXT): {$(VPATH)}id_table.h
8465+
mjit.$(OBJEXT): {$(VPATH)}insns.def
8466+
mjit.$(OBJEXT): {$(VPATH)}insns.inc
8467+
mjit.$(OBJEXT): {$(VPATH)}insns_info.inc
84628468
mjit.$(OBJEXT): {$(VPATH)}intern.h
84638469
mjit.$(OBJEXT): {$(VPATH)}internal.h
84648470
mjit.$(OBJEXT): {$(VPATH)}internal/anyargs.h
@@ -8601,6 +8607,7 @@ mjit.$(OBJEXT): {$(VPATH)}internal/value_type.h
86018607
mjit.$(OBJEXT): {$(VPATH)}internal/variable.h
86028608
mjit.$(OBJEXT): {$(VPATH)}internal/warning_push.h
86038609
mjit.$(OBJEXT): {$(VPATH)}internal/xmalloc.h
8610+
mjit.$(OBJEXT): {$(VPATH)}iseq.h
86048611
mjit.$(OBJEXT): {$(VPATH)}method.h
86058612
mjit.$(OBJEXT): {$(VPATH)}missing.h
86068613
mjit.$(OBJEXT): {$(VPATH)}mjit.c

compile.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "internal/hash.h"
2929
#include "internal/numeric.h"
3030
#include "internal/object.h"
31+
#include "internal/rational.h"
3132
#include "internal/re.h"
3233
#include "internal/symbol.h"
3334
#include "internal/thread.h"
@@ -1985,6 +1986,16 @@ cdhash_cmp(VALUE val, VALUE lit)
19851986
else if (tlit == T_FLOAT) {
19861987
return rb_float_cmp(lit, val);
19871988
}
1989+
else if (tlit == T_RATIONAL) {
1990+
const struct RRational *rat1 = RRATIONAL(val);
1991+
const struct RRational *rat2 = RRATIONAL(lit);
1992+
return cdhash_cmp(rat1->num, rat2->num) || cdhash_cmp(rat1->den, rat2->den);
1993+
}
1994+
else if (tlit == T_COMPLEX) {
1995+
const struct RComplex *comp1 = RCOMPLEX(val);
1996+
const struct RComplex *comp2 = RCOMPLEX(lit);
1997+
return cdhash_cmp(comp1->real, comp2->real) || cdhash_cmp(comp1->imag, comp2->imag);
1998+
}
19881999
else {
19892000
UNREACHABLE_RETURN(-1);
19902001
}
@@ -2003,6 +2014,10 @@ cdhash_hash(VALUE a)
20032014
return FIX2LONG(rb_big_hash(a));
20042015
case T_FLOAT:
20052016
return rb_dbl_long_hash(RFLOAT_VALUE(a));
2017+
case T_RATIONAL:
2018+
return rb_rational_hash(a);
2019+
case T_COMPLEX:
2020+
return rb_complex_hash(a);
20062021
default:
20072022
UNREACHABLE_RETURN(0);
20082023
}
@@ -2884,7 +2899,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
28842899
}
28852900
else if (iobj != diobj && IS_INSN(&diobj->link) &&
28862901
IS_INSN_ID(diobj, jump) &&
2887-
OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
2902+
OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0) &&
2903+
diobj->insn_info.events == 0) {
28882904
/*
28892905
* useless jump elimination:
28902906
* jump LABEL1

complex.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,8 @@ nucomp_numerator(VALUE self)
13281328
}
13291329

13301330
/* :nodoc: */
1331-
static VALUE
1332-
nucomp_hash(VALUE self)
1331+
st_index_t
1332+
rb_complex_hash(VALUE self)
13331333
{
13341334
st_index_t v, h[2];
13351335
VALUE n;
@@ -1340,7 +1340,13 @@ nucomp_hash(VALUE self)
13401340
n = rb_hash(dat->imag);
13411341
h[1] = NUM2LONG(n);
13421342
v = rb_memhash(h, sizeof(h));
1343-
return ST2FIX(v);
1343+
return v;
1344+
}
1345+
1346+
static VALUE
1347+
nucomp_hash(VALUE self)
1348+
{
1349+
return ST2FIX(rb_complex_hash(self));
13441350
}
13451351

13461352
/* :nodoc: */

0 commit comments

Comments
 (0)