Commit Graph

56 Commits

Author SHA1 Message Date
Mark Mitchell 37b31aefeb ggc.h (ggc_alloc): New function.
* ggc.h (ggc_alloc): New function.
	(ggc_mark): Likewise.
	* ggc-simple.c (ggc_any): New structure.
	(ggc_status): Add anys.
	(n_anys_collected): New variable.
	(ggc_alloc): Define.
	(ggc_mark): Likewise.
	(ggc_collect): Collect the anys.

From-SVN: r29222
1999-09-09 03:26:58 +00:00
Mark Mitchell 21cd906efe emit-rtl.c (free_emit_status): Take decl as a parameter.
* emit-rtl.c (free_emit_status): Take decl as a parameter.
	(init_emit_once): Add more GC roots.
	* except.c (mark_func_eh_entry): New function.
	(mark_eh_node): Mark false_label and rethrow_label.
	(init_eh): Add more GC roots.
	* function.c (free_after_compilation): Take decl as a paramter.
	Call free_stmt_status.
	(mark_function_state): Don't assume x_parm_reg_stack_loc is
	non-NULL.
	* function.h (free_after_compilation): Change prototype.
	(free_varasm_status): Likewise.
	(free_emit_status): Likewise.
	(free_stmt_status): New function.
	* ggc-simple.c (rtx, vecs, trees, strings, bytes_alloced_since_gc):
	Remove, replacing with ...
	(ggc_status): New structure.
	(ggc_chain): New variable.
	(init_gcc): Define.
	(ggc_push_context): New function.
	(ggc_pop_context): Likewise.
	(ggc_alloc_rtx): Adjust for use of ggc_chain.
	(ggc_alloc_rtvec): Likewise.
	(ggc_alloc_tree): Likewise.
	(ggc_alloc_string): Likewise.
	(ggc_mark_rtx): Mark NOTE_SOURCE_FILE and NOTE_RANGE_INFO.
	(ggc_mark_tree): Give language-dependent code a chance to mark
	`x' nodes.
	(ggc_mark_tree_varray): Handle empty arrays.
	(ggc_collect): Adjust for use of ggc_chain.  Clear
	bytes_alloced_since_last_gc.
	* ggc.h (ggc_pop_context): New function.
	(ggc_push_context): Likewise.
	* print-tree.c (print_node): Don't print obstacks when GC'ing.
	* stmt.c (free_stmt_status): New function.
	(init_stmt_for_function): Clear last_expr_value.
	* toplev.c (rest_of_compilation): Always call free_after_compilation.
	Conditionalize call to ggc_collect.
	(main): Call init_ggc.
	* tree.c (push_obstacks): Do the push, even when GC'ing.
	(push_obstacks_nochange): Likewise.
	(pop_obstacks): Liekwise.
	* varasm.c (free_varasm_status): Take decl as a parameter.

From-SVN: r29170
1999-09-07 15:20:58 +00:00
Mark Mitchell 565e3f3ec2 Makefile.in (ggc-simple.o): Depend on hash.h.
* Makefile.in (ggc-simple.o): Depend on hash.h.
	* ggc.h (ggc_add_tree_hash_table_root): Declare.
	(ggc_mark_tree_varray): Likewise.
	(ggc_mark_tree_hash_table): Likewise.
	* ggc-simple.c: Include hash.h.
	(ggc_mark_tree_hash_table_ptr): New function.
	(ggc_mark_tree_hash_table_entry): Likewise.
	(ggc_mark_tree_hash_table): Likewise.
	(ggc_add_tree_hash_table_root): Likewise.
	* varray.h (const_equiv_data): Use struct rtx_def *, rather than

	* profile.c (output_func_start_profiler): Remove apparently
	nonsensical call to start_sequence.

From-SVN: r29134
1999-09-06 02:10:03 +00:00
Richard Henderson a3770a8130 Makefile.in (ggc-simple.o): Depend on varray.h.
* Makefile.in (ggc-simple.o): Depend on varray.h.
	(rtl.o): Depend on ggc.h.
	(genattrtab.o): Depend on ggc.h.
	(print-tree.o): Likewise.
	(fold-const.o): Likewise.
	* emit-rtl.c (sequence_element_free_list): Remove, and all references.
	(make_insn_raw): Don't cache insns when GC'ing.
	(emit_insn_before): Likewise.
	(emit_insn_after): Likewise.
	(emit_insn): Likewise.
	(start_sequence): Use xmalloc to allocate the sequence_stack.
	(end_sequence): Add free to free it.
	(gen_sequence): Don't cache insns when GC'ing.
	(clear_emit_caches): Don't use sequence_element_free_list.
	(init_emit): Use xcalloc, not xmalloc+bzero.
	* fold-const.c (size_int_wide): Kill the cache, when GC'ing.
	* function.c (pop_function_context_from): Use free to free the
	fixup_var_refs_queue.
	(put_reg_into_stack): Allocate it with xmalloc.
	* genattrtab.c: Include ggc.h.
	(operate_exp): Don't use obstack_free when GC'ing.
	(simplify_cond): Likewise.
	(simplify_text_exp): Likewise.
	(optimize_attrs): Likewise.
	* gengentrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
	GC'ing.
	(gencode): Generate a #include for ggc.h.
	* ggc-callbacks.c (ggc_p): Define it to zero.
	* ggc-none.c (ggc_p): Likewise.
	* ggc-simple.c: Include varray.h.
	(ggc_mark_tree_varray): New function.
	(ggc_add_tree_varray_root): Likewise.
	(ggc_mark_tree_varray_ptr): Likewise.
	* ggc.h (ggc_p): Declare.
	(varray_head_tag): Likewise.
	(ggc_add_tree_varray_root): Declare.
	* print-tree.c (print_node): Don't check for TREE_PERMANENT
	inconsistencies when GC'ing.
	* rtl.c: Include ggc.h.
	(rtvec_alloc): Use ggc_alloc_rtvec when GC'ing.
	(rtx_alloc): Use ggc_alloc_rtx when GC'ing.
	(rtx_free): Don't call obstack_free when GC'ing.
	* toplev.c (rest_of_compilation): Call ggc_collect after every
	pass, if GC'ing.
	* tree.c (push_obstacks): Do nothing, if GC'ing.
	(pop_obstacks_nochange): Likewise.
	(pop_obstacks): Likewise.
	(make_node): Use ggc_alloc_tree when GC'ing.
	(copy_node): Likewise.
	(get_identifier): Use ggc_alloc_string when GC'ing.
	(build_string): Likewise.
	(make_tree_vec): Use ggc_alloc_tree when GC'ing.
	(tree_cons): Likewise.
	(build1): Likewise.
	(type_hash_canon): Don't call obstack_free when GC'ing.

Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r29125
1999-09-05 16:08:20 +00:00
Richard Henderson 87ff9c8e4b Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
	(varasm.o): Likewise.
	(function.o): Likewise.
	(stmt.o): Likewise.
	(except.o): Likewise.
	(optabs.o): Likewise.
	(emit-rtl.o): Likewise.
	* emit-rtl.c: Include ggc.h.
	(sequence_element_free_list): Remove, and all references.
	(mark_sequence): New functions.
	(mark_emit_state): New function.
	* except.c: Include ggc.h.
	(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
	(mark_tree_label_node): New functions.
	(mark_eh_state): New function.
	* function.c: Include ggc.h.
	(mark_temp_slot, mark_function_chain): New functions.
	(mark_function_state): New function.
	(init_function_once): New function.
	* function.h (init_function_once): New function.
	* ggc-callbacks.c (lang_mark_false_label_stack): New function.
	* ggc.h (label_node): Declare.
	(eh_status, emit_status, stmt_status, varasm_status): Likewise.
	(lang_mark_false_label_stack): New function.
	(mark_temp_slot): Remove declaration.
	(mark_function_chain): Likewise.
	(mark_eh_state): Adjust prototype.
	(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
	Likewise.
	* optabs.c: Include ggc.h.
	(mark_optab): New function.
	(init_optabs): Add gc roots.
	* stmt.c: Include ggc.h.
	(mark_cond_nesting, mark_loop_nesting): New functions.
	(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
	(mark_stmt_state): New function.
	* toplev.c (compile_file): Call init_function_once.
	* tree.c: Include ggc.h.
	(type_hash): Move declaration earlier in file.
	(TYPE_HASH_SIZE, type_hash_table): Likewise.
	(init_obstacks): Add gc roots.
	(mark_type_hash): New function.
	* varasm.c: Include ggc.h.
	(mark_pool_constant): New function.
	(mark_varasm_state): New function.

Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r29119
1999-09-05 02:41:35 +00:00
Richard Henderson 0a25f1f5e2 Makefile.in (GGC, GGC_LIB): New.
* Makefile.in (GGC, GGC_LIB): New.
	(HOST_RTL): Include ggc-none.o.
	(ggc-simple.o): New target.
	(ggc-none.o): Likewise.
	* tree.h (tree_common): Add gc_mark.
	* rtl.h (struct rtx_def): Steal a bit from code to make gc_mark.
	(struct rtvec_def): Add gc_mark.
	* emit-rtl.c (global_rtl): Update static initializers to contain
	enough initializers.
	* ggc.h, ggc-none.c, ggc-simple.c: New files.
	* toplev.c (gc_time): New variable.
	(all_time): New variable.
	(compile_file): Print gc time.
	(print_time): Calculate percentage of the whole.

From-SVN: r29106
1999-09-04 18:25:41 +00:00