Граф коммитов

210 Коммитов

Автор SHA1 Сообщение Дата
Kazuhiro NISHIYAMA d7da5ca5e1
Fix links [ci skip] 2021-08-22 22:27:29 +09:00
Martin Dürst 21fd83a823 Mention update to Unicode Version 13.0.0 and Emoji Version 13.1
Mention the update to Unicode Version 13.0.0 and Unicode Emoji
Version 13.1 in NEWS.md. This completes issue #17750. [ci skip]
2021-08-17 17:08:59 +09:00
Takashi Kokubun ee362302c0
Revert "Pause an MJIT worker when JIT is cancelled"
This reverts commit b64f81c817.

It seems to cause a problem in --jit / --jit-wait CIs. Reverting for now.
2021-08-13 09:13:09 -07:00
Takashi Kokubun ac4d53bd46
Don't cancel JIT-ed code on TracePoint :class
events get enabled
2021-08-12 23:26:44 -07:00
Takashi Kokubun b64f81c817
Pause an MJIT worker when JIT is cancelled 2021-08-12 23:15:34 -07:00
Takashi Kokubun b3f8c491ef
Print JIT cancel when all JIT-ed code is cancelled 2021-08-12 23:11:38 -07:00
Kazuhiro NISHIYAMA a97837de1a
Fix a link [ci skip] 2021-08-05 17:25:17 +09:00
Nobuyoshi Nakada 8cc18703cf
[NEWS] added [Feature #17798] [ci skip] 2021-07-23 12:43:51 +09:00
Nobuyoshi Nakada 5385731374
[NEWS] adjusted formats [ci skip] 2021-07-23 12:41:01 +09:00
Kazuki Tsujimoto eed5e8f796
One-line pattern matching is no longer experimental
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20210715Japan.md#feature-17724-make-the-pin-operator-support-instanceclassglobal-variables-jeremyevans0
2021-07-17 11:13:52 +09:00
Nobuyoshi Nakada 301d194ee3 Add Integer.try_convert [Feature #15211] 2021-07-16 17:49:53 +09:00
Nobuyoshi Nakada 25689024cf
Added code fence to the example in [Feature #17724] [ci skip] 2021-07-16 11:26:30 +09:00
Jeremy Evans fa87f72e1e Add pattern matching pin support for instance/class/global variables
Pin matching for local variables and constants is already supported,
and it is fairly simple to add support for these variable types.

Note that pin matching for method calls is still not supported
without wrapping in parentheses (pin expressions).  I think that's
for the best as method calls are far more complex (arguments/blocks).

Implements [Feature #17724]
2021-07-15 09:56:02 -07:00
NARUSE, Yui 835c63cd88 Add tests and NEWS [Feature #18008] 2021-07-15 18:21:49 +09:00
Patrik Ragnarsson 8f62f12c35 Fix typo in flag in NEWS.md 2021-07-15 16:16:51 +09:00
Samuel Williams 42130a64f0
Replace copy coroutine with pthread implementation. 2021-07-01 11:23:03 +12:00
Kazuhiro NISHIYAMA 87e52ee38b
Fix a link [ci skip] 2021-06-23 09:23:54 +09:00
Samuel Williams eef3c08edc
Fix NEWS formatting. 2021-06-22 23:18:40 +12:00
Samuel Williams e01fa2f6ff Add fiber scheduler news. 2021-06-22 23:16:29 +12:00
Takashi Kokubun 31b9ce365d
Note about 07c05b6fe9 2021-06-02 22:26:27 -07:00
Takashi Kokubun 028f1887c2
Change the default --jit-max-cache to 10000
This is useful for large applications like Rails.
https://k0kubun.medium.com/ruby-3-jit-can-make-rails-faster-756310f235a
2021-05-31 22:01:04 -07:00
NARUSE, Yui 9ddc767434 Add NEWS about 46655156dc
* Add Thread#native_thread_id [Feature #17853]
2021-05-26 15:18:16 +09:00
Yusuke Endoh 167cff6a5d NEWS.md: mention lib/objspace/trace.rb [Feature #17762] 2021-05-17 08:50:23 +09:00
Jeremy Evans 50c54d40a8
Evaluate multiple assignment left hand side before right hand side
In regular assignment, Ruby evaluates the left hand side before
the right hand side.  For example:

```ruby
foo[0] = bar
```

Calls `foo`, then `bar`, then `[]=` on the result of `foo`.

Previously, multiple assignment didn't work this way.  If you did:

```ruby
abc.def, foo[0] = bar, baz
```

Ruby would previously call `bar`, then `baz`, then `abc`, then
`def=` on the result of `abc`, then `foo`, then `[]=` on the
result of `foo`.

This change makes multiple assignment similar to single assignment,
changing the evaluation order of the above multiple assignment code
to calling `abc`, then `foo`, then `bar`, then `baz`, then `def=` on
the result of `abc`, then `[]=` on the result of `foo`.

Implementing this is challenging with the stack-based virtual machine.
We need to keep track of all of the left hand side attribute setter
receivers and setter arguments, and then keep track of the stack level
while handling the assignment processing, so we can issue the
appropriate topn instructions to get the receiver.  Here's an example
of how the multiple assignment is executed, showing the stack and
instructions:

```
self                                      # putself
abc                                       # send
abc, self                                 # putself
abc, foo                                  # send
abc, foo, 0                               # putobject 0
abc, foo, 0, [bar, baz]                   # evaluate RHS
abc, foo, 0, [bar, baz], baz, bar         # expandarray
abc, foo, 0, [bar, baz], baz, bar, abc    # topn 5
abc, foo, 0, [bar, baz], baz, abc, bar    # swap
abc, foo, 0, [bar, baz], baz, def=        # send
abc, foo, 0, [bar, baz], baz              # pop
abc, foo, 0, [bar, baz], baz, foo         # topn 3
abc, foo, 0, [bar, baz], baz, foo, 0      # topn 3
abc, foo, 0, [bar, baz], baz, foo, 0, baz # topn 2
abc, foo, 0, [bar, baz], baz, []=         # send
abc, foo, 0, [bar, baz], baz              # pop
abc, foo, 0, [bar, baz]                   # pop
[bar, baz], foo, 0, [bar, baz]            # setn 3
[bar, baz], foo, 0                        # pop
[bar, baz], foo                           # pop
[bar, baz]                                # pop
```

As multiple assignment must deal with splats, post args, and any level
of nesting, it gets quite a bit more complex than this in non-trivial
cases. To handle this, struct masgn_state is added to keep
track of the overall state of the mass assignment, which stores a linked
list of struct masgn_attrasgn, one for each assigned attribute.

This adds a new optimization that replaces a topn 1/pop instruction
combination with a single swap instruction for multiple assignment
to non-aref attributes.

This new approach isn't compatible with one of the optimizations
previously used, in the case where the multiple assignment return value
was not needed, there was no lhs splat, and one of the left hand side
used an attribute setter.  This removes that optimization. Removing
the optimization allowed for removing the POP_ELEMENT and adjust_stack
functions.

This adds a benchmark to measure how much slower multiple
assignment is with the correct evaluation order.

This benchmark shows:

* 4-9% decrease for attribute sets
* 14-23% decrease for array member sets
* Basically same speed for local variable sets

Importantly, it shows no significant difference between the popped
(where return value of the multiple assignment is not needed) and
!popped (where return value of the multiple assignment is needed)
cases for attribute and array member sets.  This indicates the
previous optimization, which was dropped in the evaluation
order fix and only affected the popped case, is not important to
performance.

Fixes [Bug #4443]
2021-04-21 10:49:19 -07:00
Nobuyoshi Nakada b6bb4623eb
NEWS for [Feature #15198] [ci skip] 2021-04-16 16:12:10 +09:00
Nobuyoshi Nakada 9143d21b1b
Enumerable#tally with the resulting hash [Feature #17744] 2021-03-26 16:29:21 +09:00
Kazuki Tsujimoto 21863470d9
Pattern matching pin operator against expression [Feature #17411]
This commit is based on the patch by @nobu.
2021-03-21 15:14:31 +09:00
Kazuhiro NISHIYAMA 31b19ba84e
Fix a link [ci skip] 2021-03-16 14:07:27 +09:00
Nobuyoshi Nakada 18a3bf5a0e
NEWS of [Feature #12194] [ci skip] 2021-03-15 22:36:05 +09:00
Kazuhiro NISHIYAMA 4dfc5496b7
Add NEWS entry for [Feature #16043] 2021-02-16 18:13:27 +09:00
Nobuyoshi Nakada 37b90bcdc1 [DOC] NEWS for Thread::Backtrace.limit [Feature #17479] 2021-02-15 18:29:35 +09:00
Chris Seaton c3b2bb0969
The Queue constructor should take an initial set of objects
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-02-11 19:14:18 +09:00
Takashi Kokubun f766ba54a9
Update NEWS.md about deprecation 2021-01-20 22:02:52 -08:00
Takashi Kokubun 8d099aa040
Warn Struct#initialize with only keyword args (#4070)
* Warn Struct#initialize with only keyword args

A part of [Feature #16806]

* Do not warn if `keyword_init: false`

is explicitly specified

* Add a NEWS entry

* s/in/from/

* Make sure all fields are initialized
2021-01-17 01:35:54 -08:00
Jeremy Evans e09094546a Make Module#prepend affect ancestor chain even if argument already included in receiver
Previously, if a class included a module and then prepended the
same module, the prepend had no effect.  This changes the behavior
so that the prepend has an effect unless the module is already
prepended the receiver.

While here, rename the origin_seen variable in include_modules_at,
since it is misleading. The variable tracks whether c has been seen,
not whether the origin of klass has been.

Fixes [Bug #17423]
2021-01-14 20:43:30 -08:00
Takashi Kokubun e1fee7f949
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.

[Feature #17490]
2021-01-13 22:46:51 -08:00
Marc-Andre Lafortune fdf3539967 NEWS: We have links now, and there is no changelog anymore [doc] 2021-01-02 21:54:00 -05:00
Nobuyoshi Nakada 68ea7720b3 NEWS: [Feature #17312] [ci skip] 2021-01-02 17:27:24 +09:00
Kazuhiro NISHIYAMA 7e3d710a22
Copy NEWS.md to doc/NEWS-3.0.0.md and update for 3.1.0 2020-12-25 17:31:48 +09:00
Kazuhiro NISHIYAMA 1f18f5c61e
Sort URLs by issue numbers and remove duplicated [ci skip] 2020-12-25 11:32:19 +09:00
Hiroshi SHIBATA 1ba77ff8aa
Update stdlib section for Ruby 3.0 2020-12-25 10:22:45 +09:00
Takashi Kokubun e44a8bd791
Let's be more accurate [ci skip] 2020-12-23 23:06:40 -08:00
Takashi Kokubun 176b75747c
Add NEWS entries about JIT in Jul ~ Dec
* Instance variables
  * Merge ivar guards on JIT a69dd699ee e4f7eee009
  * Prefer RB_OBJ_FROZEN_RAW 5611066e03
  * Skip checking ROBJECT_EMBED 81a8d1cf09
* Method inlining
  * Mark some Integer methods as inline 0703e01471
  * Allow inlining Integer#-@ and #~ dbb4f19969
  * Inline builtin struct aref 167d139487
  * Make Kernel#then, #yield_self, #frozen? builtin 24fa37d87a
  * (For future) Rewrite Kernel#tap with Ruby f3a0d7a203
* Other optimizations
  * Inline constant references 53babf35ef
  * Lazily move PC with RUBY_VM_CHECK_INTS 5d74894f2b
  * Cache access to reg_cfp->self on JIT d409837729
* JIT compaction
  * Shrink the blocking region for compile_compact_jit_code ed8e552d4d
  * Stop leaving .c files for JIT compaction in /tmp fa1250a506
* GC of JIT-ed code
  * Run unload_units in the JIT worker thread 16dab6b692
  * Avoid unloading units which have enough total_calls d80226e7bd
  * Throttle unload_units 122cd35939
  * Throttle JIT compaction 096f54428d
* Compilation speed
  * Eliminate IVC sync between JIT and Ruby threads 0960f56a1d
  * Lazily move units from active_units to stale_units 5d8f227d0e

Please see 200c5f4075 for other improvements in Jan ~ Jun.
2020-12-23 23:02:18 -08:00
Yusuke Endoh 8c510e4095 NEWS.md: grammatical improvement 2020-12-24 14:58:30 +09:00
Marc-Andre Lafortune 8feb40f49a Document shareable_constant_value and other magic constants [doc] 2020-12-23 11:50:33 -05:00
Yusuke Endoh 3a81daaf8d Module#public_class_method also accepts a symbol array as an argument
I'm unsure if this is intentional, but add a document anyway.
[Feature #17314]
2020-12-24 00:15:29 +09:00
Marcus Stollsteimer 74a3569b59 NEWS: fix typos and grammar 2020-12-22 23:20:14 +01:00
Sutou Kouhei 32849dc1bb fiddle: Update to 1.0.5 2020-12-23 05:49:52 +09:00
Marc-Andre Lafortune 228fa3ac6e NEWS: Mention deprecation warnings not being shown by default 2020-12-22 13:48:13 -05:00
Marc-Andre Lafortune fd745cc92c NEWS: group keyword arguments related items together 2020-12-22 13:48:13 -05:00