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;
data->reset_aging();
collector<aging_space, aging_policy> collector(this,
- this->data->aging,
+ data->aging,
aging_policy(this));
collector.visitor.visit_all_roots();
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;
}
};
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) {
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) {
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_) {
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 {
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) {
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;
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);
if (obj) {
starts.record_object_start_offset(obj);
return obj;
- } else
- return NULL;
+ }
+ return NULL;
}
cell next_allocated_object_after(cell scan) {