osprey/kg++fe/gnu/ggc-page.c File Reference

#include "config.h"
#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
#include "toplev.h"
#include "flags.h"
#include "ggc.h"
#include "timevar.h"
#include "params.h"

Include dependency graph for ggc-page.c:

Go to the source code of this file.

Data Types

type  max_alignment
type  page_entry
type  page_group
type  globals

Defines

#define VALGRIND_DISCARD(x)
#define USING_MALLOC_PAGE_GROUPS
#define GGC_DEBUG_LEVEL   (0)
#define HOST_BITS_PER_PTR   HOST_BITS_PER_LONG
#define PAGE_L1_BITS   (8)
#define PAGE_L2_BITS   (32 - PAGE_L1_BITS - G.lg_pagesize)
#define PAGE_L1_SIZE   ((size_t) 1 << PAGE_L1_BITS)
#define PAGE_L2_SIZE   ((size_t) 1 << PAGE_L2_BITS)
#define LOOKUP_L1(p)   (((size_t) (p) >> (32 - PAGE_L1_BITS)) & ((1 << PAGE_L1_BITS) - 1))
#define LOOKUP_L2(p)   (((size_t) (p) >> G.lg_pagesize) & ((1 << PAGE_L2_BITS) - 1))
#define OBJECTS_PER_PAGE(ORDER)   objects_per_page_table[ORDER]
#define OBJECT_SIZE(ORDER)   object_size_table[ORDER]
#define DIV_MULT(ORDER)   inverse_table[ORDER].mult
#define DIV_SHIFT(ORDER)   inverse_table[ORDER].shift
#define OFFSET_TO_BIT(OFFSET, ORDER)   (((OFFSET) * DIV_MULT (ORDER)) >> DIV_SHIFT (ORDER))
#define NUM_EXTRA_ORDERS   ARRAY_SIZE (extra_order_size_table)
#define RTL_SIZE(NSLOTS)   (sizeof (struct rtx_def) + ((NSLOTS) - 1) * sizeof (rtunion))
#define NUM_ORDERS   (HOST_BITS_PER_PTR + NUM_EXTRA_ORDERS)
#define MAX_ALIGNMENT   (offsetof (struct max_alignment, u))
#define BITMAP_SIZE(Num_objects)   (CEIL ((Num_objects), HOST_BITS_PER_LONG) * sizeof(long))
#define GGC_QUIRE_SIZE   16
#define INITIAL_PTE_COUNT   128
#define prefetch(X)   ((void) X)
#define save_in_use_p_i(__i)   (G.save_in_use[__i])
#define save_in_use_p(__p)   (save_in_use_p_i (__p->index_by_depth))
#define SCALE(x)
#define LABEL(x)   ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))

Typedefs

typedef page_entry ** page_table [PAGE_L1_SIZE]

Functions/Subroutines

static int ggc_allocated_p PARAMS ((const void *))
static void set_page_table_entry PARAMS ((void *, page_entry *))
static size_t page_group_index PARAMS ((char *, char *))
static void set_page_group_in_use PARAMS ((page_group *, char *))
static struct page_entry
*alloc_page 
PARAMS ((unsigned))
static void free_page PARAMS ((struct page_entry *))
static void release_pages PARAMS ((void))
static void
ggc_recalculate_in_use_p 
PARAMS ((page_entry *))
void debug_print_page_list PARAMS ((int))
static void push_depth PARAMS ((unsigned int))
static void push_by_depth PARAMS ((page_entry *, unsigned long *))
static void push_depth (unsigned int i)
static void push_by_depth (page_entry *p, unsigned long *s)
static int ggc_allocated_p (void *p) const
static page_entrylookup_page_table_entry (void *p) const
static void set_page_table_entry (void *p, page_entry *entry)
void debug_print_page_list (int order)
static size_t page_group_index (char *allocation, char *page)
static void set_page_group_in_use (page_group *group, char *page)
static void clear_page_group_in_use (page_group *group, char *page)
static struct page_entryalloc_page (unsigned order)
static void adjust_depth ()
static void free_page (page_entry *entry)
static void release_pages ()
voidggc_alloc (size_t size)
int ggc_set_mark (void *p) const
int ggc_marked_p (void *p) const
size_t ggc_get_size (void *p) const
static void compute_inverse (unsigned order)
void init_ggc ()
void ggc_push_context ()
static void ggc_recalculate_in_use_p (page_entry *p)
void ggc_pop_context ()
static void clear_marks ()
static void sweep_pages ()
void ggc_collect ()
void ggc_print_statistics ()

