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
2 changes: 1 addition & 1 deletion .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
test-all-opts: '--name=!/TestObjSpace#test_reachable_objects_during_iteration/'
- msystem: 'CLANGARM64'
os: 11-arm
test_task: 'test'
test_task: 'check'
fail-fast: false

if: >-
Expand Down
29 changes: 22 additions & 7 deletions ext/stringio/stringio.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,32 @@ strio_s_allocate(VALUE klass)
* call-seq:
* StringIO.new(string = '', mode = 'r+') -> new_stringio
*
* Note that +mode+ defaults to <tt>'r'</tt> if +string+ is frozen.
*
* Returns a new \StringIO instance formed from +string+ and +mode+;
* see {Access Modes}[rdoc-ref:File@Access+Modes]:
* the instance should be closed when no longer needed:
*
* strio = StringIO.new # => #<StringIO>
* strio = StringIO.new
* strio.string # => ""
* strio.closed_read? # => false
* strio.closed_write? # => false
* strio.close
*
* The instance should be closed when no longer needed.
* If +string+ is frozen, the default +mode+ is <tt>'r'</tt>:
*
* strio = StringIO.new('foo'.freeze)
* strio.string # => "foo"
* strio.closed_read? # => false
* strio.closed_write? # => true
* strio.close
*
* Argument +mode+ must be a valid
* {Access Mode}[rdoc-ref:File@Access+Modes],
* which may be a string or an integer constant:
*
* StringIO.new('foo', 'w+')
* StringIO.new('foo', File::RDONLY)
*
* Related: StringIO.open (accepts block; closes automatically).
* Related: StringIO.open
* (passes the \StringIO object to the block; closes the object automatically on block exit).
*/
static VALUE
strio_initialize(int argc, VALUE *argv, VALUE self)
Expand Down Expand Up @@ -712,7 +727,7 @@ strio_set_lineno(VALUE self, VALUE lineno)
* binmode -> self
*
* Sets the data mode in +self+ to binary mode;
* see {Data Mode}[https://docs.ruby-lang.org/en/master/File.html#class-File-label-Data+Mode].
* see {Data Mode}[rdoc-ref:File@Data+Mode].
*
*/
static VALUE
Expand Down
2 changes: 1 addition & 1 deletion namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const rb_data_type_t rb_root_namespace_data_type = {
namespace_entry_memsize,
rb_namespace_gc_update_references,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers
&rb_namespace_data_type, 0, RUBY_TYPED_FREE_IMMEDIATELY // TODO: enable RUBY_TYPED_WB_PROTECTED when inserting write barriers
};

VALUE
Expand Down
13 changes: 3 additions & 10 deletions zjit/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,9 @@ fn gen_get_ep(asm: &mut Assembler, level: u32) -> Opnd {

fn gen_objtostring(jit: &mut JITState, asm: &mut Assembler, val: Opnd, cd: *const rb_call_data, state: &FrameState) -> Opnd {
gen_prepare_non_leaf_call(jit, asm, state);

let iseq_opnd = Opnd::Value(jit.iseq.into());

// TODO: Specialize for immediate types
// Call rb_vm_objtostring(iseq, recv, cd)
let ret = asm_ccall!(asm, rb_vm_objtostring, iseq_opnd, val, (cd as usize).into());
let ret = asm_ccall!(asm, rb_vm_objtostring, VALUE(jit.iseq as usize).into(), val, (cd as usize).into());

// TODO: Call `to_s` on the receiver if rb_vm_objtostring returns Qundef
// Need to replicate what CALL_SIMPLE_METHOD does
Expand Down Expand Up @@ -836,16 +833,12 @@ fn gen_setivar(jit: &mut JITState, asm: &mut Assembler, recv: Opnd, id: ID, val:

fn gen_getclassvar(jit: &mut JITState, asm: &mut Assembler, id: ID, ic: *const iseq_inline_cvar_cache_entry, state: &FrameState) -> Opnd {
gen_prepare_non_leaf_call(jit, asm, state);

let iseq = asm.load(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_ISEQ));
asm_ccall!(asm, rb_vm_getclassvariable, iseq, CFP, id.0.into(), Opnd::const_ptr(ic))
asm_ccall!(asm, rb_vm_getclassvariable, VALUE(jit.iseq as usize).into(), CFP, id.0.into(), Opnd::const_ptr(ic))
}

fn gen_setclassvar(jit: &mut JITState, asm: &mut Assembler, id: ID, val: Opnd, ic: *const iseq_inline_cvar_cache_entry, state: &FrameState) {
gen_prepare_non_leaf_call(jit, asm, state);

let iseq = asm.load(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_ISEQ));
asm_ccall!(asm, rb_vm_setclassvariable, iseq, CFP, id.0.into(), val, Opnd::const_ptr(ic));
asm_ccall!(asm, rb_vm_setclassvariable, VALUE(jit.iseq as usize).into(), CFP, id.0.into(), val, Opnd::const_ptr(ic));
}

/// Look up global variables
Expand Down