summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-10-05YJIT: Remove duplicate cfp->iseq accessorAlan Wu
2023-10-05YJIT: Avoid writing return value to memory in `leave`Alan Wu
Previously, at the end of `leave` we did `*caller_cfp->sp = return_value`, like the interpreter. With future changes that leaves the SP field uninitialized for C frames, this will become problematic. For cases like returning from `rb_funcall()`, the return value was written above the stack and never read anyway (callers use the copy in the return register). Leave the return value in a register at the end of `leave` and have the code at `cfp->jit_return` decide what to do with it. This avoids the unnecessary memory write mentioned above. For JIT-to-JIT returns, it goes through `asm.stack_push()` and benefits from register allocation for stack temporaries. Mostly flat on benchmarks, with maybe some marginal speed improvements. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-10-06Remove `NODE_VALUES`Nobuyoshi Nakada
This node type was added for the multi-value experiment back in 2004. The feature itself was removed after a few years, but this is its remnant.
2023-10-06Remove unmatch parenthesisNobuyoshi Nakada
``` yjit/yjit.mk:48: Extraneous text after `ifneq' directive ```
2023-10-05YJIT: Build on BSD platforms with GNU make (#8591)Thomas Hurst
2023-10-05[ruby/prism] Check for duplicate parameter names in destructured paramsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/c3438aabea
2023-10-05[ruby/prism] Check for duplicate names in shadow argsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/e100c6b8ae
2023-10-05[ruby/prism] Fix parsing shadow args in lambda blocksHaldun Bayhantopcu
https://github.com/ruby/prism/commit/53efaf252d
2023-10-05Make popcount bit-masks stricterNobuyoshi Nakada
Each bit run is upto the right shift count, so the each mask does not need more upper bits.
2023-10-05[ruby/stringio] StringIO#pread: handle 0 length like IO#preadJean byroot Boussier
(https://github.com/ruby/stringio/pull/67) Fix: https://github.com/ruby/stringio/issues/66 If length is 0, IO#pread don't even try to read the IO, it simply return the buffer untouched if there is one or a new empty buffer otherwise. It also doesn't validate the offset when length is 0. cc @jdelStrother @kou https://github.com/ruby/stringio/commit/37e9279337 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-10-05[ruby/net-http] Net::HTTPResponse nil checkingBrian Hawley
Fix nil handling in read_body and stream_check. Fixes: #70 https://github.com/ruby/net-http/commit/36f916ac18
2023-10-05Update bundled gems list at 2023-10-05git
2023-10-05Chain nodes to exit onlyNobuyoshi Nakada
2023-10-05Do not chain unexpected nodeNobuyoshi Nakada
2023-10-05Differentiate `NODE_BREAK`/`NODE_NEXT`/`NODE_RETURN`Nobuyoshi Nakada
2023-10-05Remove unused nodes in NODE_RETURN and NODE_REDONobuyoshi Nakada
2023-10-05Move internal NODE_DEF_TEMP to parse.yNobuyoshi Nakada
2023-10-05Remove not used fields from colon nodesyui-knk
2023-10-05Correctly casting node for accessing COLON node nd_mid in compile.cyui-knk
2023-10-05Fix cast typeyui-knk
2023-10-04Remove a binding.irb in rjit-bindgenTakashi Kokubun
2023-10-04[Prism] Fix IfNode and ElseNodeMatt Valentine-House
ElseNode looks to have been implemented at the same time as IfNode, but was resulting in a stack underflow error. The following is from the test code ``` if foo bar end ``` ``` ❯ make run compiling compile.c linking miniruby ./miniruby -I./lib -I. -I.ext/common -r./arm64-darwin22-fake ./test.rb CRUBY: ************************************************** == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(2,19)> 0000 putself ( 2)[Li] 0001 opt_send_without_block <calldata!mid:foo, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 branchunless 9 0005 putself 0006 opt_send_without_block <calldata!mid:bar, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0008 pop 0009 putobject_INT2FIX_1_ 0010 leave PRISM: ************************************************** -- raw disasm-------- 0000 putself ( 2) 0001 send <calldata:foo, 0>, nil ( 2) 0004 branchunless <L001> ( 2) 0006 jump <L000> ( 2) <L000> [sp: 0] * 0008 pop ( 1) 0009 putself ( 2) 0010 send <calldata:bar, 0>, nil ( 2) 0013 pop ( 2) 0014 jump <L002> ( 1) <L001> [sp: 0] <L002> [sp: -1] 0016 putobject 1 ( 2) 0018 leave ( 1) --------------------- <compiled>: <compiled>:1: argument stack underflow (-1) (SyntaxError) make: *** [run] Error 1 ``` This commit fixes the stack underflow error for both IfNode and ElseNode and introduces tests for them.
2023-10-04YJIT: Add a comment for YJIT_OPTIONS [ci skip]Takashi Kokubun
2023-10-04Use a better variable name for wTakashi Kokubun
2023-10-04Make the function names consistentTakashi Kokubun
2023-10-04YJIT: Move help descriptions to options.rsTakashi Kokubun
2023-10-04Split `show_usage_line` and add `ruby_show_usage_line`Nobuyoshi Nakada
2023-10-04Remove magic numbers from `show_usage_line`Nobuyoshi Nakada
2023-10-04[ruby/prism] Remove trailing parenthesis in Location#pretty_printgazayas
https://github.com/ruby/prism/commit/8eaa199a28
2023-10-05Optimize `Range#count` by using `range_size` if possibleKouhei Yanagita
2023-10-04[ruby/prism] [rust] write flag accessor functionsNathan Froyd
https://github.com/ruby/prism/commit/f2333ba4c8
2023-10-04[ruby/prism] give flag enums a non-`typedef`'d nameNathan Froyd
https://github.com/ruby/prism/commit/630af5cb0e
2023-10-04[DOC] Fix typo in docs of IO: `#.` -> `$.`Herwin
2023-10-04[ruby/irb] Clear all context usages in RubyLexStan Lo
(https://github.com/ruby/irb/pull/684) After this change, `RubyLex` will not interact with `Context` directly in any way. This decoupling has a few benefits: - It makes `RubyLex` easier to test as it no longer has a dependency on `Context`. We can see this from the removal of `build_context` from `test_ruby_lex.rb`. - It will make `RubyLex` easier to understand as it will not be affected by state changes in `Context` objects. - It allows `RubyLex` to be used in places where `Context` is not available. https://github.com/ruby/irb/commit/d5b262a076
2023-10-04Special treat when the first line ends with a dot [ci skip]Nobuyoshi Nakada
2023-10-03YJIT: Call mprotect after entry stub failure (#8582)Takashi Kokubun
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2023-10-04[DOC] Fix description for `rb_postponed_job_register_one()`Daisuke Aritomo
The current documentation for `rb_postponed_job_register_one()` is explaining the differences with itself, where it should be explaining the differences with `rb_postponed_job_register()`.
2023-10-04Remove not used fields from variable nodesyui-knk
2023-10-04Update default gems list at e501613efa2b010d6d697a4df264a2 [ci skip]git
2023-10-04[ruby/bigdecimal] Bump up to 3.1.5Nobuyoshi Nakada
https://github.com/ruby/bigdecimal/commit/c47802e813
2023-10-04BigDecimal#to_s has not changed for fraction partNobuyoshi Nakada
The test for integer part was separated at dc54574adefe.
2023-10-03YJIT: add heuristic to avoid compiling cold ISEQs (#8522)Maxime Chevalier-Boisvert
* YJIT: Add counter to measure how often we compile "cold" ISEQs (#535) Fix counter name in DEFAULT_COUNTERS YJIT: add --yjit-cold-threshold, don't compile cold ISEQs YJIT: increase default cold threshold to 200_000 Remove rb_yjit_call_threshold() Remove conflict markers Fix compilation errors Threshold 1 should compile immediately Debug deadlock issue with test_ractor Fix call threshold issue with tests * Revert exception threshold logic. Document option in yjid.md * (void) for 0 parameter functions in C99 * Rename iseq_entry_cold => cold_iseq_entry * Document --yjit-cold-threshold in ruby.c * Update doc/yjit/yjit.md Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com> * Shorten help string to appease test * Address bug found by Kokubun. Reorder logic. --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com>
2023-10-03[ruby/prism] Provide pm_parser_err_current and pm_parser_err_previousKevin Newton
https://github.com/ruby/prism/commit/4828c96939
2023-10-03[ruby/prism] Consolidate diagnostic appendingsKevin Newton
https://github.com/ruby/prism/commit/4f107d8962
2023-10-03[rubygems/rubygems] Prevent gem activation in standalone modeDaniel Colson
As discussed in https://github.com/rubygems/rubygems/issues/6273#issuecomment-1449176658 The `gem` method behaves awkwardly in standalone mode. Assuming bundler isn't loaded at all, a call to gem might activate a gem that is not part of the bundle (because it's the gem method defined in lib/rubygems/core_ext/kernel_gem.rb and not lib/bundler/rubygems_integration.rb). And when running with `--disable-gems`, the gem method won't be defined at all so we'll get a NoMethodError. Calls to `gem` can appear in dependencies outside an application's control. To work around this at GitHub we defined our own `Kernel#gem` that no-ops. I agree with https://github.com/rubygems/rubygems/issues/6273#issuecomment-1440755882 > people using standalone mode don't want to activate gems like Kernel.gem This commit redefines `Kernel#gem` in the standalone script to no-op. https://github.com/rubygems/rubygems/commit/bea17b55f1
2023-10-03YJIT: Stop spilling temps on jit_prepare_routine_call (#8581)Takashi Kokubun
YJIT: Remove spill_temps from jit_prepare_routine_call
2023-10-03Allow changing RUBY_PATCHLEVEL_STR if RUBY_PATCHLEVEL == -1 (#8578)Takashi Kokubun
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-10-03Update default gems list at 5dfbf1a3814c4d84a5ae375751f5f9 [ci skip]git
2023-10-03[ruby/reline] Bump version to 0.3.9ima1zumi
(https://github.com/ruby/reline/pull/594) https://github.com/ruby/reline/commit/b6fb72718a
2023-10-03Support regexp in log-fix [ci skip]Nobuyoshi Nakada