Variables

static const size_t extra_order_size_table []
static unsigned objects_per_page_table [NUM_ORDERS]
static size_t object_size_table [NUM_ORDERS]
type {
   unsigned int   mult
   unsigned int   shift
inverse_table [NUM_ORDERS]
static struct globals G
static unsigned char size_lookup [289]


Define Documentation

#define BITMAP_SIZE ( Num_objects   )     (CEIL ((Num_objects), HOST_BITS_PER_LONG) * sizeof(long))

#define DIV_MULT ( ORDER   )     inverse_table[ORDER].mult

Definition at line 154 of file ggc-page.c.

Referenced by compute_inverse().

#define DIV_SHIFT ( ORDER   )     inverse_table[ORDER].shift

Definition at line 155 of file ggc-page.c.

Referenced by compute_inverse().

#define GGC_DEBUG_LEVEL   (0)

#define GGC_QUIRE_SIZE   16

Definition at line 396 of file ggc-page.c.

Referenced by alloc_page(), and alloc_small_page().

#define HOST_BITS_PER_PTR   HOST_BITS_PER_LONG

Definition at line 106 of file ggc-page.c.

Referenced by init_ggc().

#define INITIAL_PTE_COUNT   128

Definition at line 399 of file ggc-page.c.

Referenced by init_ggc().

#define LABEL (  )     ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))

Definition at line 1756 of file ggc-page.c.

#define LOOKUP_L1 ( p   )     (((size_t) (p) >> (32 - PAGE_L1_BITS)) & ((1 << PAGE_L1_BITS) - 1))

Definition at line 137 of file ggc-page.c.

Referenced by ggc_allocated_p(), lookup_page_table_entry(), and set_page_table_entry().

#define LOOKUP_L2 ( p   )     (((size_t) (p) >> G.lg_pagesize) & ((1 << PAGE_L2_BITS) - 1))

Definition at line 140 of file ggc-page.c.

Referenced by ggc_allocated_p(), lookup_page_table_entry(), and set_page_table_entry().

#define MAX_ALIGNMENT   (offsetof (struct max_alignment, u))

#define NUM_EXTRA_ORDERS   ARRAY_SIZE (extra_order_size_table)

Definition at line 162 of file ggc-page.c.

#define NUM_ORDERS   (HOST_BITS_PER_PTR + NUM_EXTRA_ORDERS)

Definition at line 180 of file ggc-page.c.

Referenced by clear_marks(), ggc_pop_context(), init_ggc(), and sweep_pages().

#define OBJECT_SIZE ( ORDER   )     object_size_table[ORDER]

#define OBJECTS_PER_PAGE ( ORDER   )     objects_per_page_table[ORDER]

#define OFFSET_TO_BIT ( OFFSET,
ORDER   )     (((OFFSET) * DIV_MULT (ORDER)) >> DIV_SHIFT (ORDER))

Definition at line 156 of file ggc-page.c.

Referenced by ggc_free(), ggc_marked_p(), and ggc_set_mark().

#define PAGE_L1_BITS   (8)

Definition at line 132 of file ggc-page.c.

#define PAGE_L1_SIZE   ((size_t) 1 << PAGE_L1_BITS)

Definition at line 134 of file ggc-page.c.

Referenced by ggc_print_statistics().

#define PAGE_L2_BITS   (32 - PAGE_L1_BITS - G.lg_pagesize)

Definition at line 133 of file ggc-page.c.

#define PAGE_L2_SIZE   ((size_t) 1 << PAGE_L2_BITS)

Definition at line 135 of file ggc-page.c.

Referenced by ggc_print_statistics(), and set_page_table_entry().

#define prefetch ( X   )     ((void) X)

Definition at line 464 of file ggc-page.c.

Referenced by ggc_collect(), ggc_pop_context(), issue_prefetch_ref(), main(), and sweep_pages().

#define RTL_SIZE ( NSLOTS   )     (sizeof (struct rtx_def) + ((NSLOTS) - 1) * sizeof (rtunion))

Definition at line 164 of file ggc-page.c.

#define save_in_use_p ( __p   )     (save_in_use_p_i (__p->index_by_depth))

Definition at line 468 of file ggc-page.c.

Referenced by clear_marks(), ggc_pop_context(), and ggc_recalculate_in_use_p().

#define save_in_use_p_i ( __i   )     (G.save_in_use[__i])

Definition at line 466 of file ggc-page.c.

Referenced by ggc_pop_context().

#define SCALE (  ) 

Value:

