summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-11-06Remove duplicate codeAaron Patterson
These functions are the same, so remove one. Co-authored-by: John Hawthorn <john@hawthorn.email>
2019-11-06Revert "Use a monotonically increasing number for object_id"Aaron Patterson
This reverts commit bd2b314a05ae9192b3143e1e678a37c370d8a9ce.
2019-11-06Use a monotonically increasing number for object_idJohn Hawthorn
This changes object_id from being based on the objects location in memory (or a nearby memory location in the case of a conflict) to be based on an always increasing number. This number is a Ruby Integer which allows it to overflow the size of a pointer without issue (very unlikely to happen in real programs especially on 64-bit, but a nice guarantee). This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby objects to Ruby objects (previously they were Ruby object to C integer) which simplifies updating them after compaction as we can run them through gc_update_table_refs. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/2638
2019-11-07Promote open3 to default gemsHiroshi SHIBATA
2019-11-07Added rubygems url for published gemHiroshi SHIBATA
2019-11-07fallback standard structure library to sync_lib_gem methodHiroshi SHIBATA
2019-11-07Promote singleton to default gemsHiroshi SHIBATA
2019-11-06Exclude some clocks on armv8 tooBenoit Daloze
* See https://bugs.ruby-lang.org/issues/16234#note-16
2019-11-06Revert "Remove arm64 from allow_failures"Takashi Kokubun
This reverts commit 212f4d49bac844b3c0fa52f2185b3df30aa62e75. It worked on PR, but master branch builds have another build issue. https://travis-ci.org/ruby/ruby/jobs/608303393
2019-11-06Remove arm64 from allow_failuresTakashi Kokubun
2019-11-07* 2019-11-07 [ci skip]git
2019-11-06Fix spawn_spec.rb for Travis arm64 environment.Jun Aruga
The process group id (/proc/[pid]/stat 5th field) is 0 in the Travis arm64 environment. This is a case where it is available. $ cat /proc/4543/stat 4543 (ruby) S 4525 4525 1384 34818 4525 4194304 37443 1754841 0 0 366 105 2291 391 20 0 3 0 1381328 1428127744 11475 18446744073709551615 94195983785984 94195986670225 140728933833312 0 0 0 0 0 1107394127 0 0 0 17 2 0 0 1 0 0 94195987686512 94195987708942 94196017770496 140728933835483 140728933835595 140728933835595 140728933842904 0 This is a case where it is not available in Travis arm64 environment. $ cat /proc/19179/stat 19179 (ruby) S 19160 0 0 0 -1 4194560 37618 1710547 313 163 770 665 5206 1439 20 0 2 0 17529566 1196347392 10319 18446744073709551615 187650811428864 187650815023116 281474602721280 0 0 0 0 4096 1107390031 0 0 0 17 22 0 0 0 0 0 187650815091456 187650815114064 187651414974464 281474602725080 281474602725211 281474602725211 281474602729420 0 See "man proc" for detail. Notes: Merged: https://github.com/ruby/ruby/pull/2653
2019-11-06Numbered parameter is an ID_LOCAL now [Bug #16293]Nobuyoshi Nakada
2019-11-06Numbered parameter cannot appear outside block now [Bug #16293]Nobuyoshi Nakada
2019-11-06Prohibit calling undefined allocator [Bug #16297]Nobuyoshi Nakada
2019-11-06Time#strftime does not support `%Q`Kazuhiro NISHIYAMA
``` % ruby -r date -e 't=Time.utc(2001,2,3,4,5,6,7);p t; p [t, t.to_date, t.to_datetime].map{|d|d.strftime("%Q")}' 2001-02-03 04:05:06.000007 UTC ["%Q", "981158400000", "981173106000"] ```
2019-11-06Undefine MatchData.allocate [Feature #16294]Nobuyoshi Nakada
2019-11-05Use an identity hash for pinning Ripper objectsAaron Patterson
Ripper reuses parse.y for its implementation. Ripper changes the grammar productions to sometimes return Ruby objects. This Ruby objects are put in to the parser's stack, so they must be kept alive. This is where the "mark_ary" comes in. The mark array ensures that Ruby objects created and pushed on the stack during the course of parsing will stay alive for the life of the parsing functions. Unfortunately, Arrays do not prevent their contents from moving. If the compactor runs, objects on the parser stack could move because the array won't prevent them from moving. But the GC doesn't know about the parser stack, so it can't update references in that stack (it will update them in the array). This commit changes the mark array to be an identity hash. Since the identity hash relies on memory addresses for the definition of identity, the GC will not allow keys in an identity hash to move. We can prevent movement of objects in the parser stack by sticking them in an identity hash.
2019-11-06* 2019-11-06 [ci skip]git
2019-11-06Improve string literal concatenation for C++11Mark Abraham
Downstream C++ projects that compile with C++11 or newer and include the generated config.h file issue compiler warnings. Both C and C++ compilers do string-literal token pasting regardless of whitespace between the tokens to paste. C++ compilers since C++11 require such spaces, to avoid ambiguity with the new style of string literals introduced then. This change fixes such projects without affecting core Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2650
2019-11-05Assert return value of Readline.readline only if Ruby is before 2.7aycabta
2019-11-05Only taint on Ruby <2.7Jeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect.
2019-11-05Only untaint line on Ruby <2.7Jeremy Evans
Untaint is deprecated and has no effect on Ruby 2.7+.
2019-11-05Separated `@counter` and `@tally` so that "-ft" works with "-j"Nobuyoshi Nakada
2019-11-05Enable "-f" option in multi_exec modeNobuyoshi Nakada
Make `MultiFormatter` a module and extend the formatter specified by "-f" option. Notes: Merged: https://github.com/ruby/ruby/pull/2649
2019-11-05`DottedFormatter#finish` consistencyNobuyoshi Nakada
Rmoved optional parameter `printed_exceptions`, and clear `exceptions` just after printing each exception, instead. Notes: Merged: https://github.com/ruby/ruby/pull/2649
2019-11-05`DottedFormatter#state` consistencyNobuyoshi Nakada
Let the method of `DottedFormatter` subclasses have the same arity. Notes: Merged: https://github.com/ruby/ruby/pull/2649
2019-11-05Revert "[EXPERIMENTAL] Make Symbol#to_s return a frozen String [Feature #16150]"NARUSE, Yui
This reverts commit 6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e.
2019-11-05Fix coroutine support on win32Lars Kanis
Ruby master branch currently fails on win32 MINGW at this spec: https://github.com/ruby/spec/blob/master/core/thread/element_set_spec.rb MINGW makes use of setjmp3() implemented in MSVCRT.DLL. This function traverses the SEH list up to a terminating pointer 0xFFFFFFFF. It therefore currently segfaults on NULL. The SEH linked list must be terminated by 0xFFFFFFFF instead of NULL. This fixes the issue mentioned here: https://github.com/ruby/ruby/pull/2279#issuecomment-509508810 Notes: Merged: https://github.com/ruby/ruby/pull/2645
2019-11-05let the .bss section initialize static variables卜部昌平
ISO/IEC 9899:1999 section 6.7.8 specifies the values of static storage which are not explicitly initialized. According to that these initializers can be omitted. Doing so improvoes future compatibility against addition / deletion of the fields of this struct.
2019-11-05rb_method_basic_definition_p with CC卜部昌平
Noticed that rb_method_basic_definition_p is frequently called. Its callers include vm_caller_setup_args_block(), rb_hash_default_value(), rb_num_neative_int_p(), and a lot more. It seems worth caching the method resolution part. Majority of rb_method_basic_definion_p() usages take fixed class and fixed method id combinations. Calculating ------------------------------------- ours trunk so_matrix 2.379 2.115 i/s - 1.000 times in 0.420409s 0.472879s Comparison: so_matrix ours: 2.4 i/s trunk: 2.1 i/s - 1.12x slower Notes: Merged: https://github.com/ruby/ruby/pull/2629
2019-11-05Set $JOBS to Tests for parallel testsNobuyoshi Nakada
2019-11-05Moved Init_encoding from wrong place [Bug #16292]Nobuyoshi Nakada
2019-11-05Fix a typo in WARN_EOLKazuhiro NISHIYAMA
2019-11-05Do not occupy `ARGV` by XRUBY commandNobuyoshi Nakada
Instead run test-bundled-gems.rb by `ENV['RUBY']`, which should be set by runruby.rb. Notes: Merged: https://github.com/ruby/ruby/pull/2646
2019-11-04Use ident hash for top-level recursion checkJohn Hawthorn
We track recursion in order to not infinite loop in ==, inspect, and similar methods by keeping a thread-local 1 or 2 level hash. This allows us to track when we have seen the same object (ex. using inspect) or same pair of objects (ex. using ==) in this stack before and to treat that differently. Previously both levels of this Hash used the object's memory_id as a key (using object_id would be slow and wasteful). Unfortunately, prettyprint (pp.rb) uses this thread local variable to "pretend" to be inspect and inherit its same recursion behaviour. This commit changes the top-level hash to be an identity hash and to use objects as keys instead of their object_ids. I'd like to have also converted the 2nd level hash to an ident hash, but it would have prevented an optimization which avoids allocating a 2nd level hash for only a single element, which we want to keep because it's by far the most common case. So the new format of this hash is: { object => true } (not paired) { lhs_object => rhs_object_memory_id } (paired, single object) { lhs_object => { rhs_object_memory_id => true, ... } } (paired, many objects) We must also update pp.rb to match this (using identity hashes). Notes: Merged: https://github.com/ruby/ruby/pull/2644
2019-11-05Put an empty line [ci skip]Nobuyoshi Nakada
2019-11-05More rdoc for ENVBurdette Lamar
Notes: Merged: https://github.com/ruby/ruby/pull/2641
2019-11-05Updated minitest to 5.13.0Nobuyoshi Nakada
2019-11-05Simplify test tasksNobuyoshi Nakada
Removed `if` conditions separating `test-bundled-gems`, and pass `TESTOPTS` and `TEST_BUNDLED_GEMS_ALLOW_FAILURES` via `env`. Notes: Merged: https://github.com/ruby/ruby/pull/2643
2019-11-05Adjust a fucntion signatureNobuyoshi Nakada
2019-11-04Fix zero free objects assertionAaron Patterson
This commit is to attempt fixing this error: http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sky1/2353281 Each non-full heap_page struct contains a reference to the next page that contains free slots. Compaction could fill any page, including pages that happen to be linked to as "pages which contain free slots". To fix this, we'll iterate each page, and rebuild the "free page list" depending on the number of actual free slots on that page. If there are no free slots on the page, we'll set the free_next pointer to NULL. Finally we'll pop one page off the "free page list" and set it as the "using page" for the next allocation.
2019-11-05Fixed conditional expressions with only one void sideNobuyoshi Nakada
2019-11-05* 2019-11-05 [ci skip]git
2019-11-05Share test-bundled-gems-run in common.mkNobuyoshi Nakada
2019-11-04Keep `lex.pcur` after `looking_at_eol_p`Nobuyoshi Nakada
2019-11-04Warn `if` and `elsif` at EOL [EXPERIMENTAL]Nobuyoshi Nakada
It is unnatural and probably a typo.
2019-11-04Revert "Warn `if` and `elsif` at EOL [EXPERIMENTAL]"Yusuke Endoh
This reverts commit ba35c14325ebbf1da8f200df83c45ee9937ff8a1. This is because ripper fails symbol lookup error.
2019-11-04Warn `if` and `elsif` at EOL [EXPERIMENTAL]Nobuyoshi Nakada
It is unnatural and probably a typo.
2019-11-04Fix a typo [ci skip]Kazuhiro NISHIYAMA