[pull] master from ruby:master#870
Merged
pull[bot] merged 21 commits intoturkdevops:masterfrom Mar 21, 2026
Merged
Conversation
* eliminate redundant jumps * update merge tests * add some test coverage * push insns as usual * wipwipwip * fix reg imm imm * update tests * oops * collapse some branches * refactor x86 split pass * remove unused assert * do not hardcode reg numbers * fix rust errors
* Use sparse sorted Vec for IseqProfile instead of dense pre-allocated Vecs Replace the two dense Vec fields (opnd_types and num_profiles) that were pre-allocated to iseq_size for every ISEQ with a single sorted Vec<(u32, ProfileEntry)> that only allocates entries for instructions that actually get profiled. Lookups use binary search. On Lobsters benchmark: zjit_alloc_bytes drops from 38.9 MB to 20.7 MB (46.8% reduction) with no performance regression. Use sparse storage for profiles and use u16 for counts instead of usize. Keep profiles in a sparse vec sorted by bytecode instruction index. ``` ┌─────────────────────┬─────────────────┬───────────────────┬────────┐ │ Metric │ upstream/master │ mb-sparse-profile │ Change │ ├─────────────────────┼─────────────────┼───────────────────┼────────┤ │ zjit_alloc_bytes │ 31.47 MB │ 14.99 MB │ −52.4% │ ├─────────────────────┼─────────────────┼───────────────────┼────────┤ │ total_mem_bytes │ 57.52 MB │ 41.05 MB │ −28.6% │ ├─────────────────────┼─────────────────┼───────────────────┼────────┤ │ compile_time │ 1,170ms │ 1,206ms │ +3.1% │ ├─────────────────────┼─────────────────┼───────────────────┼────────┤ │ profile_time │ 9ms │ 10ms │ ~same │ └─────────────────────┴─────────────────┴───────────────────┴────────┘ ```
The make-snapshot process needs dump_ast (a C program) to generate .rbinc files via mk_builtin_loader.rb. Since CC=false in prereq.status prevents make from compiling C code, build dump_ast directly using the system compiler before running make prepare-package. The generated prism C sources and headers are created from ERB templates using BASERUBY before compilation, as they are not checked into git.
This reverts commit a5e2cbc.
When building from a snapshot/tarball without BASERUBY, the .rbinc files are pre-generated and should not be rebuilt. However, DUMP_AST_TARGET was set to $(DUMP_AST) unconditionally, causing a freshly compiled dump_ast to trigger .rbinc regeneration which requires BASERUBY. Clear DUMP_AST_TARGET when HAVE_BASERUBY=no so the pre-generated .rbinc files are used as-is.
* JAVA_STRING_TYPE and related change to IDENTIFIER * TruffleRuby still uses java.lang.String Fixes ruby/prism#4009 ruby/prism@cbe91a3f36
* Allocate array of byte[] as byte[length][]. * Default JAVA_BACKEND to "default" with "truffleruby" the custom option. ruby/prism@6ad180a00d
Take a method, unbound method, proc, or thread backtrace location. This is our equivalent to RubyVM::AbstractSyntaxTree.of, and could be leveraged in something like error highlight. Note that this uses CRuby-specific APIs on CRuby, and falls back to using location-based APIs when those aren't available. ruby/prism@02a93356a3
Implements codegen for `ArrayMax` (opt_newarray_max) by calling the `rb_vm_opt_newarray_max` VM helper, following the same pattern as `ArrayHash` and `ArrayInclude`.
Add reusable helpers for getting fields, making C calls, etc. De-indent a bunch of stuff.
I noticed that we're generating machine code that unboxes fixnum constants. Since the fixnum is constant, and known at compile time, we can unbox it eagerly and convert it to a Const CInt64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )