VM: Remove unnecessary explicit keywords

db4
Erik Charlebois 2013-05-12 21:48:38 -04:00
parent d44127b543
commit 26ff071205
31 changed files with 56 additions and 60 deletions

View File

@ -3,7 +3,7 @@ namespace factor {
struct aging_space : bump_allocator<object> { struct aging_space : bump_allocator<object> {
object_start_map starts; object_start_map starts;
explicit aging_space(cell size, cell start) aging_space(cell size, cell start)
: bump_allocator<object>(size, start), starts(size, start) {} : bump_allocator<object>(size, start), starts(size, start) {}
object* allot(cell size) { object* allot(cell size) {

View File

@ -22,7 +22,7 @@ struct growable_array {
cell count; cell count;
data_root<array> elements; data_root<array> elements;
explicit growable_array(factor_vm* parent, cell capacity = 10) growable_array(factor_vm* parent, cell capacity = 10)
: count(0), : count(0),
elements(parent->allot_array(capacity, false_object), parent) {} elements(parent->allot_array(capacity, false_object), parent) {}

View File

@ -7,7 +7,7 @@ template <typename Block> struct bump_allocator {
cell end; cell end;
cell size; cell size;
explicit bump_allocator(cell size_, cell start_) bump_allocator(cell size_, cell start_)
: here(start_), start(start_), end(start_ + size_), size(size_) {} : here(start_), start(start_), end(start_ + size_), size(size_) {}
bool contains_p(Block* block) { return ((cell) block - start) < size; } bool contains_p(Block* block) { return ((cell) block - start) < size; }

View File

@ -4,7 +4,7 @@ struct growable_byte_array {
cell count; cell count;
data_root<byte_array> elements; data_root<byte_array> elements;
explicit growable_byte_array(factor_vm* parent, cell capacity = 40) growable_byte_array(factor_vm* parent, cell capacity = 40)
: count(0), elements(parent->allot_byte_array(capacity), parent) {} : count(0), elements(parent->allot_byte_array(capacity), parent) {}
void grow_bytes(cell len); void grow_bytes(cell len);

View File

@ -28,7 +28,7 @@ struct callback_heap {
cell here; cell here;
factor_vm* parent; factor_vm* parent;
explicit callback_heap(cell size, factor_vm* parent); callback_heap(cell size, factor_vm* parent);
~callback_heap(); ~callback_heap();
void* callback_entry_point(code_block* stub) { void* callback_entry_point(code_block* stub) {

View File

@ -15,7 +15,7 @@ template <typename Fixup> struct code_block_visitor {
factor_vm* parent; factor_vm* parent;
Fixup fixup; Fixup fixup;
explicit code_block_visitor(factor_vm* parent_, Fixup fixup_) code_block_visitor(factor_vm* parent_, Fixup fixup_)
: parent(parent_), fixup(fixup_) {} : parent(parent_), fixup(fixup_) {}
code_block* visit_code_block(code_block* compiled); code_block* visit_code_block(code_block* compiled);
@ -36,7 +36,7 @@ template <typename Fixup> struct call_frame_code_block_visitor {
factor_vm* parent; factor_vm* parent;
Fixup fixup; Fixup fixup;
explicit call_frame_code_block_visitor(factor_vm* parent_, Fixup fixup_) call_frame_code_block_visitor(factor_vm* parent_, Fixup fixup_)
: parent(parent_), fixup(fixup_) {} : parent(parent_), fixup(fixup_) {}
void operator()(void* frame_top, cell frame_size, code_block* owner, void operator()(void* frame_top, cell frame_size, code_block* owner,

View File

@ -296,7 +296,7 @@ struct initial_code_block_visitor {
cell literals; cell literals;
cell literal_index; cell literal_index;
explicit initial_code_block_visitor(factor_vm* parent_, cell literals_) initial_code_block_visitor(factor_vm* parent_, cell literals_)
: parent(parent_), literals(literals_), literal_index(0) {} : parent(parent_), literals(literals_), literal_index(0) {}
cell next_literal() { cell next_literal() {

View File

@ -234,7 +234,7 @@ void factor_vm::primitive_code_room() {
} }
struct stack_trace_stripper { struct stack_trace_stripper {
explicit stack_trace_stripper() {} stack_trace_stripper() {}
void operator()(code_block* compiled, cell size) { void operator()(code_block* compiled, cell size) {
compiled->owner = false_object; compiled->owner = false_object;

View File

@ -7,7 +7,7 @@ struct code_root {
void push() { parent->code_roots.push_back(this); } void push() { parent->code_roots.push_back(this); }
explicit code_root(cell value_, factor_vm* parent_) code_root(cell value_, factor_vm* parent_)
: value(value_), valid(true), parent(parent_) { : value(value_), valid(true), parent(parent_) {
push(); push();
} }

View File

@ -12,8 +12,7 @@ struct gc_workhorse : no_fixup {
Policy policy; Policy policy;
code_heap* code; code_heap* code;
explicit gc_workhorse(factor_vm* parent_, TargetGeneration* target_, gc_workhorse(factor_vm* parent_, TargetGeneration* target_, Policy policy_)
Policy policy_)
: parent(parent_), target(target_), policy(policy_), code(parent->code) {} : parent(parent_), target(target_), policy(policy_), code(parent->code) {}
object* resolve_forwarding(object* untagged) { object* resolve_forwarding(object* untagged) {
@ -82,7 +81,7 @@ struct simple_unmarker {
}; };
struct full_unmarker { struct full_unmarker {
explicit full_unmarker() {} full_unmarker() {}
void operator()(card* ptr) { *ptr = 0; } void operator()(card* ptr) { *ptr = 0; }
}; };
@ -97,8 +96,7 @@ template <typename TargetGeneration, typename Policy> struct collector {
cell decks_scanned; cell decks_scanned;
cell code_blocks_scanned; cell code_blocks_scanned;
explicit collector(factor_vm* parent_, TargetGeneration* target_, collector(factor_vm* parent_, TargetGeneration* target_, Policy policy_)
Policy policy_)
: parent(parent_), : parent(parent_),
data(parent_->data), data(parent_->data),
code(parent_->code), code(parent_->code),

View File

@ -10,7 +10,7 @@ struct compaction_fixup {
const object** data_finger; const object** data_finger;
const code_block** code_finger; const code_block** code_finger;
explicit compaction_fixup(mark_bits<object>* data_forwarding_map_, compaction_fixup(mark_bits<object>* data_forwarding_map_,
mark_bits<code_block>* code_forwarding_map_, mark_bits<code_block>* code_forwarding_map_,
const object** data_finger_, const object** data_finger_,
const code_block** code_finger_) const code_block** code_finger_)
@ -61,8 +61,7 @@ struct object_compaction_updater {
compaction_fixup fixup; compaction_fixup fixup;
object_start_map* starts; object_start_map* starts;
explicit object_compaction_updater(factor_vm* parent_, object_compaction_updater(factor_vm* parent_, compaction_fixup fixup_)
compaction_fixup fixup_)
: parent(parent_), : parent(parent_),
fixup(fixup_), fixup(fixup_),
starts(&parent->data->tenured->starts) {} starts(&parent->data->tenured->starts) {}
@ -83,7 +82,7 @@ template <typename Fixup> struct code_block_compaction_relocation_visitor {
code_block* old_address; code_block* old_address;
Fixup fixup; Fixup fixup;
explicit code_block_compaction_relocation_visitor(factor_vm* parent_, code_block_compaction_relocation_visitor(factor_vm* parent_,
code_block* old_address_, code_block* old_address_,
Fixup fixup_) Fixup fixup_)
: parent(parent_), old_address(old_address_), fixup(fixup_) {} : parent(parent_), old_address(old_address_), fixup(fixup_) {}
@ -129,7 +128,7 @@ template <typename Fixup> struct code_block_compaction_updater {
slot_visitor<Fixup> data_forwarder; slot_visitor<Fixup> data_forwarder;
code_block_visitor<Fixup> code_forwarder; code_block_visitor<Fixup> code_forwarder;
explicit code_block_compaction_updater( code_block_compaction_updater(
factor_vm* parent_, Fixup fixup_, slot_visitor<Fixup> data_forwarder_, factor_vm* parent_, Fixup fixup_, slot_visitor<Fixup> data_forwarder_,
code_block_visitor<Fixup> code_forwarder_) code_block_visitor<Fixup> code_forwarder_)
: parent(parent_), : parent(parent_),
@ -234,7 +233,7 @@ struct code_compaction_fixup {
mark_bits<code_block>* code_forwarding_map; mark_bits<code_block>* code_forwarding_map;
const code_block** code_finger; const code_block** code_finger;
explicit code_compaction_fixup(mark_bits<code_block>* code_forwarding_map_, code_compaction_fixup(mark_bits<code_block>* code_forwarding_map_,
const code_block** code_finger_) const code_block** code_finger_)
: code_forwarding_map(code_forwarding_map_), code_finger(code_finger_) {} : code_forwarding_map(code_forwarding_map_), code_finger(code_finger_) {}

View File

@ -4,7 +4,7 @@ template <typename TargetGeneration, typename Policy>
struct copying_collector : collector<TargetGeneration, Policy> { struct copying_collector : collector<TargetGeneration, Policy> {
cell scan; cell scan;
explicit copying_collector(factor_vm* parent_, TargetGeneration* target_, copying_collector(factor_vm* parent_, TargetGeneration* target_,
Policy policy_) Policy policy_)
: collector<TargetGeneration, Policy>(parent_, target_, policy_), : collector<TargetGeneration, Policy>(parent_, target_, policy_),
scan(target_->here) {} scan(target_->here) {}

View File

@ -20,7 +20,7 @@ struct data_heap {
card_deck* decks; card_deck* decks;
card_deck* decks_end; card_deck* decks_end;
explicit data_heap(cell young_size, cell aging_size, cell tenured_size); data_heap(cell young_size, cell aging_size, cell tenured_size);
~data_heap(); ~data_heap();
data_heap* grow(cell requested_size); data_heap* grow(cell requested_size);
template <typename Generation> void clear_cards(Generation* gen); template <typename Generation> void clear_cards(Generation* gen);

View File

@ -29,7 +29,7 @@ struct slot_checker {
object* obj; object* obj;
generation gen; generation gen;
explicit slot_checker(factor_vm* parent_, object* obj_, generation gen_) slot_checker(factor_vm* parent_, object* obj_, generation gen_)
: parent(parent_), obj(obj_), gen(gen_) {} : parent(parent_), obj(obj_), gen(gen_) {}
void check_write_barrier(cell* slot_ptr, generation target, char mask) { void check_write_barrier(cell* slot_ptr, generation target, char mask) {

View File

@ -7,12 +7,12 @@ template <typename Type> struct data_root : public tagged<Type> {
parent->data_roots.push_back(data_root_range(&this->value_, 1)); parent->data_roots.push_back(data_root_range(&this->value_, 1));
} }
explicit data_root(cell value_, factor_vm* parent_) data_root(cell value_, factor_vm* parent_)
: tagged<Type>(value_), parent(parent_) { : tagged<Type>(value_), parent(parent_) {
push(); push();
} }
explicit data_root(Type* value_, factor_vm* parent_) data_root(Type* value_, factor_vm* parent_)
: tagged<Type>(value_), parent(parent_) { : tagged<Type>(value_), parent(parent_) {
push(); push();
} }

View File

@ -280,7 +280,7 @@ struct object_dumper {
factor_vm* parent; factor_vm* parent;
cell type; cell type;
explicit object_dumper(factor_vm* parent_, cell type_) object_dumper(factor_vm* parent_, cell type_)
: parent(parent_), type(type_) {} : parent(parent_), type(type_) {}
void operator()(object* obj) { void operator()(object* obj) {
@ -303,7 +303,7 @@ struct find_data_reference_slot_visitor {
object* obj; object* obj;
factor_vm* parent; factor_vm* parent;
explicit find_data_reference_slot_visitor(cell look_for_, object* obj_, find_data_reference_slot_visitor(cell look_for_, object* obj_,
factor_vm* parent_) factor_vm* parent_)
: look_for(look_for_), obj(obj_), parent(parent_) {} : look_for(look_for_), obj(obj_), parent(parent_) {}
@ -320,7 +320,7 @@ struct dump_edges_slot_visitor {
object* obj; object* obj;
factor_vm* parent; factor_vm* parent;
explicit dump_edges_slot_visitor(cell, object* obj_, factor_vm* parent_) dump_edges_slot_visitor(cell, object* obj_, factor_vm* parent_)
: obj(obj_), parent(parent_) {} : obj(obj_), parent(parent_) {}
void operator()(cell* scan) { void operator()(cell* scan) {
@ -334,7 +334,7 @@ template <typename SlotVisitor> struct data_reference_object_visitor {
cell look_for; cell look_for;
factor_vm* parent; factor_vm* parent;
explicit data_reference_object_visitor(cell look_for_, factor_vm* parent_) data_reference_object_visitor(cell look_for_, factor_vm* parent_)
: look_for(look_for_), parent(parent_) {} : look_for(look_for_), parent(parent_) {}
void operator()(object* obj) { void operator()(object* obj) {

View File

@ -7,7 +7,7 @@ template <typename Block> struct free_list_allocator {
free_list free_blocks; free_list free_blocks;
mark_bits<Block> state; mark_bits<Block> state;
explicit free_list_allocator(cell size, cell start); free_list_allocator(cell size, cell start);
void initial_free_list(cell occupied); void initial_free_list(cell occupied);
bool contains_p(Block* block); bool contains_p(Block* block);
Block* first_block(); Block* first_block();
@ -156,7 +156,7 @@ template <typename Block, typename Iterator> struct heap_compactor {
Iterator& iter; Iterator& iter;
const Block** finger; const Block** finger;
explicit heap_compactor(mark_bits<Block>* state_, Block* address_, heap_compactor(mark_bits<Block>* state_, Block* address_,
Iterator& iter_, const Block** finger_) Iterator& iter_, const Block** finger_)
: state(state_), address((char*)address_), iter(iter_), finger(finger_) {} : state(state_), address((char*)address_), iter(iter_), finger(finger_) {}

View File

@ -194,7 +194,7 @@ struct call_frame_scrubber {
factor_vm* parent; factor_vm* parent;
context* ctx; context* ctx;
explicit call_frame_scrubber(factor_vm* parent_, context* ctx_) call_frame_scrubber(factor_vm* parent_, context* ctx_)
: parent(parent_), ctx(ctx_) {} : parent(parent_), ctx(ctx_) {}
void operator()(void* frame_top, cell frame_size, code_block* owner, void operator()(void* frame_top, cell frame_size, code_block* owner,

View File

@ -46,7 +46,7 @@ struct gc_state {
u64 start_time; u64 start_time;
gc_event* event; gc_event* event;
explicit gc_state(gc_op op_, factor_vm* parent); gc_state(gc_op op_, factor_vm* parent);
~gc_state(); ~gc_state();
void start_again(gc_op op_, factor_vm* parent); void start_again(gc_op op_, factor_vm* parent);
}; };

View File

@ -55,7 +55,7 @@ struct startup_fixup {
cell data_offset; cell data_offset;
cell code_offset; cell code_offset;
explicit startup_fixup(cell data_offset_, cell code_offset_) startup_fixup(cell data_offset_, cell code_offset_)
: data_offset(data_offset_), code_offset(code_offset_) {} : data_offset(data_offset_), code_offset(code_offset_) {}
object* fixup_data(object* obj) { object* fixup_data(object* obj) {

View File

@ -43,7 +43,7 @@ void factor_vm::update_pic_count(cell type) {
struct inline_cache_jit : public jit { struct inline_cache_jit : public jit {
fixnum index; fixnum index;
explicit inline_cache_jit(cell generic_word_, factor_vm* vm) inline_cache_jit(cell generic_word_, factor_vm* vm)
: jit(code_block_pic, generic_word_, vm) {} : jit(code_block_pic, generic_word_, vm) {}
; ;

View File

@ -12,7 +12,7 @@ struct jit {
cell offset; cell offset;
factor_vm* parent; factor_vm* parent;
explicit jit(code_block_type type, cell owner, factor_vm* parent); jit(code_block_type type, cell owner, factor_vm* parent);
~jit(); ~jit();
void compute_position(cell offset); void compute_position(cell offset);

View File

@ -343,7 +343,7 @@ struct data_root_range {
cell* start; cell* start;
cell len; cell len;
explicit data_root_range(cell* start_, cell len_) data_root_range(cell* start_, cell len_)
: start(start_), len(len_) {} : start(start_), len(len_) {}
}; };

View File

@ -14,7 +14,7 @@ template <typename Block> struct mark_bits {
void clear_forwarding() { memset(forwarding, 0, bits_size * sizeof(cell)); } void clear_forwarding() { memset(forwarding, 0, bits_size * sizeof(cell)); }
explicit mark_bits(cell size_, cell start_) mark_bits(cell size_, cell start_)
: size(size_), : size(size_),
start(start_), start(start_),
bits_size(size / data_alignment / mark_bits_granularity), bits_size(size / data_alignment / mark_bits_granularity),

View File

@ -1,7 +1,7 @@
namespace factor { namespace factor {
struct nursery_space : bump_allocator<object> { struct nursery_space : bump_allocator<object> {
explicit nursery_space(cell size, cell start) nursery_space(cell size, cell start)
: bump_allocator<object>(size, start) {} : bump_allocator<object>(size, start) {}
}; };

View File

@ -7,7 +7,7 @@ struct object_start_map {
card* object_start_offsets; card* object_start_offsets;
card* object_start_offsets_end; card* object_start_offsets_end;
explicit object_start_map(cell size_, cell start_); object_start_map(cell size_, cell start_);
~object_start_map(); ~object_start_map();
cell first_object_in_card(cell card_index); cell first_object_in_card(cell card_index);

View File

@ -75,7 +75,7 @@ void factor_vm::primitive_size() {
struct slot_become_fixup : no_fixup { struct slot_become_fixup : no_fixup {
std::map<object*, object*>* become_map; std::map<object*, object*>* become_map;
explicit slot_become_fixup(std::map<object*, object*>* become_map_) slot_become_fixup(std::map<object*, object*>* become_map_)
: become_map(become_map_) {} : become_map(become_map_) {}
object* fixup_data(object* old) { object* fixup_data(object* old) {

View File

@ -4,8 +4,7 @@ struct quotation_jit : public jit {
data_root<array> elements; data_root<array> elements;
bool compiling, relocate; bool compiling, relocate;
explicit quotation_jit(cell owner, bool compiling_, bool relocate_, quotation_jit(cell owner, bool compiling_, bool relocate_, factor_vm* vm)
factor_vm* vm)
: jit(code_block_unoptimized, owner, vm), : jit(code_block_unoptimized, owner, vm),
elements(false_object, vm), elements(false_object, vm),
compiling(compiling_), compiling(compiling_),

View File

@ -9,7 +9,7 @@ struct segment {
cell size; cell size;
cell end; cell end;
explicit segment(cell size, bool executable_p); segment(cell size, bool executable_p);
~segment(); ~segment();
bool underflow_p(cell addr) { bool underflow_p(cell addr) {

View File

@ -109,7 +109,7 @@ template <typename Fixup> struct slot_visitor {
factor_vm* parent; factor_vm* parent;
Fixup fixup; Fixup fixup;
explicit slot_visitor<Fixup>(factor_vm* parent_, Fixup fixup_) slot_visitor<Fixup>(factor_vm* parent_, Fixup fixup_)
: parent(parent_), fixup(fixup_) {} : parent(parent_), fixup(fixup_) {}
cell visit_pointer(cell pointer); cell visit_pointer(cell pointer);
@ -199,7 +199,7 @@ template <typename Fixup> struct callback_slot_visitor {
callback_heap* callbacks; callback_heap* callbacks;
slot_visitor<Fixup>* visitor; slot_visitor<Fixup>* visitor;
explicit callback_slot_visitor(callback_heap* callbacks_, callback_slot_visitor(callback_heap* callbacks_,
slot_visitor<Fixup>* visitor_) slot_visitor<Fixup>* visitor_)
: callbacks(callbacks_), visitor(visitor_) {} : callbacks(callbacks_), visitor(visitor_) {}
@ -263,7 +263,7 @@ template <typename Fixup> struct call_frame_slot_visitor {
factor_vm* parent; factor_vm* parent;
slot_visitor<Fixup>* visitor; slot_visitor<Fixup>* visitor;
explicit call_frame_slot_visitor(factor_vm* parent_, call_frame_slot_visitor(factor_vm* parent_,
slot_visitor<Fixup>* visitor_) slot_visitor<Fixup>* visitor_)
: parent(parent_), visitor(visitor_) {} : parent(parent_), visitor(visitor_) {}

View File

@ -3,7 +3,7 @@ namespace factor {
struct tenured_space : free_list_allocator<object> { struct tenured_space : free_list_allocator<object> {
object_start_map starts; object_start_map starts;
explicit tenured_space(cell size, cell start) tenured_space(cell size, cell start)
: free_list_allocator<object>(size, start), starts(size, start) {} : free_list_allocator<object>(size, start), starts(size, start) {}
object* allot(cell size) { object* allot(cell size) {