summaryrefslogtreecommitdiff
path: root/kernel.rb
AgeCommit message (Collapse)Author
2021-01-12[DOC] Use URI#read instead of URI.open for better compatibilityKazuhiro NISHIYAMA
- URI.open is available since 2.5.0, but URI#read is available since 1.8.0. - Fix `open` without `close`. - ref https://github.com/rurema/doctree/pull/2433
2021-01-08Replace `Kernel.#open` with `URI.open` in docMasataka Pocke Kuwabara
Because `Kernel.#open` no longer opens URI since Ruby 3.0. Notes: Merged: https://github.com/ruby/ruby/pull/4039
2020-07-03Make Kernel#then, #yield_self, #frozen? builtin (#3283)Takashi Kokubun
* Make Kernel#then, #yield_self, #frozen? builtin * Fix test_jit Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-07-03Rewrite Kernel#tap with Ruby (#3281)Takashi Kokubun
* Rewrite Kernel#tap with Ruby This was good for VM too, but of course my intention is to unblock JIT's inlining of a block over yield (inlining invokeyield has not been committed though). * Fix test_settracefunc About the :tap deletions, the :tap events are actually traced (we already have a TracePoint test for builtin methods), but it's filtered out by tp.path == "xyzzy" (it became "<internal:kernel>"). We could trace tp.path == "<internal:kernel>" cases too, but the lineno is impacted by kernel.rb changes and I didn't want to make it fragile for kernel.rb lineno changes. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-06-23Annotate Kernel#class as inline (#3250)Takashi Kokubun
``` $ benchmark-driver -v --rbenv 'before;after;before --jit;after --jit' benchmark/mjit_class.yml --repeat-count=4 before: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) [x86_64-linux] after: ruby 2.8.0dev (2020-06-23T17:29:56Z inline-class 0ff147c007) [x86_64-linux] before --jit: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-06-23T17:29:56Z inline-class 0ff147c007) +JIT [x86_64-linux] Calculating ------------------------------------- before after before --jit after --jit mjit_class(self) 39.219M 40.060M 53.502M 69.202M i/s - 40.000M times in 1.019915s 0.998495s 0.747631s 0.578021s mjit_class(1) 39.567M 41.242M 52.100M 68.895M i/s - 40.000M times in 1.010935s 0.969885s 0.767749s 0.580591s Comparison: mjit_class(self) after --jit: 69201690.7 i/s before --jit: 53502336.4 i/s - 1.29x slower after: 40060289.1 i/s - 1.73x slower before: 39218939.2 i/s - 1.76x slower mjit_class(1) after --jit: 68895358.6 i/s before --jit: 52100353.0 i/s - 1.32x slower after: 41241993.6 i/s - 1.67x slower before: 39567314.0 i/s - 1.74x slower ``` Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-06-19[Feature #16254] Use `Primitive.func` styleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3165
2020-06-19[Feature #16254] Use `__builtin.func` styleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3165
2020-04-22support builtin for Kernel#FloatS.H
# Iteration per second (i/s) | |compare-ruby|built-ruby| |:------------|-----------:|---------:| |float | 30.395M| 38.314M| | | -| 1.26x| |float_true | 3.833M| 27.322M| | | -| 7.13x| |float_false | 4.182M| 24.938M| | | -| 5.96x| Notes: Merged: https://github.com/ruby/ruby/pull/3048 Merged-By: nobu <nobu@ruby-lang.org>
2020-03-22Support obj.clone(freeze: true) for freezing cloneJeremy Evans
This freezes the clone even if the receiver is not frozen. It is only for consistency with freeze: false not freezing the clone even if the receiver is frozen. Because Object#clone is now partially implemented in Ruby and not fully implemented in C, freeze: nil must be supported to provide the default behavior of only freezing the clone if the receiver is frozen. This requires modifying delegate and set, to set freeze: nil instead of freeze: true as the keyword parameter for initialize_clone. Those are the two libraries in stdlib that override initialize_clone. Implements [Feature #16175] Notes: Merged: https://github.com/ruby/ruby/pull/2969
2020-03-17support builtin for Kernel#cloneS.H
Notes: Merged: https://github.com/ruby/ruby/pull/2954 Merged-By: nobu <nobu@ruby-lang.org>