Commit cd030c07 by Diego Novillo Committed by Diego Novillo

Remove zone allocator.

This patch removes the GC zone allocator.  It is not used and it
produces several regressions in the testsuite.  Furthermore, it
complicates things for the plan to implement manual GC markers
(http://gcc.gnu.org/wiki/cxx-conversion/gc-alternatives#Do_GC_marking_manually).

Tested on x86_64 with standard checking, --enable-checking=gc and
--enable-checking=release.

From-SVN: r195426
parent a861ffa4
2013-01-24 Diego Novillo <dnovillo@google.com>
* Makefile.in (GGC): Remove. Replace all instances with
ggc-page.o.
(ggc-zone.o): Remove.
* configure.ac: Remove option --with-gc.
* configure: Re-generate.
* doc/install.texi: Remove documentation for --with-gc.
* gengtype.c (write_enum_defn): Remove. Update all users.
(write_Types_process_field): Remove generation of gt_e_* argument.
(output_type_enum): Remove. Update all users.
(write_enum_defn): Remove. Update all users.
(enum alloc_zone): Remove. Update all users.
(write_splay_tree_allocator_def): Remove generation of gt_e_*
argument.
* ggc-common.c (ggc_splay_alloc): Remove first argument.
Update all callers.
(struct ptr_data): Remove field TYPE. Update all users.
(gt_pch_note_object): Remove argument TYPE. Update all
users.
* ggc-internal.h (ggc_pch_alloc_object): Remove last argument.
Update all users.
* gcc/ggc-none.c (ggc_alloc_typed_stat): Remove.
(struct alloc_zone): Remove.
(ggc_internal_alloc_zone_stat): Remove.
(ggc_internal_cleared_alloc_zone_stat): Remove.
* ggc-page.c (ggc_alloc_typed_stat): Remove.
(ggc_pch_count_object): Remove last argument. Update all
users.
(ggc_pch_alloc_object): Remove last argument. Update all
users.
(struct alloc_zone): Remove.
* ggc-zone.c: Remove.
* ggc.h (gt_pch_note_object): Remove last argument. Update
all users.
(struct alloc_zone): Remove.
(ggc_alloc_typed_stat): Remove.
(ggc_alloc_typed): Remove.
(ggc_splay_alloc): Remove first argument.
(rtl_zone): Remove. Update all users.
(tree_zone): Remove. Update all users.
(tree_id_zone): Remove. Update all users.
(ggc_internal_zone_alloc_stat): Remove. Update all users.
(ggc_internal_zone_cleared_alloc_stat): Remove. Update all
users.
(ggc_internal_zone_vec_alloc_stat): Remove. Update all users.
* tree-ssanames.c: Remove references to zone allocator in
comments.
2013-01-24 Georg-Johann Lay <avr@gjlay.de> 2013-01-24 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (avr_out_fract): Make register numbers that * config/avr/avr.c (avr_out_fract): Make register numbers that
......
...@@ -661,9 +661,6 @@ LIBINTL_DEP = @LIBINTL_DEP@ ...@@ -661,9 +661,6 @@ LIBINTL_DEP = @LIBINTL_DEP@
LIBICONV = @LIBICONV@ LIBICONV = @LIBICONV@
LIBICONV_DEP = @LIBICONV_DEP@ LIBICONV_DEP = @LIBICONV_DEP@
# The GC method to be used on this system.
GGC=@GGC@.o
# If a supplementary library is being used for the GC. # If a supplementary library is being used for the GC.
GGC_LIB= GGC_LIB=
...@@ -1157,7 +1154,7 @@ OBJS = \ ...@@ -1157,7 +1154,7 @@ OBJS = \
insn-preds.o \ insn-preds.o \
insn-recog.o \ insn-recog.o \
insn-enums.o \ insn-enums.o \
$(GGC) \ ggc-page.o \
alias.o \ alias.o \
alloc-pool.o \ alloc-pool.o \
auto-inc-dec.o \ auto-inc-dec.o \
...@@ -2120,10 +2117,6 @@ ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TR ...@@ -2120,10 +2117,6 @@ ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TR
$(FLAGS_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) \ $(FLAGS_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) \
$(TREE_FLOW_H) $(PLUGIN_H) $(GGC_INTERNAL_H) $(TREE_FLOW_H) $(PLUGIN_H) $(GGC_INTERNAL_H)
ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \
$(PARAMS_H) $(BITMAP_H) $(PLUGIN_H) $(GGC_INTERNAL_H)
ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \
$(BCONFIG_H) $(BCONFIG_H)
......
...@@ -674,7 +674,6 @@ MAINT ...@@ -674,7 +674,6 @@ MAINT
zlibinc zlibinc
zlibdir zlibdir
HOST_LIBS HOST_LIBS
GGC
libgcc_visibility libgcc_visibility
gcc_cv_readelf gcc_cv_readelf
gcc_cv_objdump gcc_cv_objdump
...@@ -1670,7 +1669,8 @@ Optional Packages: ...@@ -1670,7 +1669,8 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-plugin-ld=[ARG] specify the plugin linker --with-plugin-ld=[ARG] specify the plugin linker
--with-long-double-128 use 128-bit long double by default --with-long-double-128 use 128-bit long double by default
--with-gc={page,zone} choose the garbage collection mechanism to use with --with-gc={page,zone} this option is not supported anymore. It used to
choose the garbage collection mechanism to use with
the compiler the compiler
--with-system-zlib use installed libz --with-system-zlib use installed libz
--with-linker-hash-style={sysv,gnu,both} --with-linker-hash-style={sysv,gnu,both}
...@@ -26807,31 +26807,15 @@ fi ...@@ -26807,31 +26807,15 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_target_dl_iterate_phdr" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_target_dl_iterate_phdr" >&5
$as_echo "$gcc_cv_target_dl_iterate_phdr" >&6; } $as_echo "$gcc_cv_target_dl_iterate_phdr" >&6; }
# Find out what GC implementation we want, or may, use. # We no longer support different GC mechanisms. Emit an error if
# the user configures with --with-gc.
# Check whether --with-gc was given. # Check whether --with-gc was given.
if test "${with_gc+set}" = set; then : if test "${with_gc+set}" = set; then :
withval=$with_gc; case "$withval" in withval=$with_gc; as_fn_error "Configure option --with-gc is only supported up to GCC 4.7.x" "$LINENO" 5
page)
GGC=ggc-$withval
;;
zone)
GGC=ggc-$withval
$as_echo "#define GGC_ZONE 1" >>confdefs.h
;;
*)
as_fn_error "$withval is an invalid option to --with-gc" "$LINENO" 5
;;
esac
else
GGC=ggc-page
fi fi
echo "Using $GGC for garbage collection."
# Libraries to use on the host. This will normally be set by the top # Libraries to use on the host. This will normally be set by the top
# level Makefile. Here we simply capture the value for our Makefile. # level Makefile. Here we simply capture the value for our Makefile.
if test -z "${HOST_LIBS+set}"; then if test -z "${HOST_LIBS+set}"; then
......
...@@ -4797,26 +4797,14 @@ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then ...@@ -4797,26 +4797,14 @@ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
fi fi
AC_MSG_RESULT($gcc_cv_target_dl_iterate_phdr) AC_MSG_RESULT($gcc_cv_target_dl_iterate_phdr)
# Find out what GC implementation we want, or may, use. # We no longer support different GC mechanisms. Emit an error if
# the user configures with --with-gc.
AC_ARG_WITH(gc, AC_ARG_WITH(gc,
[AS_HELP_STRING([--with-gc={page,zone}], [AS_HELP_STRING([--with-gc={page,zone}],
[choose the garbage collection mechanism to use [this option is not supported anymore. It used to choose
with the compiler])], the garbage collection mechanism to use with the compiler])],
[case "$withval" in [AC_MSG_ERROR([Configure option --with-gc is only supported up to GCC 4.7.x])],
page) [])
GGC=ggc-$withval
;;
zone)
GGC=ggc-$withval
AC_DEFINE(GGC_ZONE, 1, [Define if the zone collector is in use])
;;
*)
AC_MSG_ERROR([$withval is an invalid option to --with-gc])
;;
esac],
[GGC=ggc-page])
AC_SUBST(GGC)
echo "Using $GGC for garbage collection."
# Libraries to use on the host. This will normally be set by the top # Libraries to use on the host. This will normally be set by the top
# level Makefile. Here we simply capture the value for our Makefile. # level Makefile. Here we simply capture the value for our Makefile.
......
...@@ -1523,12 +1523,6 @@ When this option is specified more detailed information on memory ...@@ -1523,12 +1523,6 @@ When this option is specified more detailed information on memory
allocation is gathered. This information is printed when using allocation is gathered. This information is printed when using
@option{-fmem-report}. @option{-fmem-report}.
@item --with-gc
@itemx --with-gc=@var{choice}
With this option you can specify the garbage collector implementation
used during the compilation process. @var{choice} can be one of
@samp{page} and @samp{zone}, where @samp{page} is the default.
@item --enable-nls @item --enable-nls
@itemx --disable-nls @itemx --disable-nls
The @option{--enable-nls} option enables Native Language Support (NLS), The @option{--enable-nls} option enables Native Language Support (NLS),
......
...@@ -250,8 +250,7 @@ ggc_cleared_alloc_ptr_array_two_args (size_t c, size_t n) ...@@ -250,8 +250,7 @@ ggc_cleared_alloc_ptr_array_two_args (size_t c, size_t n)
/* These are for splay_tree_new_ggc. */ /* These are for splay_tree_new_ggc. */
void * void *
ggc_splay_alloc (enum gt_types_enum obj_type ATTRIBUTE_UNUSED, int sz, ggc_splay_alloc (int sz, void *nl)
void *nl)
{ {
gcc_assert (!nl); gcc_assert (!nl);
return ggc_internal_alloc (sz); return ggc_internal_alloc (sz);
...@@ -300,7 +299,6 @@ struct ptr_data ...@@ -300,7 +299,6 @@ struct ptr_data
gt_handle_reorder reorder_fn; gt_handle_reorder reorder_fn;
size_t size; size_t size;
void *new_addr; void *new_addr;
enum gt_types_enum type;
}; };
#define POINTER_HASH(x) (hashval_t)((intptr_t)x >> 3) #define POINTER_HASH(x) (hashval_t)((intptr_t)x >> 3)
...@@ -309,8 +307,7 @@ struct ptr_data ...@@ -309,8 +307,7 @@ struct ptr_data
int int
gt_pch_note_object (void *obj, void *note_ptr_cookie, gt_pch_note_object (void *obj, void *note_ptr_cookie,
gt_note_pointers note_ptr_fn, gt_note_pointers note_ptr_fn)
enum gt_types_enum type)
{ {
struct ptr_data **slot; struct ptr_data **slot;
...@@ -335,7 +332,6 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie, ...@@ -335,7 +332,6 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie,
(*slot)->size = strlen ((const char *)obj) + 1; (*slot)->size = strlen ((const char *)obj) + 1;
else else
(*slot)->size = ggc_get_size (obj); (*slot)->size = ggc_get_size (obj);
(*slot)->type = type;
return 1; return 1;
} }
...@@ -391,8 +387,7 @@ call_count (void **slot, void *state_p) ...@@ -391,8 +387,7 @@ call_count (void **slot, void *state_p)
struct traversal_state *state = (struct traversal_state *)state_p; struct traversal_state *state = (struct traversal_state *)state_p;
ggc_pch_count_object (state->d, d->obj, d->size, ggc_pch_count_object (state->d, d->obj, d->size,
d->note_ptr_fn == gt_pch_p_S, d->note_ptr_fn == gt_pch_p_S);
d->type);
state->count++; state->count++;
return 1; return 1;
} }
...@@ -404,8 +399,7 @@ call_alloc (void **slot, void *state_p) ...@@ -404,8 +399,7 @@ call_alloc (void **slot, void *state_p)
struct traversal_state *state = (struct traversal_state *)state_p; struct traversal_state *state = (struct traversal_state *)state_p;
d->new_addr = ggc_pch_alloc_object (state->d, d->obj, d->size, d->new_addr = ggc_pch_alloc_object (state->d, d->obj, d->size,
d->note_ptr_fn == gt_pch_p_S, d->note_ptr_fn == gt_pch_p_S);
d->type);
state->ptrs[state->ptrs_i++] = d; state->ptrs[state->ptrs_i++] = d;
return 1; return 1;
} }
......
...@@ -55,8 +55,7 @@ extern struct ggc_pch_data *init_ggc_pch (void); ...@@ -55,8 +55,7 @@ extern struct ggc_pch_data *init_ggc_pch (void);
of an object. Update the ggc_pch_data structure with as much of of an object. Update the ggc_pch_data structure with as much of
that information as is necessary. The bool argument should be true that information as is necessary. The bool argument should be true
if the object is a string. */ if the object is a string. */
extern void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t, bool, extern void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t, bool);
enum gt_types_enum);
/* Return the total size of the data to be written to hold all /* Return the total size of the data to be written to hold all
the objects previously passed to ggc_pch_count_object. */ the objects previously passed to ggc_pch_count_object. */
...@@ -69,8 +68,7 @@ extern void ggc_pch_this_base (struct ggc_pch_data *, void *); ...@@ -69,8 +68,7 @@ extern void ggc_pch_this_base (struct ggc_pch_data *, void *);
/* Assuming that the objects really do end up at the address /* Assuming that the objects really do end up at the address
passed to ggc_pch_this_base, return the address of this object. passed to ggc_pch_this_base, return the address of this object.
The bool argument should be true if the object is a string. */ The bool argument should be true if the object is a string. */
extern char *ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t, bool, extern char *ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t, bool);
enum gt_types_enum);
/* Write out any initial information required. */ /* Write out any initial information required. */
extern void ggc_pch_prepare_write (struct ggc_pch_data *, FILE *); extern void ggc_pch_prepare_write (struct ggc_pch_data *, FILE *);
......
...@@ -31,13 +31,6 @@ ...@@ -31,13 +31,6 @@
#include "coretypes.h" #include "coretypes.h"
#include "ggc.h" #include "ggc.h"
void *
ggc_alloc_typed_stat (enum gt_types_enum ARG_UNUSED (gte), size_t size
MEM_STAT_DECL)
{
return xmalloc (size);
}
/* For a given size of memory requested for allocation, return the /* For a given size of memory requested for allocation, return the
actual size that is going to be allocated. */ actual size that is going to be allocated. */
...@@ -70,31 +63,3 @@ ggc_free (void *p) ...@@ -70,31 +63,3 @@ ggc_free (void *p)
{ {
free (p); free (p);
} }
struct alloc_zone
{
int dummy;
};
struct alloc_zone rtl_zone;
struct alloc_zone tree_zone;
struct alloc_zone tree_id_zone;
#if defined (GGC_ZONE) && !defined (GENERATOR_FILE)
void *
ggc_internal_alloc_zone_stat (size_t size,
struct alloc_zone * ARG_UNUSED(z) MEM_STAT_DECL)
{
return xmalloc (size);
}
void *
ggc_internal_cleared_alloc_zone_stat (size_t size,
struct alloc_zone * ARG_UNUSED(z)
MEM_STAT_DECL)
{
return xcalloc (size, 1);
}
#endif
...@@ -1199,15 +1199,6 @@ ggc_round_alloc_size (size_t requested_size) ...@@ -1199,15 +1199,6 @@ ggc_round_alloc_size (size_t requested_size)
return size; return size;
} }
/* Typed allocation function. Does nothing special in this collector. */
void *
ggc_alloc_typed_stat (enum gt_types_enum type ATTRIBUTE_UNUSED, size_t size
MEM_STAT_DECL)
{
return ggc_internal_alloc_stat (size PASS_MEM_STAT);
}
/* Allocate a chunk of memory of SIZE bytes. Its contents are undefined. */ /* Allocate a chunk of memory of SIZE bytes. Its contents are undefined. */
void * void *
...@@ -2230,8 +2221,7 @@ init_ggc_pch (void) ...@@ -2230,8 +2221,7 @@ init_ggc_pch (void)
void void
ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED,
size_t size, bool is_string ATTRIBUTE_UNUSED, size_t size, bool is_string ATTRIBUTE_UNUSED)
enum gt_types_enum type ATTRIBUTE_UNUSED)
{ {
unsigned order; unsigned order;
...@@ -2274,8 +2264,7 @@ ggc_pch_this_base (struct ggc_pch_data *d, void *base) ...@@ -2274,8 +2264,7 @@ ggc_pch_this_base (struct ggc_pch_data *d, void *base)
char * char *
ggc_pch_alloc_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, ggc_pch_alloc_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED,
size_t size, bool is_string ATTRIBUTE_UNUSED, size_t size, bool is_string ATTRIBUTE_UNUSED)
enum gt_types_enum type ATTRIBUTE_UNUSED)
{ {
unsigned order; unsigned order;
char *result; char *result;
...@@ -2507,12 +2496,3 @@ ggc_pch_read (FILE *f, void *addr) ...@@ -2507,12 +2496,3 @@ ggc_pch_read (FILE *f, void *addr)
/* Update the statistics. */ /* Update the statistics. */
G.allocated = G.allocated_last_gc = offs - (char *)addr; G.allocated = G.allocated_last_gc = offs - (char *)addr;
} }
struct alloc_zone
{
int dummy;
};
struct alloc_zone rtl_zone;
struct alloc_zone tree_zone;
struct alloc_zone tree_id_zone;
...@@ -48,8 +48,7 @@ typedef void (*gt_handle_reorder) (void *, void *, gt_pointer_operator, ...@@ -48,8 +48,7 @@ typedef void (*gt_handle_reorder) (void *, void *, gt_pointer_operator,
void *); void *);
/* Used by the gt_pch_n_* routines. Register an object in the hash table. */ /* Used by the gt_pch_n_* routines. Register an object in the hash table. */
extern int gt_pch_note_object (void *, void *, gt_note_pointers, extern int gt_pch_note_object (void *, void *, gt_note_pointers);
enum gt_types_enum = gt_types_enum_last);
/* Used by the gt_pch_n_* routines. Register that an object has a reorder /* Used by the gt_pch_n_* routines. Register that an object has a reorder
function. */ function. */
...@@ -118,8 +117,6 @@ extern void gt_ggc_m_S (const void *); ...@@ -118,8 +117,6 @@ extern void gt_ggc_m_S (const void *);
/* End of GTY machinery API. */ /* End of GTY machinery API. */
struct alloc_zone;
/* Initialize the string pool. */ /* Initialize the string pool. */
extern void init_stringpool (void); extern void init_stringpool (void);
...@@ -146,12 +143,6 @@ extern size_t ggc_round_alloc_size (size_t requested_size); ...@@ -146,12 +143,6 @@ extern size_t ggc_round_alloc_size (size_t requested_size);
#define ggc_internal_alloc(s) ggc_internal_alloc_stat (s MEM_STAT_INFO) #define ggc_internal_alloc(s) ggc_internal_alloc_stat (s MEM_STAT_INFO)
/* Allocate an object of the specified type and size. */
extern void *ggc_alloc_typed_stat (enum gt_types_enum, size_t MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
#define ggc_alloc_typed(s, z) ggc_alloc_typed_stat (s, z MEM_STAT_INFO)
/* Allocates cleared memory. */ /* Allocates cleared memory. */
extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL) extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL)
ATTRIBUTE_MALLOC; ATTRIBUTE_MALLOC;
...@@ -213,7 +204,7 @@ extern void *ggc_cleared_alloc_ptr_array_two_args (size_t, size_t) ...@@ -213,7 +204,7 @@ extern void *ggc_cleared_alloc_ptr_array_two_args (size_t, size_t)
splay_tree_new_typed_alloc (COMPARE, NULL, NULL, &ALLOC_TREE, &ALLOC_NODE, \ splay_tree_new_typed_alloc (COMPARE, NULL, NULL, &ALLOC_TREE, &ALLOC_NODE, \
&ggc_splay_dont_free, NULL) &ggc_splay_dont_free, NULL)
extern void *ggc_splay_alloc (enum gt_types_enum, int, void *) extern void *ggc_splay_alloc (int, void *)
ATTRIBUTE_MALLOC; ATTRIBUTE_MALLOC;
extern void ggc_splay_dont_free (void *, void *); extern void ggc_splay_dont_free (void *, void *);
...@@ -254,99 +245,28 @@ extern void stringpool_statistics (void); ...@@ -254,99 +245,28 @@ extern void stringpool_statistics (void);
/* Heuristics. */ /* Heuristics. */
extern void init_ggc_heuristics (void); extern void init_ggc_heuristics (void);
/* Zone collection. */ #define ggc_alloc_rtvec_sized(NELT) \
ggc_alloc_rtvec_def (sizeof (struct rtvec_def) \
/* For regular rtl allocations. */ + ((NELT) - 1) * sizeof (rtx)) \
extern struct alloc_zone rtl_zone;
/* For regular tree allocations. */
extern struct alloc_zone tree_zone;
/* For IDENTIFIER_NODE allocations. */
extern struct alloc_zone tree_id_zone;
#define ggc_alloc_rtvec_sized(NELT) \
ggc_alloc_zone_rtvec_def (sizeof (struct rtvec_def) \
+ ((NELT) - 1) * sizeof (rtx), \
&rtl_zone)
#if defined (GGC_ZONE) && !defined (GENERATOR_FILE)
/* Allocate an object into the specified allocation zone. */
extern void *ggc_internal_alloc_zone_stat (size_t,
struct alloc_zone * MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
extern void *ggc_internal_cleared_alloc_zone_stat (size_t,
struct alloc_zone * MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
static inline void *
ggc_internal_zone_alloc_stat (struct alloc_zone * z, size_t s MEM_STAT_DECL)
{
return ggc_internal_alloc_zone_stat (s, z PASS_MEM_STAT);
}
static inline void *
ggc_internal_zone_cleared_alloc_stat (struct alloc_zone * z, size_t s
MEM_STAT_DECL)
{
return ggc_internal_cleared_alloc_zone_stat (s, z PASS_MEM_STAT);
}
static inline void *
ggc_internal_zone_vec_alloc_stat (struct alloc_zone * z, size_t s, size_t n
MEM_STAT_DECL)
{
return ggc_internal_alloc_zone_stat (s * n, z PASS_MEM_STAT);
}
#else
static inline void *
ggc_internal_zone_alloc_stat (struct alloc_zone * z ATTRIBUTE_UNUSED,
size_t s MEM_STAT_DECL)
{
return ggc_internal_alloc_stat (s PASS_MEM_STAT);
}
static inline void *
ggc_internal_zone_cleared_alloc_stat (struct alloc_zone * z ATTRIBUTE_UNUSED,
size_t s MEM_STAT_DECL)
{
return ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
}
static inline void *
ggc_internal_zone_vec_alloc_stat (struct alloc_zone * z ATTRIBUTE_UNUSED,
size_t s, size_t n MEM_STAT_DECL)
{
return ggc_internal_vec_alloc_stat (s, n PASS_MEM_STAT);
}
#endif
/* Memory statistics passing versions of some allocators. Too few of them to /* Memory statistics passing versions of some allocators. Too few of them to
make gengtype produce them, so just define the needed ones here. */ make gengtype produce them, so just define the needed ones here. */
static inline struct rtx_def * static inline struct rtx_def *
ggc_alloc_zone_rtx_def_stat (struct alloc_zone * z, size_t s MEM_STAT_DECL) ggc_alloc_rtx_def_stat (size_t s MEM_STAT_DECL)
{ {
return (struct rtx_def *) ggc_internal_zone_alloc_stat (z, s PASS_MEM_STAT); return (struct rtx_def *) ggc_internal_alloc_stat (s PASS_MEM_STAT);
} }
static inline union tree_node * static inline union tree_node *
ggc_alloc_zone_tree_node_stat (struct alloc_zone * z, size_t s MEM_STAT_DECL) ggc_alloc_tree_node_stat (size_t s MEM_STAT_DECL)
{ {
return (union tree_node *) ggc_internal_zone_alloc_stat (z, s PASS_MEM_STAT); return (union tree_node *) ggc_internal_alloc_stat (s PASS_MEM_STAT);
} }
static inline union tree_node * static inline union tree_node *
ggc_alloc_zone_cleared_tree_node_stat (struct alloc_zone * z, size_t s ggc_alloc_cleared_tree_node_stat (size_t s MEM_STAT_DECL)
MEM_STAT_DECL)
{ {
return (union tree_node *) return (union tree_node *) ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
ggc_internal_zone_cleared_alloc_stat (z, s PASS_MEM_STAT);
} }
static inline union gimple_statement_d * static inline union gimple_statement_d *
......
...@@ -192,8 +192,7 @@ rtx_size (const_rtx x) ...@@ -192,8 +192,7 @@ rtx_size (const_rtx x)
rtx rtx
rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL) rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL)
{ {
rtx rt = ggc_alloc_zone_rtx_def_stat (&rtl_zone, RTX_CODE_SIZE (code) rtx rt = ggc_alloc_rtx_def_stat (RTX_CODE_SIZE (code) PASS_MEM_STAT);
PASS_MEM_STAT);
/* We want to clear everything up to the FLD array. Normally, this /* We want to clear everything up to the FLD array. Normally, this
is one int, but we don't want to assume that and it isn't very is one int, but we don't want to assume that and it isn't very
...@@ -329,7 +328,7 @@ rtx ...@@ -329,7 +328,7 @@ rtx
shallow_copy_rtx_stat (const_rtx orig MEM_STAT_DECL) shallow_copy_rtx_stat (const_rtx orig MEM_STAT_DECL)
{ {
const unsigned int size = rtx_size (orig); const unsigned int size = rtx_size (orig);
rtx const copy = ggc_alloc_zone_rtx_def_stat (&rtl_zone, size PASS_MEM_STAT); rtx const copy = ggc_alloc_rtx_def_stat (size PASS_MEM_STAT);
return (rtx) memcpy (copy, orig, size); return (rtx) memcpy (copy, orig, size);
} }
......
...@@ -207,7 +207,7 @@ void ...@@ -207,7 +207,7 @@ void
gt_pch_n_S (const void *x) gt_pch_n_S (const void *x)
{ {
gt_pch_note_object (CONST_CAST (void *, x), CONST_CAST (void *, x), gt_pch_note_object (CONST_CAST (void *, x), CONST_CAST (void *, x),
&gt_pch_p_S, gt_types_enum_last); &gt_pch_p_S);
} }
......
...@@ -42,10 +42,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -42,10 +42,6 @@ along with GCC; see the file COPYING3. If not see
garbage collector. Similar results have been seen on a wider variety garbage collector. Similar results have been seen on a wider variety
of tests (such as the compiler itself). of tests (such as the compiler itself).
We could also use a zone allocator for these objects since they have
a very well defined lifetime. If someone wants to experiment with that
this is the place to try it.
PHI nodes have different sizes, so we can't have a single list of all PHI nodes have different sizes, so we can't have a single list of all
the PHI nodes as it would be too expensive to walk down that list to the PHI nodes as it would be too expensive to walk down that list to
find a PHI of a suitable size. find a PHI of a suitable size.
......
...@@ -50,11 +50,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -50,11 +50,8 @@ along with GCC; see the file COPYING3. If not see
External code should also not assume the version number on nodes is External code should also not assume the version number on nodes is
monotonically increasing. We reuse the version number when we monotonically increasing. We reuse the version number when we
reuse an SSA_NAME expression. This helps keep arrays and bitmaps reuse an SSA_NAME expression. This helps keep arrays and bitmaps
more compact. more compact. */
We could also use a zone allocator for these objects since they have
a very well defined lifetime. If someone wants to experiment with that
this is the place to try it. */
/* Version numbers with special meanings. We start allocating new version /* Version numbers with special meanings. We start allocating new version
numbers after the special ones. */ numbers after the special ones. */
......
...@@ -857,9 +857,7 @@ make_node_stat (enum tree_code code MEM_STAT_DECL) ...@@ -857,9 +857,7 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
record_node_allocation_statistics (code, length); record_node_allocation_statistics (code, length);
t = ggc_alloc_zone_cleared_tree_node_stat ( t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
(code == IDENTIFIER_NODE) ? &tree_id_zone : &tree_zone,
length PASS_MEM_STAT);
TREE_SET_CODE (t, code); TREE_SET_CODE (t, code);
switch (type) switch (type)
...@@ -953,7 +951,7 @@ copy_node_stat (tree node MEM_STAT_DECL) ...@@ -953,7 +951,7 @@ copy_node_stat (tree node MEM_STAT_DECL)
length = tree_size (node); length = tree_size (node);
record_node_allocation_statistics (code, length); record_node_allocation_statistics (code, length);
t = ggc_alloc_zone_tree_node_stat (&tree_zone, length PASS_MEM_STAT); t = ggc_alloc_tree_node_stat (length PASS_MEM_STAT);
memcpy (t, node, length); memcpy (t, node, length);
if (CODE_CONTAINS_STRUCT (code, TS_COMMON)) if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
...@@ -1311,7 +1309,7 @@ make_vector_stat (unsigned len MEM_STAT_DECL) ...@@ -1311,7 +1309,7 @@ make_vector_stat (unsigned len MEM_STAT_DECL)
record_node_allocation_statistics (VECTOR_CST, length); record_node_allocation_statistics (VECTOR_CST, length);
t = ggc_alloc_zone_cleared_tree_node_stat (&tree_zone, length PASS_MEM_STAT); t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
TREE_SET_CODE (t, VECTOR_CST); TREE_SET_CODE (t, VECTOR_CST);
TREE_CONSTANT (t) = 1; TREE_CONSTANT (t) = 1;
...@@ -1674,7 +1672,7 @@ make_tree_binfo_stat (unsigned base_binfos MEM_STAT_DECL) ...@@ -1674,7 +1672,7 @@ make_tree_binfo_stat (unsigned base_binfos MEM_STAT_DECL)
record_node_allocation_statistics (TREE_BINFO, length); record_node_allocation_statistics (TREE_BINFO, length);
t = ggc_alloc_zone_tree_node_stat (&tree_zone, length PASS_MEM_STAT); t = ggc_alloc_tree_node_stat (length PASS_MEM_STAT);
memset (t, 0, offsetof (struct tree_binfo, base_binfos)); memset (t, 0, offsetof (struct tree_binfo, base_binfos));
...@@ -1713,7 +1711,7 @@ make_tree_vec_stat (int len MEM_STAT_DECL) ...@@ -1713,7 +1711,7 @@ make_tree_vec_stat (int len MEM_STAT_DECL)
record_node_allocation_statistics (TREE_VEC, length); record_node_allocation_statistics (TREE_VEC, length);
t = ggc_alloc_zone_cleared_tree_node_stat (&tree_zone, length PASS_MEM_STAT); t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
TREE_SET_CODE (t, TREE_VEC); TREE_SET_CODE (t, TREE_VEC);
TREE_VEC_LENGTH (t) = len; TREE_VEC_LENGTH (t) = len;
...@@ -2330,8 +2328,7 @@ tree_cons_stat (tree purpose, tree value, tree chain MEM_STAT_DECL) ...@@ -2330,8 +2328,7 @@ tree_cons_stat (tree purpose, tree value, tree chain MEM_STAT_DECL)
{ {
tree node; tree node;
node = ggc_alloc_zone_tree_node_stat (&tree_zone, sizeof (struct tree_list) node = ggc_alloc_tree_node_stat (sizeof (struct tree_list) PASS_MEM_STAT);
PASS_MEM_STAT);
memset (node, 0, sizeof (struct tree_common)); memset (node, 0, sizeof (struct tree_common));
record_node_allocation_statistics (TREE_LIST, sizeof (struct tree_list)); record_node_allocation_statistics (TREE_LIST, sizeof (struct tree_list));
...@@ -3800,7 +3797,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) ...@@ -3800,7 +3797,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
gcc_assert (TREE_CODE_LENGTH (code) == 1); gcc_assert (TREE_CODE_LENGTH (code) == 1);
t = ggc_alloc_zone_tree_node_stat (&tree_zone, length PASS_MEM_STAT); t = ggc_alloc_tree_node_stat (length PASS_MEM_STAT);
memset (t, 0, sizeof (struct tree_common)); memset (t, 0, sizeof (struct tree_common));
...@@ -10073,7 +10070,7 @@ build_vl_exp_stat (enum tree_code code, int len MEM_STAT_DECL) ...@@ -10073,7 +10070,7 @@ build_vl_exp_stat (enum tree_code code, int len MEM_STAT_DECL)
record_node_allocation_statistics (code, length); record_node_allocation_statistics (code, length);
t = ggc_alloc_zone_cleared_tree_node_stat (&tree_zone, length PASS_MEM_STAT); t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
TREE_SET_CODE (t, code); TREE_SET_CODE (t, code);
......
...@@ -374,7 +374,7 @@ create_block_symbol (const char *label, struct object_block *block, ...@@ -374,7 +374,7 @@ create_block_symbol (const char *label, struct object_block *block,
/* Create the extended SYMBOL_REF. */ /* Create the extended SYMBOL_REF. */
size = RTX_HDR_SIZE + sizeof (struct block_symbol); size = RTX_HDR_SIZE + sizeof (struct block_symbol);
symbol = ggc_alloc_zone_rtx_def (size, &rtl_zone); symbol = ggc_alloc_rtx_def (size);
/* Initialize the normal SYMBOL_REF fields. */ /* Initialize the normal SYMBOL_REF fields. */
memset (symbol, 0, size); memset (symbol, 0, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment