1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/misc
Alan Wu f41b4d44f9 YJIT: Bounds check every byte in the assembler
Previously, YJIT assumed that basic blocks never consume more than
1 KiB of memory. This assumption does not hold for long Ruby methods
such as the one in the following:

```ruby
eval(<<RUBY)
def set_local_a_lot
  #{'_=0;'*0x40000}
end
RUBY

set_local_a_lot
```

For low `--yjit-exec-mem-size` values, one basic block could exhaust the
entire buffer.

Introduce a new field `codeblock_t::dropped_bytes` that the assembler
sets whenever it runs out of space. Check this field in
gen_single_block() to respond to out of memory situations and other
error conditions. This design avoids making the control flow graph of
existing code generation functions more complex.

Use POSIX shell in misc/test_yjit_asm.sh since bash is expanding
`0%/*/*` differently.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-12-03 20:02:25 -05:00
..
expand_tabs.rb
lldb_cruby.py Follow up the RString change [ci skip] 2021-10-28 08:58:59 +09:00
lldb_disasm.py Fix typos 2021-11-02 19:17:37 +09:00
lldb_yjit.py Add an lldb script to print YJIT comments 2021-10-20 18:19:37 -04:00
rb_optparse.bash
rb_optparse.zsh
README
ruby-style.el
test_lldb_cruby.rb
test_yjit_asm.sh YJIT: Bounds check every byte in the assembler 2021-12-03 20:02:25 -05:00
yjit_asm_tests.c YJIT: Bounds check every byte in the assembler 2021-12-03 20:02:25 -05:00

README             this file
rb_optparse.bash   bash completion script
rb_optparse.zsh    zsh completion script
ruby-style.el      Ruby's C/C++ mode style for emacs
lldb_cruby.py      LLDB port of debug utility
test_lldb_cruby.rb test file for LLDB port