summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-01rb_ext_ractor_safe() to declare ractor-safe extKoichi Sasada
C extensions can violate the ractor-safety, so only ractor-safe C extensions (C methods) can run on non-main ractors. rb_ext_ractor_safe(true) declares that the successive defined methods are ractor-safe. Otherwiwze, defined methods checked they are invoked in main ractor and raise an error if invoked at non-main ractors. [Feature #17307] Notes: Merged: https://github.com/ruby/ruby/pull/3824
2020-12-01should not use rb_ary_modify()Koichi Sasada
ractor_copy() used rb_ary_modify() to make sure this array is not sharing anything, but it also checks frozen flag. So frozen arrays raises an error. To solve this issue, this patch introduces new function rb_ary_cancel_sharing() which makes sure the array does not share another array and it doesn't check frozen flag. [Bug #17343] A test is quoted from https://github.com/ruby/ruby/pull/3817 Notes: Merged: https://github.com/ruby/ruby/pull/3831
2020-12-01show with sharing infoKoichi Sasada
2020-11-30-> creates a lambda so this updates the documentation to reflect thatJames Koenig
Notes: Merged: https://github.com/ruby/ruby/pull/3828
2020-12-01ractor local storage C-APIKoichi Sasada
To manage ractor-local data for C extension, the following APIs are defined. * rb_ractor_local_storage_value_newkey * rb_ractor_local_storage_value * rb_ractor_local_storage_value_set * rb_ractor_local_storage_ptr_newkey * rb_ractor_local_storage_ptr * rb_ractor_local_storage_ptr_set At first, you need to create a key of storage by rb_ractor_local_(value|ptr)_newkey(). For ptr storage, it accepts the type of storage, how to mark and how to free with ractor's lifetime. rb_ractor_local_storage_value/set are used to access a VALUE and rb_ractor_local_storage_ptr/set are used to access a pointer. random.c uses this API. Notes: Merged: https://github.com/ruby/ruby/pull/3822
2020-12-01tune parallel testKoichi Sasada
This patch contains the fowllowing hacks: (1) Add "--timetable-data=FILE" option for test-all This option enables to dump timeline event contains worker, suite, and start/end time. (2) remove TestJIT in test_jit_debug.rb on parallel test. it is duplicated test. (3) move test_jit.rb and test_jit_debug.rb at first because these two tests are bottleneck of parallel tests. On my environment, `make test-all TESTS=-j12` reduced the total time 190 seconds -> 140 seconds. Notes: Merged: https://github.com/ruby/ruby/pull/3826
2020-11-30Fix `Ractor.make_shareable` for recursive structures with unfreezable componentsMarc-Andre Lafortune
Followup to #3823 Notes: Merged: https://github.com/ruby/ruby/pull/3827
2020-12-01* 2020-12-01 [ci skip]git
2020-11-30Only check if the current ep is a local or not, then markAaron Patterson
The vm mark function should only check if the current frame is a local or not and then mark values in that frame. Since it's walking up the stack looking at each cfp, then all ep's should be examined. This fixes a bug in the Rails tests where we're seeing segv in railties. Thanks Yasuo Honda for giving me a reliable repro! Notes: Merged: https://github.com/ruby/ruby/pull/3829
2020-11-30[DOC] Update -l option [ci skip]Nobuyoshi Nakada
`-l` option has used `chomp!` since Ruby 2.5. [Bug #12926]
2020-11-30Clean temproray directory created by test-specNobuyoshi Nakada
2020-11-30Clean static-rubyNobuyoshi Nakada
2020-11-30Fix rb_interned_str_* functions to not assume static stringsJean Boussier
Fixes [Feature #13381] When passed a `fake_str`, `register_fstring` would create new strings with `str_new_static`. That's not what was expected, and answer almost no use cases. Notes: Merged: https://github.com/ruby/ruby/pull/3786
2020-11-30Fixed Ractor.shareable? on cross-recursive objects [Bug #17344]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3823 Merged-By: nobu <nobu@ruby-lang.org>
2020-11-30Raise when loading unprovided builtin function [Bug #17192]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3622 Merged-By: nobu <nobu@ruby-lang.org>
2020-11-30Keep references of memory-view-exported objects (#3816)Kenta Murata
* memory_view.c: remove a reference in view->obj at rb_memory_view_release * memory_view.c: keep references of memory-view-exported objects * Update common.mk * memory_view.c: Use st_update Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-11-30[DOC] Fixed st_udpate comment [ci skip]Nobuyoshi Nakada
Clarified that the first and second arguments to the callback function are pointers to the KEY and the VALUE, but not those values themselves.
2020-11-30* 2020-11-30 [ci skip]git
2020-11-30support SIGSEGV/BUS while read_barrier_handler()Koichi Sasada
read_barrier_handler() can cause SIGSEGV/BUS so it should show the errors.
2020-11-29Get rid of allocation when the capacity is smallNobuyoshi Nakada
2020-11-29* 2020-11-29 [ci skip]git
2020-11-28Do not throttle the workaround for --jit-waitTakashi Kokubun
--jit-wait CI can be stuck when the workaround is throttled http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3274091
2020-11-28NEWS for [Feature #17136] [ci skip]Nobuyoshi Nakada
2020-11-28[Feature #17136] Remove special behavior from $KCODENobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3483
2020-11-28Revived the getenv macro for dln_find.cNobuyoshi Nakada
This partially reverts commit "Windows: Improve readablity of getenv() encoding" 14453a256d58b11b06d432e2a4388d95aac298d6. The `getenv` macro defined here is to also substitute the function in dln_find.c, not only in this file.
2020-11-28Windows: Improve readablity of getenv() encodingLars Kanis
getenv() did use the expected codepage as an implicit parameter of the macro. This is mis-leading since include/ruby/win32.h has a different definition. Using the "cp" variable explicit (like the other function calls) makes it more readable and consistent.
2020-11-28Increase timeout for MJIT ActionsTakashi Kokubun
It's too short for --jit-wait https://github.com/ruby/ruby/runs/1466690076?check_suite_focus=true
2020-11-27Fix compactions.size for throttlingTakashi Kokubun
096f54428d changes the behavior for this kind of cases.
2020-11-27Throttle JIT compactionTakashi Kokubun
The compilation for JIT compaction is very heavy. Triggering a second compaction to include one more new method is probably not worth it. So this triggers JIT compaction for ten more new methods after each compaction.
2020-11-27Try to fix the mswin CI failureTakashi Kokubun
Sorry, I forgot to add this in 122cd35939 while I said I did something for it.
2020-11-27Throttle unload_unitsTakashi Kokubun
Because d80226e7bd often reduces the number of unloaded units, it increases the number of unload_units calls, which are heavy. To mitigate that, this throttles unload_units per `max_cache_size / 10`. Also hoping to fix https://ci.appveyor.com/project/ruby/ruby/builds/36552382/job/kjmjgw9cjyf2ksd7
2020-11-28Subsecond of Time::tm should be 0Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3821
2020-11-28Don't double fractional seconds when passing timezone object to Time.newJeremy Evans
I found that fractional seconds were doubled when using the timezone feature of Time in Sequel's named_timezones extension (which uses TZInfo for the timezone object), and traced the problem to this code. There is no subsecx being modified in the utc_to_local call below this, and I'm not sure why you would want to add in the fractional seconds unless you assumed the timezone conversion would drop the existing fractional seconds (TZInfo doesn't drop fractional seconds). Notes: Merged: https://github.com/ruby/ruby/pull/3821
2020-11-27Avoid unloading units which have enough total_callsTakashi Kokubun
instead of just unloading worst 10% methods.
2020-11-27Log when JIT compaction is skipped due to ISeq GCTakashi Kokubun
2020-11-28* 2020-11-28 [ci skip]git
2020-11-27Run unload_units in the JIT worker threadTakashi Kokubun
to avoid "Too many JIT code, but skipped unloading units for JIT compaction". Now we can forget the `in_compact` locking. Moving some functions from mjit.c to mjit_worker.c because mjit_worker.c should have functions executed in the JIT worker.
2020-11-27Update to ruby/spec@c4170a3Benoit Daloze
2020-11-27Update to ruby/spec@ac878adBenoit Daloze
2020-11-27Update to ruby/mspec@b58e665Benoit Daloze
2020-11-27Use opaque struct pointer than voidNobuyoshi Nakada
2020-11-27configure.ac: Check x86intrin.h only when the target CPU is x86Yusuke Endoh
The check output a warning on M1 Mac mini http://rubyci.s3.amazonaws.com/osx1100arm/ruby-master/log/20201127T074507Z.log.html.gz ``` checking x86intrin.h usability... no checking x86intrin.h presence... yes configure: WARNING: x86intrin.h: present but cannot be compiled configure: WARNING: x86intrin.h: check for missing prerequisite headers? configure: WARNING: x86intrin.h: see the Autoconf documentation configure: WARNING: x86intrin.h: section "Present But Cannot Be Compiled" configure: WARNING: x86intrin.h: proceeding with the compiler's result checking for x86intrin.h... no ``` Notes: Merged: https://github.com/ruby/ruby/pull/3820
2020-11-27Clarify spec and change of behavior for Random::DEFAULTBenoit Daloze
2020-11-27Cache access to reg_cfp->self on JITTakashi Kokubun
``` $ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml before --jit: ruby 3.0.0dev (2020-11-27T06:41:15Z master 8ce1711c25) +JIT [x86_64-linux] after --jit: ruby 3.0.0dev (2020-11-27T08:36:02Z master 2c592126b9) +JIT [x86_64-linux] last_commit=Cache access to reg_cfp->self on JIT Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 82.40522392468650 82.66023870551237 fps 82.67998539899482 83.08660305312587 85.51280693947453 87.09311989553235 86.32925337181406 87.16115255191410 87.35617494926235 87.30699391518075 87.91865339426212 88.47590342996875 88.11573661006648 88.64778616696353 88.16060826662158 88.67015079203991 88.21639244865058 89.19630739497482 88.47241577897603 89.23443637947730 89.37087287229809 89.57052723997015 89.46969964699964 89.97803363889025 ```
2020-11-27mark default_randKoichi Sasada
default_rand can points a Bignum seed, so it should be marked.
2020-11-27per-ractor Random::DEFAULTKoichi Sasada
Random generators are not Ractor-safe, so we need to prepare per-ractor default random genearators. This patch set `Random::DEFAULT = Randm` (not a Random instance, but the Random class) and singleton methods like `Random.rand()` use a per-ractor random generator. [Feature #17322] Notes: Merged: https://github.com/ruby/ruby/pull/3813
2020-11-26Revert "Set VM_FRAME_FLAG_FINISH at once on MJIT"Takashi Kokubun
This reverts commit 4d2c8edca69884a41d2f843d36023e3decdb9872. Unfortunately this seems to cause several issues: https://github.com/ruby/ruby/runs/1462188376?check_suite_focus=true http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3272802
2020-11-26Set VM_FRAME_FLAG_FINISH at once on MJITTakashi Kokubun
Performance is probably improved? $ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml before --jit: ruby 3.0.0dev (2020-11-27T04:37:47Z master 69e77e81dc) +JIT [x86_64-linux] after --jit: ruby 3.0.0dev (2020-11-27T05:28:19Z master df6b05c6dd) +JIT [x86_64-linux] last_commit=Set VM_FRAME_FLAG_FINISH at once Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 80.89292998533379 82.19497327502751 fps 80.93130641142331 85.13943315260148 81.06214830270119 87.43757879797808 82.29172808453910 87.89942441487113 84.61206450455929 87.91309779491075 85.44545883567997 87.98026086648694 86.02923132404449 88.03081060383973 86.07411817365879 88.14650206137341 86.34348799602836 88.32791633649961 87.90257338977324 88.57599644892220 88.58006509876580 88.67426384743277 89.26611118140011 88.81669430874207 This should have no bad impact on VM because this function is ALWAYS_INLINE.
2020-11-26Run rb_print_backtrace first on ruby_on_ciTakashi Kokubun
Unfortunately we couldn't see a C backtrace with the previous commit http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3272697.
2020-11-26Call rb_bug_without_die on CITakashi Kokubun
when GC.compact's SEGV handler is installed