((unsigned long) ((x) < 1024*10 \
      ? (x) \
      : ((x) < 1024*1024*10 \
         ? (x) / 1024 \
         : (x) / (1024*1024))))

Definition at line 1751 of file ggc-page.c.

#define USING_MALLOC_PAGE_GROUPS

Definition at line 65 of file ggc-page.c.

Referenced by alloc_page().

#define VALGRIND_DISCARD (  ) 

Definition at line 35 of file ggc-page.c.


Typedef Documentation

typedef page_entry** page_table[PAGE_L1_SIZE]

Definition at line 286 of file ggc-page.c.


Function Documentation

static void adjust_depth ( void   )  [inline, static]

Definition at line 842 of file ggc-page.c.

References page_entry::context_depth, G, and top.

Referenced by free_page(), and ggc_pop_context().

static struct page_entry* alloc_page ( unsigned  order  )  [static, read]

static void clear_marks ( void   )  [inline, static]

static void clear_page_group_in_use ( page_group group,
char *  page 
) [inline, static]

Definition at line 645 of file ggc-page.c.

References page_group_index().

Referenced by free_page().

static void compute_inverse ( unsigned  order  )  [static]

Definition at line 1227 of file ggc-page.c.

References abort, DIV_MULT, DIV_SHIFT, G, OBJECT_SIZE, and OBJECTS_PER_PAGE.

Referenced by init_ggc().

void debug_print_page_list ( int  order  ) 

Definition at line 571 of file ggc-page.c.

static void free_page ( page_entry entry  )  [inline, static]

void* ggc_alloc ( size_t  size  ) 

static int ggc_allocated_p ( void p  )  const [inline, static]

Definition at line 474 of file ggc-page.c.

References base, G, L1, LOOKUP_L1, LOOKUP_L2, NULL, and size_t.

void ggc_collect ( void   ) 

size_t ggc_get_size ( void p  )  const

int ggc_marked_p ( void p  )  const

void ggc_pop_context ( void   ) 

Definition at line 1409 of file ggc-page.c.

Referenced by c_expand_body(), cse_main(), and genrtl_finish_function().

void ggc_print_statistics ( void   ) 

Definition at line 1759 of file ggc-page.c.

Referenced by finalize().

void ggc_push_context ( void   ) 

Definition at line 1358 of file ggc-page.c.

Referenced by c_expand_body(), cse_main(), and genrtl_finish_function().

static void ggc_recalculate_in_use_p ( page_entry p  )  [static]

Definition at line 1371 of file ggc-page.c.

References abort, BITMAP_SIZE, CEIL, i, OBJECTS_PER_PAGE, and save_in_use_p.

Referenced by ggc_pop_context(), and sweep_pages().

int ggc_set_mark ( void p  )  const

void init_ggc ( void   ) 

Definition at line 1262 of file ggc-page.c.

Referenced by general_init().

static page_entry* lookup_page_table_entry ( void p  )  const [inline, static]

Definition at line 507 of file ggc-page.c.

References base, G, L1, LOOKUP_L1, LOOKUP_L2, and size_t.

Referenced by ggc_free(), ggc_get_size(), ggc_marked_p(), ggc_set_mark(), and zone_get_object_page().

static size_t page_group_index ( char *  allocation,
char *  page 
) [inline, static]

Definition at line 628 of file ggc-page.c.

References G.

Referenced by clear_page_group_in_use(), and set_page_group_in_use().

static void push_by_depth PARAMS ( (page_entry *, unsigned long *)   )  [static]

static void push_depth PARAMS ( (unsigned int)   )  [static]

void debug_print_page_list PARAMS ( (int)   ) 

static void ggc_recalculate_in_use_p PARAMS ( (page_entry *)   )  [static]

static void release_pages PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

static void free_page PARAMS ( (struct page_entry *)   )  [static]

static struct page_entry* alloc_page PARAMS ( (unsigned)   )  [static, read]

static void set_page_group_in_use PARAMS ( (page_group *, char *)   )  [static]

static size_t page_group_index PARAMS ( (char *, char *)   )  [static]

static void set_page_table_entry PARAMS ( (void *, page_entry *)   )  [static]

static int ggc_allocated_p PARAMS ( (const void *)   )  [static]

static void push_by_depth ( page_entry p,
unsigned long s 
) [inline, static]

Definition at line 447 of file ggc-page.c.

References G, and xrealloc().

Referenced by ggc_alloc(), ggc_alloc_stat(), and ggc_pch_read().

static void push_depth ( unsigned int  i  )  [inline, static]

Definition at line 432 of file ggc-page.c.

