1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool
Kevin Newton 629908586b Finer-grained inline constant cache invalidation
Current behavior - caches depend on a global counter. All constant mutations cause caches to be invalidated.

```ruby
class A
  B = 1
end

def foo
  A::B # inline cache depends on global counter
end

foo # populate inline cache
foo # hit inline cache

C = 1 # global counter increments, all caches are invalidated

foo # misses inline cache due to `C = 1`
```

Proposed behavior - caches depend on name components. Only constant mutations with corresponding names will invalidate the cache.

```ruby
class A
  B = 1
end

def foo
  A::B # inline cache depends constants named "A" and "B"
end

foo # populate inline cache
foo # hit inline cache

C = 1 # caches that depend on the name "C" are invalidated

foo # hits inline cache because IC only depends on "A" and "B"
```

Examples of breaking the new cache:

```ruby
module C
  # Breaks `foo` cache because "A" constant is set and the cache in foo depends
  # on "A" and "B"
  class A; end
end

B = 1
```

We expect the new cache scheme to be invalidated less often because names aren't frequently reused. With the cache being invalidated less, we can rely on its stability more to keep our constant references fast and reduce the need to throw away generated code in YJIT.
2022-03-24 09:14:38 -07:00
..
bundler Merge RubyGems and Bundler master 2022-02-28 11:39:20 +09:00
dummy-rake-compiler/rake Bundle rbs 1.7.0.beta.5 2021-11-09 03:32:46 +09:00
lib [ruby/date] Use assert_deprecated_warn 2022-02-25 20:39:47 +09:00
m4 RUBY_REPLACE_TYPE: check if the target type is a pointer 2022-02-19 15:33:15 +09:00
releng gen-mail.rb: support markdown file path 2022-02-18 21:44:22 +09:00
ruby_vm Finer-grained inline constant cache invalidation 2022-03-24 09:14:38 -07:00
test Let testunit use omit or pend instead of skip 2022-01-16 21:35:09 +09:00
asm_parse.rb
bisect.sh
build-transcode
checksum.rb
ci_functions.sh
colors
darwin-cc
disable_ipv6.sh
downloader.rb Downloader: retry when RFC 2616 noncompliant dates [ci skip] 2021-10-28 17:42:36 +09:00
enc-emoji-citrus-gen.rb
enc-emoji4unicode.rb
enc-unicode.rb
eval.rb
expand-config.rb
extlibs.rb extlibs.rb: Add fallback Colorize 2022-03-24 13:16:13 +09:00
fake.rb fake.rb: Set prefix to $topdir 2022-02-27 21:58:59 +09:00
fetch-bundled_gems.rb Fetch the unmerged revision to test of bundled gems 2022-01-14 14:54:29 +09:00
file2lastrev.rb
format-release tag's prefix is "v" 2021-12-25 22:19:02 +09:00
gem-unpack.rb
gen-mailmap.rb
gen_dummy_probes.rb
gen_ruby_tapset.rb
generic_erb.rb
git-refresh
gperf.sed
id2token.rb
ifchange
insns2vm.rb
install-sh
intern_ids.rb
leaked-globals
make-snapshot Revert "Do not include external library sources into packages" 2021-12-25 21:22:02 +09:00
make_hgraph.rb
mdoc2man.rb
merger.rb
mjit_archflag.sh
mjit_tabs.rb
mk_builtin_loader.rb Add ISEQ_BODY macro 2022-03-24 10:03:51 -04:00
mkconfig.rb Add ABI version to RUBY_LIB_VERSION 2022-02-24 09:18:01 -05:00
mkrunnable.rb Merge to one regexp 2021-12-14 12:19:44 +09:00
node_name.rb
parse.rb
prereq.status
probes_to_wiki.rb
pure_parser.rb
rbinstall.rb tool/rbinstall.rb: instal ruby.wasm produced by Emscripten 2022-01-06 18:14:24 +09:00
rbuninstall.rb
redmine-backporter.rb
release.sh
rmdirs
run-gcov.rb
run-lcov.rb
runruby.rb Yet Another Ruby JIT! 2021-10-20 18:19:31 -04:00
search-cgvars.rb
strip-rdoc.rb
sync_default_gems.rb Ignore pre-release for sync target on sync_default_gems 2022-03-10 13:35:21 +09:00
test-bundled-gems.rb Relax extention name for macOS 2021-11-15 16:52:10 +09:00
test-coverage.rb
transcode-tblgen.rb
transform_mjit_header.rb [Feature #18249] Implement ABI checking 2022-02-22 09:55:21 -05:00
travis_retry.sh
travis_wait.sh
update-bundled_gems.rb update-bundled_gems.rb: Fix typo and version comparison 2021-12-02 21:13:02 +09:00
update-deps
vtlh.rb
wasm-clangw [wasm] add asyncify based setjmp, fiber, register scan emulation 2022-01-19 11:19:06 +09:00
ytab.sed