Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ The following bundled gems are promoted from default gems.
* pstore 0.2.0
* benchmark 0.4.1
* logger 1.7.0
* rdoc 6.14.2
* rdoc 6.15.0
* win32ole 1.9.2
* irb 1.15.2
* reline 0.6.2
Expand Down Expand Up @@ -192,7 +192,7 @@ The following default gems are updated.
* openssl 4.0.0.pre
* optparse 0.7.0.dev.2
* pp 0.6.3
* prism 1.5.1
* prism 1.5.2
* psych 5.2.6
* resolv 0.6.2
* stringio 3.1.8.dev
Expand All @@ -205,15 +205,15 @@ The following bundled gems are added.

The following bundled gems are updated.

* minitest 5.25.5
* minitest 5.26.0
* rake 13.3.0
* test-unit 3.7.0
* rexml 3.4.2
* net-imap 0.5.10
* rexml 3.4.4
* net-imap 0.5.12
* net-smtp 0.5.1
* matrix 0.4.3
* prime 0.1.4
* rbs 3.9.4
* rbs 3.9.5
* debug 1.11.0
* base64 0.3.0
* bigdecimal 3.2.2
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/building_ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* [autoconf] - 2.67 or later
* [gperf] - 3.1 or later
* Usually unneeded; only if you edit some source files using gperf
* ruby - 3.0 or later
* ruby - 3.1 or later
* We can upgrade this version to system ruby version of the latest
Ubuntu LTS.
* git - 2.32 or later
Expand Down
2 changes: 1 addition & 1 deletion doc/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ sh ../../ruby/configure -C --disable-install-doc --with-opt-dir=C:\Users\usernam

4. If you want to build from GIT source, following commands are required.
* `git`
* `ruby` 3.0 or later
* `ruby` 3.1 or later

