summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-27[ruby/cgi] Set extconf.rb to extensionsNobuyoshi Nakada
Fix https://github.com/ruby/cgi/pull/11 https://github.com/ruby/cgi/commit/60d8f5e7d9
2021-11-26YJIT: Add ability to exit to interpreter from stubsAlan Wu
Previously, YJIT assumed that it's always possible to generate a new basic block when servicing a stub in branch_stub_hit(). When YJIT is out of executable memory, for example, this assumption doesn't hold up. Add handling to branch_stub_hit() for servicing stubs without consuming more executable memory by adding a code path that exits to the interpreter at the location the branch stub represents. The new code path reconstructs interpreter state in branch_stub_hit() and then exits with a new snippet called `code_for_exit_from_stub` that returns `Qundef` from the YJIT native stack frame. As this change adds another place where we regenerate code from `branch_t`, extract the logic for it into a new function and call it regenerate_branch(). While we are at it, make the branch shrinking code path in branch_stub_hit() more explicit. This new functionality is hard to test without full support for out of memory conditions. To verify this change, I ran `RUBY_YJIT_ENABLE=1 make check -j12` with the following patch to stress test the new code path: ```diff diff --git a/yjit_core.c b/yjit_core.c index 4ab63d9806..5788b8c5ed 100644 --- a/yjit_core.c +++ b/yjit_core.c @@ -878,8 +878,12 @@ branch_stub_hit(branch_t *branch, const uint32_t target_idx, rb_execution_contex cb_set_write_ptr(cb, branch->end_addr); } +if (rand() < RAND_MAX/2) { // Compile the new block version p_block = gen_block_version(target, target_ctx, ec); +}else{ + p_block = NULL; +} if (!p_block && branch_modified) { // We couldn't generate a new block for the branch, but we modified the branch. ``` We can enable the new test along with other OOM tests once full support lands. Other small changes: * yjit_utils.c (print_str): Update to work with new native frame shape. Follow up for 8fa0ee4d404. * yjit_iface.c (rb_yjit_init): Run yjit_init_core() after yjit_init_codegen() so `cb` and `ocb` are available. Notes: Merged: https://github.com/ruby/ruby/pull/5180 Merged-By: XrXr
2021-11-27[rubygems/rubygems] Fix missing locked specs when depended on other platformDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0396e899db
2021-11-27* 2021-11-27 [ci skip]git
2021-11-26Improve performance of embedded string allocationPeter Zhu
Non-VWA embedded string allocation had a performance regression. This commit improves performance of non-VWA embedded string allocation. Notes: Merged: https://github.com/ruby/ruby/pull/5183
2021-11-26mkmf: take `PKG_CONFIG_PATH` from `dir_config` library pathNobuyoshi Nakada
So that version dependent pkg-config files can override files in the default locations. Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26mkmf: deal with environment variables in MakeMakefile#xpopenNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26mkmf: MakeMakefile#xpopen may be passed an option hashNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26[MSWin] Replace -Zi in DEBUGFLAGS with -Z7 to suppress warningsNobuyoshi Nakada
2021-11-26Fix a function name in an error messageKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/5181
2021-11-26Remove unused function `size_pool_for_size`Kazuhiro NISHIYAMA
``` compiling ../gc.c ../gc.c:2444:1: warning: unused function 'size_pool_for_size' [-Wunused-function] size_pool_for_size(rb_objspace_t *objspace, size_t size) ^ 1 warning generated. ``` Notes: Merged: https://github.com/ruby/ruby/pull/5181
2021-11-26Try test_interrupt_in_other_threadNobuyoshi Nakada
Seems working now probably because of system library updates.
2021-11-26initialize allocated memory by VWA for assertionsKoichi Sasada
When `RGENGC_CHECK_MODE` is enable, `obj_memsize_of` is called in `newobj_init` and it expect the memory is zero-cleared.
2021-11-26Move win32ole.gemspec to the proper placeNobuyoshi Nakada
2021-11-26fix to choose correct callcacheKoichi Sasada
It should retun general `cc`, not for overloaded (mandatory only) method call cache. This issue is reported by @shugo and @ktou https://twitter.com/shugomaeda/status/1463699797182119936 Notes: Merged: https://github.com/ruby/ruby/pull/5173
2021-11-26[rubygems/rubygems] Fix `bundle info` sometimes claiming that bundler has ↵David Rodríguez
been deleted https://github.com/rubygems/rubygems/commit/fe1a31db31
2021-11-25YJIT: Introduce jit_putobject (#5179)John Hawthorn
* YJIT: Introduce jit_putobject This extracts the logic previously inside gen_putobject to a more reusable helper method jit_putobject. The motivation for this is that it both simplifies the implementation of other instructions, and other instructions can reuse the optimized behaviour for 32-bit special constants (most importantly opt_getinlinecache). This commit also expands the optimization to use a mov directly to memory when we encounter a 32-bit immediate constant. Previously it covered fixnums and Qtrue/Qfalse, now it will cover any SPECIAL_CONST_P value which can be represented as a 32-bit immediate. Notably, this includes static symbols, and Qnil. * Style touchups and a comment * delete empty line Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Notes: Merged-By: jhawthorn <john@hawthorn.email>
2021-11-25YJIT: Implement new struct accessors (#5161)John Hawthorn
* YJIT: Implement optimized_method_struct_aref * YJIT: Implement struct_aref without method call Struct member reads can be compiled directly into a memory read (with either one or two levels of indirection). * YJIT: Implement optimized struct aset * YJIT: Update tests for struct access * YJIT: Add counters for remaining optimized methods * Check for INT32_MAX overflow It only takes a struct with 0x7fffffff/8+1 members. Also add some cheap compile time checks. * Add tests for non-embedded struct aref/aset Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Notes: Merged-By: jhawthorn <john@hawthorn.email>
2021-11-25Correct indentation error in numeric.c (#5178)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-25Revert "Add GC.stat_size_pool to get stats for a size pool"Peter Zhu
This reverts commit 6157619bb68e4307cdf065cb73d5bfcec30d042d. We'll wait for comments in the open ticket: https://bugs.ruby-lang.org/issues/18364 Notes: Merged: https://github.com/ruby/ruby/pull/5176
2021-11-25Add GC.stat_size_pool to get stats for a size poolPeter Zhu
GC.stat_size_pool will return stats for a particular size pool. This is used for the Variable Width Allocation feature. Notes: Merged: https://github.com/ruby/ruby/pull/5169
2021-11-26* 2021-11-26 [ci skip]git
2021-11-25Add win32ole to sync_default_gems.rbNobuyoshi Nakada
2021-11-25[ruby/win32ole] Scale timeout in win32oleNobuyoshi Nakada
https://github.com/ruby/win32ole/commit/7e04d0eb3e Notes: Merged: https://github.com/ruby/ruby/pull/5175
2021-11-25[ruby/win32ole] Fix typos [ci skip]Nobuyoshi Nakada
https://github.com/ruby/win32ole/commit/8d46bd0c93 Notes: Merged: https://github.com/ruby/ruby/pull/5175
2021-11-25[ruby/win32ole] LICENSEHiroshi SHIBATA
https://github.com/ruby/win32ole/commit/62fd78078b Notes: Merged: https://github.com/ruby/ruby/pull/5175
2021-11-25Split skipped tests stepNobuyoshi Nakada
2021-11-25Keep the generated source files when clean [Bug #18363]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5174
2021-11-25Ignore pkg-config installation failure due to unmet dependenciesNobuyoshi Nakada
2021-11-25Stop duplicated runsNobuyoshi Nakada
2021-11-25fix assertion on `gc_cc_cme()`Koichi Sasada
`cc->cme_` can be NULL when it is not initialized yet. It can be observed on `GC.stress == true` running. Notes: Merged: https://github.com/ruby/ruby/pull/5172
2021-11-25Skip tests if only document files changed on Cirrus-CI [ci skip]Nobuyoshi Nakada
2021-11-25test/ruby/test_iseq.rb: Avoid pollution of method namespaceYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20211125T003004Z.log.html.gz ``` [ 4780/21204] TestISeq#test_super_with_anonymous_block/home/chkbuild/chkbuild/tmp/build/20211125T003004Z/ruby/test/ruby/test_iseq.rb:141: warning: method redefined; discarding old touch3 /home/chkbuild/chkbuild/tmp/build/20211125T003004Z/ruby/test/ruby/test_iseq.rb:121: warning: previous definition of touch3 was here = 0.00 s ```
2021-11-24update YJIT docs to reference RubyVM::YJIT instead of just YJITAdam Hess
[ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/5171 Merged-By: XrXr
2021-11-24Whats here for float (#5170)Burdette Lamar
* What's Here for Float Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-24Enhanced RDoc for Float#floor (#5167)Burdette Lamar
* Enhanced RDoc for Float#floor * Enhanced RDoc for Float * Enhanced RDoc for Float Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-25* 2021-11-25 [ci skip]git
2021-11-25[rubygems/rubygems] Fix bad instance variable nameDavid Rodríguez
Recent changes made a warning while running specs show up for some reason, and it revealed this error. https://github.com/rubygems/rubygems/commit/bbf55de38e
2021-11-25[rubygems/rubygems] Check not having load system features also for ↵David Rodríguez
successful runs https://github.com/rubygems/rubygems/commit/4807bd19a5
2021-11-25[rubygems/rubygems] These method should be returning a stringDavid Rodríguez
https://github.com/rubygems/rubygems/commit/dc391f4d87
2021-11-25[rubygems/rubygems] We should be checking raised exception, not status code hereDavid Rodríguez
https://github.com/rubygems/rubygems/commit/48f8cdab9c
2021-11-25[rubygems/rubygems] Don't replace ENV twice on non Windows platformsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8dc86b7096
2021-11-24No need to link and install .pdb anymoreAlan Wu
With /Z7, no .pdb file is generated, so trying to link it during build fails on my machine even though it's okay on CI. By the way, in my local testing, no .pdb is generated in cwd at runtime even without the /Fd option. I guess we can pass it just in case. Notes: Merged: https://github.com/ruby/ruby/pull/5058
2021-11-24MJIT MSVC: Use /Z7 to avoid PDB write raceAlan Wu
With MSVC, MJIT uses the /Fd option on an installed PDB file when compiling. Combined with the /Zi option, this causes the PDB file to be modified every time MJIT compiles. Concurrent modifications to the same PDB file is known to cause problems. MSVC even has an option, /FS to deal with it. When running MJIT tests in parallel, sometimes this leads to corrupting the PDB file, breaking subsequent compilations. On CI, we get messages like these: rb_mjit_header-3.1.0.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header. To avoid this race, use the /Z7 option when building precompiled header, which asks the compiler to put debug info into the .obj file, eliminating the need for pointing the compiler to the PDB file for the precompiled header. The /Fd option is changed to use a unique path based on the name of the dll output. Because of the /debug linker flag, we generate a PDB file at runtime even though we use /Z7. There are a couple things missing from this change: - Because MJIT uses the interpreter's CFLAGS build option and that contains /Zi, putting /Z7 at the end leads to a build warning - With /Z7 no PDB file is built anymore, so the code for installing the PDB file can be removed There might also be other problems with this change I haven't noticed while developing this change using Github Actions. I don't have a Windows dev environment with Visual Studio so I can't finish this change easily. Please feel free to complete this change if it makes sense. Note: - On master, you can see the PDB file changing with llvm-pdbutil or a simple checksum. There is an age field in the file that is bumped - I'm not sure if users can specify compile flags on MSVC. If they couldn't, maybe it's easier to change MJIT's compile options to use /Z7 when building the precompile header. - MJIT could pass different options at runtime to generate fewer files. Right now it inherits the /DEBUG linker flag which causes a PDB file to be generated at runtime even though /Z7 is used. Relevant MSVC docs: - [/Zi,/Z7](https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-160) - [/DEBUG](https://docs.microsoft.com/en-us/cpp/build/reference/debug-generate-debug-info?view=msvc-160) - [/FS](https://docs.microsoft.com/en-us/cpp/build/reference/fs-force-synchronous-pdb-writes?view=msvc-160) Notes: Merged: https://github.com/ruby/ruby/pull/5058
2021-11-24Enhanced RDoc for Float#prev_float (#5162)Burdette Lamar
* Enhanced RDoc for Float#prev_float Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-24Fix typofurunkel
Notes: Merged: https://github.com/ruby/ruby/pull/5107
2021-11-24[Actions] use windows-2022 for mingwMSP-Greg
MSP-Greg/ruby-setup-ruby@win-ucrt-1 Notes: Merged: https://github.com/ruby/ruby/pull/5158
2021-11-24[ruby/zlib] [Bug #18358] Fix crash in zlib when in progressPeter Zhu
When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called recursively inside the block, a crash can occur because of an use-after-free bug. https://github.com/ruby/zlib/commit/50fb8a0338
2021-11-24[ruby/cgi] Bump versionYusuke Endoh
https://github.com/ruby/cgi/commit/c9c800715e
2021-11-24[ruby/cgi] When parsing cookies, only decode the valuesNobuyoshi Nakada
https://github.com/ruby/cgi/commit/052eb3a828