VM: smaller style-fixes, like removing redundant else clauses and this prefixes
parent
e14d820138
commit
5d7fb5da60
|
@ -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();
|
||||
|
|
|
@ -19,15 +19,13 @@ struct aging_space : bump_allocator {
|
|||
cell size = ((object*)scan)->size();
|
||||
if (scan + size < here)
|
||||
return scan + size;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cell first_object() {
|
||||
if (start != here)
|
||||
return start;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
return w->entry_point;
|
||||
}
|
||||
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_) {
|
||||
|
|
|
@ -42,8 +42,7 @@ struct code_block {
|
|||
cell stack_frame_size() const {
|
||||
if (free_p())
|
||||
return 0;
|
||||
else
|
||||
return (header >> 20) & 0xFF0;
|
||||
return (header >> 20) & 0xFF0;
|
||||
}
|
||||
|
||||
cell stack_frame_size_for_address(cell addr) const {
|
||||
|
@ -54,8 +53,7 @@ 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;
|
||||
return natural_frame_size;
|
||||
}
|
||||
|
||||
void set_stack_frame_size(cell frame_size) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -11,8 +11,8 @@ struct tenured_space : free_list_allocator<object> {
|
|||
if (obj) {
|
||||
starts.record_object_start_offset(obj);
|
||||
return obj;
|
||||
} else
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cell next_allocated_object_after(cell scan) {
|
||||
|
|
Loading…
Reference in New Issue