diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-03-25 20:29:09 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-25 20:29:09 +0900 |
commit | 69967ee64eac9ce65b83533a566d69d12a6046d0 (patch) | |
tree | b7012ba8b7ad5b1c99d7b1f9b2345ecd8117f433 /class.c | |
parent | 7ee26740e41f99d3da37df36b956237fbf36868e (diff) |
Revert "Finer-grained inline constant cache invalidation"
This reverts commits for [Feature #18589]:
* 8008fb7352abc6fba433b99bf20763cf0d4adb38
"Update formatting per feedback"
* 8f6eaca2e19828e92ecdb28b0fe693d606a03f96
"Delete ID from constant cache table if it becomes empty on ISEQ free"
* 629908586b4bead1103267652f8b96b1083573a8
"Finer-grained inline constant cache invalidation"
MSWin builds on AppVeyor have been crashing since the merger.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5715
Merged-By: nobu <[email protected]>
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -1169,20 +1169,11 @@ module_in_super_chain(const VALUE klass, VALUE module) return false; } -// For each ID key in the class constant table, we're going to clear the VM's -// inline constant caches associated with it. -static enum rb_id_table_iterator_result -clear_constant_cache_i(ID id, VALUE value, void *data) -{ - rb_clear_constant_cache_for_id(id); - return ID_TABLE_CONTINUE; -} - static int do_include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super, bool check_cyclic) { VALUE p, iclass, origin_stack = 0; - int method_changed = 0, add_subclass; + int method_changed = 0, constant_changed = 0, add_subclass; long origin_len; VALUE klass_origin = RCLASS_ORIGIN(klass); VALUE original_klass = klass; @@ -1275,12 +1266,13 @@ do_include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super } tbl = RCLASS_CONST_TBL(module); - if (tbl && rb_id_table_size(tbl)) - rb_id_table_foreach(tbl, clear_constant_cache_i, (void *) 0); + if (tbl && rb_id_table_size(tbl)) constant_changed = 1; skip: module = RCLASS_SUPER(module); } + if (constant_changed) rb_clear_constant_cache(); + return method_changed; } |