aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* use builtin for RubyVM::AbstractSyntaxTree.Koichi Sasada2019-11-085-129/+157
| | | | | Define RubyVM::AbstractSyntaxTree in ast.rb with __builtin functions.
* use builtin for TracePoint.Koichi Sasada2019-11-088-407/+496
| | | | Define TracePoint in trace_point.rb and use __builtin_ syntax.
* support builtin features with Ruby and C.Koichi Sasada2019-11-0817-28/+838
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support loading builtin features written in Ruby, which implement with C builtin functions. [Feature #16254] Several features: (1) Load .rb file at boottime with native binary. Now, prelude.rb is loaded at boottime. However, this file is contained into the interpreter as a text format and we need to compile it. This patch contains a feature to load from binary format. (2) __builtin_func() in Ruby call func() written in C. In Ruby file, we can write `__builtin_func()` like method call. However this is not a method call, but special syntax to call a function `func()` written in C. C functions should be defined in a file (same compile unit) which load this .rb file. Functions (`func` in above example) should be defined with (a) 1st parameter: rb_execution_context_t *ec (b) rest parameters (0 to 15). (c) VALUE return type. This is very similar requirements for functions used by rb_define_method(), however `rb_execution_context_t *ec` is new requirement. (3) automatic C code generation from .rb files. tool/mk_builtin_loader.rb creates a C code to load .rb files needed by miniruby and ruby command. This script is run by BASERUBY, so *.rb should be written in BASERUBY compatbile syntax. This script load a .rb file and find all of __builtin_ prefix method calls, and generate a part of C code to export functions. tool/mk_builtin_binary.rb creates a C code which contains binary compiled Ruby files needed by ruby command.
* Add a counter for compactionAaron Patterson2019-11-072-0/+12
| | | | | Keep track of the number of times the compactor ran. I would like to use this as a way to keep track of inline cache reference updates.
* * 2019-11-08 [ci skip]git2019-11-081-1/+1
|
* Use a monotonically increasing number for object_idJohn Hawthorn2019-11-075-152/+91
| | | | | | | | | | | | | | | | | 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>
* Suppress unused variable warningNobuyoshi Nakada2019-11-071-1/+1
|
* Use FIX2LONG instead of FIX2INT like 26843cbcd0NARUSE, Yui2019-11-071-4/+4
|
* Use FIX2LONG to avoid unexpected exceptionNARUSE, Yui2019-11-071-1/+1
| | | | | Though it won't happen in the real world in this context, FIX2INT may raise an exception and it cause to generate extra code.
* extend rb_call_cache卜部昌平2019-11-076-19/+75
| | | | | | | | | | | | | | | | | | | | | | Prior to this changeset, majority of inline cache mishits resulted into the same method entry when rb_callable_method_entry() resolves a method search. Let's not call the function at the first place on such situations. In doing so we extend the struct rb_call_cache from 44 bytes (in case of 64 bit machine) to 64 bytes, and fill the gap with secondary class serial(s). Call cache's class serials now behavies as a LRU cache. Calculating ------------------------------------- ours 2.7 2.6 vm2_poly_same_method 2.339M 1.744M 1.369M i/s - 6.000M times in 2.565086s 3.441329s 4.381386s Comparison: vm2_poly_same_method ours: 2339103.0 i/s 2.7: 1743512.3 i/s - 1.34x slower 2.6: 1369429.8 i/s - 1.71x slower
* Fixed test failure related Net::ProtocolHiroshi SHIBATA2019-11-072-2/+4
|
* SMTP is not moduleHiroshi SHIBATA2019-11-071-1/+1
|
* Promote cgi to default gemsHiroshi SHIBATA2019-11-075-5/+48
|
* Promote net-smtp to default gemsHiroshi SHIBATA2019-11-076-4/+43
|
* Promote net-pop to default gemsHiroshi SHIBATA2019-11-076-4/+43
|
* Promote benchmark to default gemsHiroshi SHIBATA2019-11-075-3/+39
|
* Promote delegate to default gemsHiroshi SHIBATA2019-11-075-3/+37
|
* Promote pstore to default gemsHiroshi SHIBATA2019-11-075-3/+39
|
* Promote getoptlong to default gemsHiroshi SHIBATA2019-11-074-3/+37
|
* Fixed an Errno::ENOENT with non-test librariesHiroshi SHIBATA2019-11-071-1/+3
|
* Disallow duplicated pattern variableKazuki Tsujimoto2019-11-072-12/+100
|
* Add missing semicolonKazuki Tsujimoto2019-11-071-0/+1
|
* Remove duplicate codeAaron Patterson2019-11-063-9/+2
| | | | | | These functions are the same, so remove one. Co-authored-by: John Hawthorn <john@hawthorn.email>
* Revert "Use a monotonically increasing number for object_id"Aaron Patterson2019-11-065-91/+162
| | | | This reverts commit bd2b314a05ae9192b3143e1e678a37c370d8a9ce.
* Use a monotonically increasing number for object_idJohn Hawthorn2019-11-065-162/+91
| | | | | | | | | | | | | | | | | 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>
* Promote open3 to default gemsHiroshi SHIBATA2019-11-075-4/+40
|
* Added rubygems url for published gemHiroshi SHIBATA2019-11-071-0/+35
|
* fallback standard structure library to sync_lib_gem methodHiroshi SHIBATA2019-11-071-2/+1
|
* Promote singleton to default gemsHiroshi SHIBATA2019-11-075-5/+38
|
* Exclude some clocks on armv8 tooBenoit Daloze2019-11-061-1/+1
| | | | * See https://bugs.ruby-lang.org/issues/16234#note-16
* Revert "Remove arm64 from allow_failures"Takashi Kokubun2019-11-061-1/+2
| | | | | | | This reverts commit 212f4d49bac844b3c0fa52f2185b3df30aa62e75. It worked on PR, but master branch builds have another build issue. https://travis-ci.org/ruby/ruby/jobs/608303393
* Remove arm64 from allow_failuresTakashi Kokubun2019-11-061-2/+1
|
* * 2019-11-07 [ci skip]git2019-11-071-1/+1
|
* Fix spawn_spec.rb for Travis arm64 environment.Jun Aruga2019-11-061-3/+13
| | | | | | | | | | | | | | | | | 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.
* Numbered parameter is an ID_LOCAL now [Bug #16293]Nobuyoshi Nakada2019-11-062-17/+6
|
* Numbered parameter cannot appear outside block now [Bug #16293]Nobuyoshi Nakada2019-11-062-1/+3
|
* Prohibit calling undefined allocator [Bug #16297]Nobuyoshi Nakada2019-11-062-2/+37
|
* Time#strftime does not support `%Q`Kazuhiro NISHIYAMA2019-11-061-1/+0
| | | | | | | | ``` % 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"] ```
* Undefine MatchData.allocate [Feature #16294]Nobuyoshi Nakada2019-11-062-0/+6
|
* Use an identity hash for pinning Ripper objectsAaron Patterson2019-11-051-6/+6
| | | | | | | | | | | | | | | | | | | | | 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 [ci skip]git2019-11-061-1/+1
|
* Improve string literal concatenation for C++11Mark Abraham2019-11-061-2/+2
| | | | | | | | | | 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.
* Assert return value of Readline.readline only if Ruby is before 2.7aycabta2019-11-051-1/+1
|
* Only taint on Ruby <2.7Jeremy Evans2019-11-051-2/+2
| | | | Ruby 2.7 deprecates taint and it no longer has an effect.
* Only untaint line on Ruby <2.7Jeremy Evans2019-11-051-1/+1
| | | | Untaint is deprecated and has no effect on Ruby 2.7+.
* Separated `@counter` and `@tally` so that "-ft" works with "-j"Nobuyoshi Nakada2019-11-051-6/+7
|
* Enable "-f" option in multi_exec modeNobuyoshi Nakada2019-11-054-12/+34
| | | | | Make `MultiFormatter` a module and extend the formatter specified by "-f" option.
* `DottedFormatter#finish` consistencyNobuyoshi Nakada2019-11-052-10/+1
| | | | | Rmoved optional parameter `printed_exceptions`, and clear `exceptions` just after printing each exception, instead.
* `DottedFormatter#state` consistencyNobuyoshi Nakada2019-11-057-7/+7
| | | | | Let the method of `DottedFormatter` subclasses have the same arity.
* Revert "[EXPERIMENTAL] Make Symbol#to_s return a frozen String [Feature #16150]"NARUSE, Yui2019-11-054-31/+3
| | | | This reverts commit 6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e.