You can use [scoop](https://scoop.sh/) to install them like:

Expand Down
1 change: 1 addition & 0 deletions insns.def
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ opt_aref
* default_proc. This is a method call. So opt_aref is
* (surprisingly) not leaf. */
// attr bool leaf = false; /* has rb_funcall() */ /* calls #yield */
// attr bool zjit_profile = true;
{
val = vm_opt_aref(recv, obj);

Expand Down
2 changes: 1 addition & 1 deletion lib/prism/prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "prism"
spec.version = "1.5.1"
spec.version = "1.5.2"
spec.authors = ["Shopify"]
spec.email = ["ruby@shopify.com"]

Expand Down
2 changes: 1 addition & 1 deletion prism/extension.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PRISM_EXT_NODE_H
#define PRISM_EXT_NODE_H

#define EXPECTED_PRISM_VERSION "1.5.1"
#define EXPECTED_PRISM_VERSION "1.5.2"

#include <ruby.h>
#include <ruby/encoding.h>
Expand Down
2 changes: 1 addition & 1 deletion prism/templates/lib/prism/serialize.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Prism

# The patch version of prism that we are expecting to find in the serialized
# strings.
PATCH_VERSION = 1
PATCH_VERSION = 2

# Deserialize the dumped output from a request to parse or parse_file.
#
Expand Down
4 changes: 2 additions & 2 deletions prism/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
/**
* The patch version of the Prism library as an int.
*/
#define PRISM_VERSION_PATCH 1
#define PRISM_VERSION_PATCH 2

/**
* The version of the Prism library as a constant string.
*/
#define PRISM_VERSION "1.5.1"
#define PRISM_VERSION "1.5.2"

#endif
4 changes: 3 additions & 1 deletion tool/missing-baseruby.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
call :warn "executable host ruby is required. use --with-baseruby option."
call :warn "Note that BASERUBY must be Ruby 3.1.0 or later."
call :abort
: || (:^; abort if RUBY_VERSION < s[%r"warn .*Ruby ([\d.]+)(?:\.0)?",1])
(goto :eof ^;)
abort unless defined?(RubyVM::InstructionSequence)
abort if RUBY_VERSION < s[%r"warn .*Ruby ([\d.]+)(?:\.0)?",1]
2 changes: 1 addition & 1 deletion zjit.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ rb_zjit_print_exception(void)
rb_warn("Ruby error: %"PRIsVALUE"", rb_funcall(exception, rb_intern("full_message"), 0));
}

enum {
enum zjit_exported_constants {
RB_INVALID_SHAPE_ID = INVALID_SHAPE_ID,
};

Expand Down
1 change: 1 addition & 0 deletions zjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def stats_string

# Show counters independent from exit_* or dynamic_send_*
print_counters_with_prefix(prefix: 'not_inlined_cfuncs_', prompt: 'not inlined C methods', buf:, stats:, limit: 20)
print_counters_with_prefix(prefix: 'not_annotated_cfuncs_', prompt: 'not annotated C methods', buf:, stats:, limit: 20)

# Show fallback counters, ordered by the typical amount of fallbacks for the prefix at the time
print_counters_with_prefix(prefix: 'unspecialized_def_type_', prompt: 'not optimized method types', buf:, stats:, limit: 20)
Expand Down
2 changes: 1 addition & 1 deletion zjit/bindgen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ fn main() {
.allowlist_function("rb_zjit_insn_leaf")
.allowlist_type("robject_offsets")
.allowlist_type("rstring_offsets")
.allowlist_var("RB_INVALID_SHAPE_ID")
.allowlist_type("zjit_exported_constants")
.allowlist_function("rb_assert_holding_vm_lock")
.allowlist_function("rb_jit_shape_too_complex_p")
.allowlist_function("rb_jit_multi_ractor_p")
Expand Down
2 changes: 1 addition & 1 deletion zjit/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
Insn::CCallWithFrame { cd, state, args, .. } if args.len() > C_ARG_OPNDS.len() =>
gen_send_without_block(jit, asm, *cd, &function.frame_state(*state), SendFallbackReason::CCallWithFrameTooManyArgs),
Insn::CCallWithFrame { cfunc, args, cme, state, .. } => gen_ccall_with_frame(jit, asm, *cfunc, opnds!(args), *cme, &function.frame_state(*state)),
Insn::CCallVariadic { cfunc, recv, args, name: _, cme, state } => {
Insn::CCallVariadic { cfunc, recv, args, name: _, cme, state, return_type: _, elidable: _ } => {
gen_ccall_variadic(jit, asm, *cfunc, opnd!(recv), opnds!(args), *cme, &function.frame_state(*state))
}
Insn::GetIvar { self_val, id, state: _ } => gen_getivar(asm, opnd!(self_val), *id),
Expand Down
11 changes: 6 additions & 5 deletions zjit/src/cruby_bindings.inc.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions zjit/src/cruby_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ pub struct FnProperties {
pub elidable: bool,
}

/// A safe default for un-annotated Ruby methods: we can't optimize them or their returned values.
impl Default for FnProperties {
fn default() -> Self {
Self {
no_gc: false,
leaf: false,
return_type: types::BasicObject,
elidable: false,
}
}
}

impl Annotations {
/// Query about properties of a C method
pub fn get_cfunc_properties(&self, method: *const rb_callable_method_entry_t) -> Option<FnProperties> {
Expand Down Expand Up @@ -140,11 +152,12 @@ pub fn init() -> Annotations {
let builtin_funcs = &mut HashMap::new();

macro_rules! annotate {
($module:ident, $method_name:literal, $return_type:expr, $($properties:ident),+) => {
($module:ident, $method_name:literal, $return_type:expr $(, $properties:ident)*) => {
#[allow(unused_mut)]
let mut props = FnProperties { no_gc: false, leaf: false, elidable: false, return_type: $return_type };
$(
props.$properties = true;
)+
)*
annotate_c_method(cfuncs, unsafe { $module }, $method_name, props);
}
}
Expand All @@ -167,11 +180,14 @@ pub fn init() -> Annotations {

annotate!(rb_mKernel, "itself", types::BasicObject, no_gc, leaf, elidable);
annotate!(rb_cString, "bytesize", types::Fixnum, no_gc, leaf);
annotate!(rb_cString, "to_s", types::StringExact);
annotate!(rb_cModule, "name", types::StringExact.union(types::NilClass), no_gc, leaf, elidable);
annotate!(rb_cModule, "===", types::BoolExact, no_gc, leaf);
annotate!(rb_cArray, "length", types::Fixnum, no_gc, leaf, elidable);
annotate!(rb_cArray, "size", types::Fixnum, no_gc, leaf, elidable);
annotate!(rb_cArray, "empty?", types::BoolExact, no_gc, leaf, elidable);
annotate!(rb_cArray, "reverse", types::ArrayExact, leaf, elidable);
annotate!(rb_cArray, "join", types::StringExact);
annotate!(rb_cHash, "empty?", types::BoolExact, no_gc, leaf, elidable);
annotate!(rb_cNilClass, "nil?", types::TrueClass, no_gc, leaf, elidable);
annotate!(rb_mKernel, "nil?", types::FalseClass, no_gc, leaf, elidable);
Expand Down
Loading