Merge branch 'master' of git://factorcode.org/git/factor
						commit
						2b2be5f121
					
				| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
! Copyright (c) 2007-2009 Slava Pestov, Doug Coleman, Aaron Schaefer.
 | 
					! Copyright (c) 2007-2009 Slava Pestov, Doug Coleman, Aaron Schaefer.
 | 
				
			||||||
! See http://factorcode.org/license.txt for BSD license.
 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			||||||
USING: accessors assocs binary-search fry kernel locals math math.order
 | 
					USING: accessors assocs binary-search fry kernel locals math math.order
 | 
				
			||||||
    math.ranges mirrors namespaces sequences sorting ;
 | 
					    math.ranges namespaces sequences sorting ;
 | 
				
			||||||
IN: math.combinatorics
 | 
					IN: math.combinatorics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<PRIVATE
 | 
					<PRIVATE
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,8 @@ IN: math.vectors.simd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ERROR: bad-simd-length got expected ;
 | 
					ERROR: bad-simd-length got expected ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ERROR: bad-simd-vector obj ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<<
 | 
					<<
 | 
				
			||||||
<PRIVATE
 | 
					<PRIVATE
 | 
				
			||||||
! Primitive SIMD constructors
 | 
					! Primitive SIMD constructors
 | 
				
			||||||
| 
						 | 
					@ -239,7 +241,10 @@ c:<c-type>
 | 
				
			||||||
    byte-array >>class
 | 
					    byte-array >>class
 | 
				
			||||||
    A >>boxed-class
 | 
					    A >>boxed-class
 | 
				
			||||||
    { A-rep alien-vector A boa } >quotation >>getter
 | 
					    { A-rep alien-vector A boa } >quotation >>getter
 | 
				
			||||||
    { [ underlying>> ] 2dip A-rep set-alien-vector } >quotation >>setter
 | 
					    {
 | 
				
			||||||
 | 
					        [ dup simd-128? [ bad-simd-vector ] unless underlying>> ] 2dip
 | 
				
			||||||
 | 
					        A-rep set-alien-vector
 | 
				
			||||||
 | 
					    } >quotation >>setter
 | 
				
			||||||
    16 >>size
 | 
					    16 >>size
 | 
				
			||||||
    16 >>align
 | 
					    16 >>align
 | 
				
			||||||
    A-rep >>rep
 | 
					    A-rep >>rep
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -180,7 +180,6 @@ IN: tools.deploy.shaker
 | 
				
			||||||
                "slots"
 | 
					                "slots"
 | 
				
			||||||
                "special"
 | 
					                "special"
 | 
				
			||||||
                "specializer"
 | 
					                "specializer"
 | 
				
			||||||
                "specializations"
 | 
					 | 
				
			||||||
                "struct-slots"
 | 
					                "struct-slots"
 | 
				
			||||||
                ! UI needs this
 | 
					                ! UI needs this
 | 
				
			||||||
                ! "superclass"
 | 
					                ! "superclass"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,11 +98,16 @@ void data_heap::reset_generation(tenured_space *gen)
 | 
				
			||||||
	clear_decks(gen);
 | 
						clear_decks(gen);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool data_heap::low_memory_p()
 | 
					bool data_heap::high_fragmentation_p()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return (tenured->largest_free_block() <= nursery->size + aging->size);
 | 
						return (tenured->largest_free_block() <= nursery->size + aging->size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool data_heap::low_memory_p()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return (tenured->free_space() <= nursery->size + aging->size);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void data_heap::mark_all_cards()
 | 
					void data_heap::mark_all_cards()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	memset(cards,-1,cards_end - cards);
 | 
						memset(cards,-1,cards_end - cards);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,6 +29,7 @@ struct data_heap {
 | 
				
			||||||
	void reset_generation(nursery_space *gen);
 | 
						void reset_generation(nursery_space *gen);
 | 
				
			||||||
	void reset_generation(aging_space *gen);
 | 
						void reset_generation(aging_space *gen);
 | 
				
			||||||
	void reset_generation(tenured_space *gen);
 | 
						void reset_generation(tenured_space *gen);
 | 
				
			||||||
 | 
						bool high_fragmentation_p();
 | 
				
			||||||
	bool low_memory_p();
 | 
						bool low_memory_p();
 | 
				
			||||||
	void mark_all_cards();
 | 
						void mark_all_cards();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -143,12 +143,20 @@ void factor_vm::collect_full(bool trace_contexts_p)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	collect_mark_impl(trace_contexts_p);
 | 
						collect_mark_impl(trace_contexts_p);
 | 
				
			||||||
	collect_sweep_impl();
 | 
						collect_sweep_impl();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(data->low_memory_p())
 | 
						if(data->low_memory_p())
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							current_gc->op = collect_growing_heap_op;
 | 
				
			||||||
 | 
							current_gc->event->op = collect_growing_heap_op;
 | 
				
			||||||
 | 
							collect_growing_heap(0,trace_contexts_p);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else if(data->high_fragmentation_p())
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		current_gc->op = collect_compact_op;
 | 
							current_gc->op = collect_compact_op;
 | 
				
			||||||
		current_gc->event->op = collect_compact_op;
 | 
							current_gc->event->op = collect_compact_op;
 | 
				
			||||||
		collect_compact_impl(trace_contexts_p);
 | 
							collect_compact_impl(trace_contexts_p);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	code->flush_icache();
 | 
						code->flush_icache();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,7 +152,7 @@ void factor_vm::gc(gc_op op, cell requested_bytes, bool trace_contexts_p)
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case collect_aging_op:
 | 
						case collect_aging_op:
 | 
				
			||||||
		collect_aging();
 | 
							collect_aging();
 | 
				
			||||||
		if(data->low_memory_p())
 | 
							if(data->high_fragmentation_p())
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			current_gc->op = collect_full_op;
 | 
								current_gc->op = collect_full_op;
 | 
				
			||||||
			current_gc->event->op = collect_full_op;
 | 
								current_gc->event->op = collect_full_op;
 | 
				
			||||||
| 
						 | 
					@ -161,7 +161,7 @@ void factor_vm::gc(gc_op op, cell requested_bytes, bool trace_contexts_p)
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case collect_to_tenured_op:
 | 
						case collect_to_tenured_op:
 | 
				
			||||||
		collect_to_tenured();
 | 
							collect_to_tenured();
 | 
				
			||||||
		if(data->low_memory_p())
 | 
							if(data->high_fragmentation_p())
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			current_gc->op = collect_full_op;
 | 
								current_gc->op = collect_full_op;
 | 
				
			||||||
			current_gc->event->op = collect_full_op;
 | 
								current_gc->event->op = collect_full_op;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue