From 4f6381587c56347e41e7d9a5c7aff533713be222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Wed, 19 Oct 2016 08:12:40 +0200 Subject: [PATCH] VM: removing update_code_roots_for_sweep() --- vm/full_collector.cpp | 27 +++++++++++---------------- vm/vm.hpp | 1 - 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/vm/full_collector.cpp b/vm/full_collector.cpp index 24422610c1..7b466d88b4 100644 --- a/vm/full_collector.cpp +++ b/vm/full_collector.cpp @@ -56,21 +56,6 @@ struct full_collection_copier : no_fixup { } }; -// After a sweep, invalidate any code heap roots which are not marked, -// so that if a block makes a tail call to a generic word, and the PIC -// compiler triggers a GC, and the caller block gets GCd as a result, -// the PIC code won't try to overwrite the call site -void factor_vm::update_code_roots_for_sweep() { - mark_bits* state = &code->allocator->state; - - FACTOR_FOR_EACH(code_roots) { - code_root* root = *iter; - cell block = root->value & (~data_alignment - 1); - if (root->valid && !state->marked_p(block)) - root->valid = false; - } -} - void factor_vm::collect_mark_impl() { slot_visitor visitor(this, full_collection_copier(data->tenured, code, &mark_stack)); @@ -101,7 +86,17 @@ void factor_vm::collect_sweep_impl() { if (event) event->ended_data_sweep(); - update_code_roots_for_sweep(); + // After a sweep, invalidate any code heap roots which are not + // marked, so that if a block makes a tail call to a generic word, + // and the PIC compiler triggers a GC, and the caller block gets GCd + // as a result, the PIC code won't try to overwrite the call site + mark_bits* state = &code->allocator->state; + FACTOR_FOR_EACH(code_roots) { + code_root* root = *iter; + cell block = root->value & (~data_alignment - 1); + if (root->valid && !state->marked_p(block)) + root->valid = false; + } if (event) event->reset_timer(); diff --git a/vm/vm.hpp b/vm/vm.hpp index 127f7ddec1..2a29d6c409 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -341,7 +341,6 @@ struct factor_vm { void collect_nursery(); void collect_aging(); void collect_to_tenured(); - void update_code_roots_for_sweep(); void update_code_roots_for_compaction(); void collect_mark_impl(); void collect_sweep_impl();