VM: smaller style-fixes, like removing redundant else clauses and this prefixes

db4
Björn Lindqvist 2015-08-14 22:31:04 +02:00 committed by John Benediktsson
parent e14d820138
commit 5d7fb5da60
8 changed files with 17 additions and 24 deletions

View File

@ -27,7 +27,7 @@ void factor_vm::collect_aging() {
current_gc->op = collect_to_tenured_op;
collector<tenured_space, to_tenured_policy> collector(this,
this->data->tenured,
data->tenured,
to_tenured_policy(this));
gc_event* event = current_gc->event;
@ -53,7 +53,7 @@ void factor_vm::collect_aging() {
data->reset_aging();
collector<aging_space, aging_policy> collector(this,
this->data->aging,
data->aging,
aging_policy(this));
collector.visitor.visit_all_roots();

View File

@ -19,14 +19,12 @@ struct aging_space : bump_allocator {
cell size = ((object*)scan)->size();
if (scan + size < here)
return scan + size;
else
return 0;
}
cell first_object() {
if (start != here)
return start;
else
return 0;
}
};

View File

@ -12,7 +12,7 @@ inline void factor_vm::iterate_callstack_object(callstack* stack_,
Iterator& iterator,
Fixup& fixup) {
data_root<callstack> stack(stack_, this);
fixnum frame_length = factor::untag_fixnum(stack->length);
fixnum frame_length = untag_fixnum(stack->length);
fixnum frame_offset = 0;
while (frame_offset < frame_length) {
@ -39,7 +39,8 @@ inline void factor_vm::iterate_callstack_object(callstack* stack,
iterate_callstack_object(stack, iterator, none);
}
/* Allocates memory */
/* Iterates the callstack from innermost to outermost
callframe. Allocates memory */
template <typename Iterator, typename Fixup>
void factor_vm::iterate_callstack(context* ctx, Iterator& iterator,
Fixup& fixup) {

View File

@ -41,13 +41,10 @@ cell factor_vm::compute_entry_point_address(cell obj) {
cell factor_vm::compute_entry_point_pic_address(word* w, cell tagged_quot) {
if (!to_boolean(tagged_quot) || max_pic_size == 0)
return w->entry_point;
else {
quotation* quot = untag<quotation>(tagged_quot);
if (quotation_compiled_p(quot))
return quot->entry_point;
else
quotation* q = untag<quotation>(tagged_quot);
if (quotation_compiled_p(q))
return q->entry_point;
return w->entry_point;
}
}
cell factor_vm::compute_entry_point_pic_address(cell w_) {

View File

@ -42,7 +42,6 @@ struct code_block {
cell stack_frame_size() const {
if (free_p())
return 0;
else
return (header >> 20) & 0xFF0;
}
@ -54,7 +53,6 @@ struct code_block {
fake "leaf frame" set up by the signal handler. */
if (natural_frame_size == 0 || addr == entry_point())
return LEAF_FRAME_SIZE;
else
return natural_frame_size;
}

View File

@ -1,8 +1,8 @@
namespace factor {
// gc_info should be kept in sync with:
// basis/compiler/codegen/gc-maps/gc-maps.factor
// basis/vm/vm.factor
struct gc_info {
uint32_t scrub_d_count;
uint32_t scrub_r_count;

View File

@ -150,11 +150,10 @@ void quotation_jit::iterate_quotation() {
emit(parent->special_objects[JIT_PROLOG]);
}
cell i;
cell length = array_capacity(elements.untagged());
bool tail_call = false;
for (i = 0; i < length; i++) {
for (cell i = 0; i < length; i++) {
set_position(i);
data_root<object> obj(array_nth(elements.untagged(), i), parent);

View File

@ -11,7 +11,7 @@ struct tenured_space : free_list_allocator<object> {
if (obj) {
starts.record_object_start_offset(obj);
return obj;
} else
}
return NULL;
}