diff options
author | Koichi Sasada <[email protected]> | 2020-12-13 05:55:18 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-12-14 11:57:46 +0900 |
commit | 967040ba59799e6b7891168ffbf37cc646988d84 (patch) | |
tree | 2f36f519d5c753ccd68dc08c8e6c65ea375ffcc6 /vm.c | |
parent | fa63052be19b26d39b22689ad9969aa83909809e (diff) |
Introduce negative method cache
pCMC doesn't have negative method cache so this patch implements it.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3892
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2530,6 +2530,13 @@ rb_vm_each_stack_value(void *ptr, void (*cb)(VALUE, void*), void *ctx) } } +static enum rb_id_table_iterator_result +vm_mark_negative_cme(VALUE val, void *dmy) +{ + rb_gc_mark(val); + return ID_TABLE_CONTINUE; +} + void rb_vm_mark(void *ptr) { @@ -2585,6 +2592,8 @@ rb_vm_mark(void *ptr) rb_gc_mark_values(RUBY_NSIG, vm->trap_list.cmd); + rb_id_table_foreach_values(vm->negative_cme_table, vm_mark_negative_cme, NULL); + mjit_mark(); } @@ -3660,6 +3669,7 @@ Init_BareVM(void) vm->objspace = rb_objspace_alloc(); ruby_current_vm_ptr = vm; + vm->negative_cme_table = rb_id_table_create(16); Init_native_thread(th); th->vm = vm; |