References G, int, and xrealloc().

Referenced by ggc_alloc(), ggc_alloc_stat(), and move_ptes_to_front().

static void release_pages ( void   )  [static]

static void set_page_group_in_use ( page_group group,
char *  page 
) [inline, static]

Definition at line 637 of file ggc-page.c.

References page_group_index().

Referenced by alloc_page().

static void set_page_table_entry ( void p,
page_entry entry 
) [static]

static void sweep_pages ( void   )  [inline, static]


Variable Documentation

const size_t extra_order_size_table[] [static]

Initial value:

 {
  sizeof (struct tree_decl),
  sizeof (struct tree_list),
  RTL_SIZE (2),     
  RTL_SIZE (10),    
}

Definition at line 171 of file ggc-page.c.

Referenced by init_ggc().

struct globals G [static]

struct { ... } inverse_table[NUM_ORDERS] [static]

unsigned int mult

size_t object_size_table[NUM_ORDERS] [static]

Definition at line 208 of file ggc-page.c.

Referenced by init_ggc().

unsigned objects_per_page_table[NUM_ORDERS] [static]

Definition at line 204 of file ggc-page.c.

Referenced by init_ggc().

unsigned int shift

Definition at line 217 of file ggc-page.c.

Referenced by __gnu_unwind_execute(), _dwarf_decode_s_leb128(), _dwarf_decode_u_leb128(), append_digit(), ar_cfadd128(), ar_cfadd64(), ar_cfix128(), ar_cfix64(), AR_ibits(), ar_ifadd128(), ar_ifadd32(), ar_ifadd64(), ar_ifix128(), ar_ifix32(), ar_ifix64(), AR_ishft(), AR_ishftc(), arm_decode_shift(), arm_gen_constant(), arm_output_mi_thunk(), arm_print_operand(), bfin_valid_add(), build_mask64_2_operands(), c_type_hash(), CGEXP_Expand_Constant_Multiply(), combine_bnp(), compute_a_shift_cc(), compute_a_shift_length(), const_rtx_hash_1(), convert_octal_literal(), cwh_dope_initialize(), cwh_types_get_dope_info(), decAddOp(), decDivideOp(), decFinalize(), decMultiplyOp(), do_jump(), dump_cn_tree(), dwf_add_AT_complex_const(), EBO_Lea_Insertion(), elfNN_ia64_install_value(), elfNN_ia64_relax_ldxmov(), emit_a_shift(), emit_group_load(), emit_group_load_1(), emit_group_store(), expand_mult(), expand_sdiv_pow2(), expand_smod_pow2(), extract_1(), extract_force_align_mem_bit_field(), extract_value(), fei_new_binop_cshift(), fold(), fold_binary(), fold_comparison(), gen_extendhidi2(), gen_extendhisi2(), gen_extendqidi2(), gen_extendqihi2(), gen_extendqisi2(), gen_insv(), gen_zero_extendsidi2(), get_operand_quote(), h8300_adjust_insn_length(), hash1(), ia64_depz_field_mask(), ia64_gen_spec_insn(), imm_sll(), imm_sra(), imm_srl(), insert_1(), insert_normal(), int_log2(), ix86_build_signbit_mask(), ix86_expand_vector_init_general(), java_parse_escape_sequence(), java_read_unicode(), load_register_parameters(), local_dwarf_decode_u_leb128(), lower_cshift(), lower_eoshift(), lower_store_bits(), make_gcov_file_name(), mcore_output_inline_const_forced(), mips_build_shift(), move_block_from_reg(), normalize(), output_a_shift(), output_constructor(), output_shift(), pack_d(), print_instruction(), print_mips16_insn_arg(), print_operand(), process_otr(), rd_OZ(), read_signed_leb128(), read_sleb128(), read_uleb128(), read_unsigned_leb128(), round(), round_for_format(), rs6000_emit_sync(), rs6000_expand_compare_and_swapqhi(), shift_return_value(), simplify_subreg(), sparc_emit_set_const64(), sparc_type_code(), test_ibits_signed(), test_ishft_signed(), test_ishftc_signed(), TI_ASM_Get_Bundle_Reloc_Value(), TI_ASM_Unpack_Inst(), unpack_d(), unw_decode_uleb128(), writevalue(), wrt_OZ(), and xtensa_extend_reg().

unsigned char size_lookup[289] [static]

Initial value:

{
  3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
  4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
}

Definition at line 979 of file ggc-page.c.


Generated on Wed Apr 8 15:34:33 2009 for Open64 by  doxygen 1.5.6