diff options
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/java/class.c | 5 | ||||
-rw-r--r-- | gcc/java/constants.c | 9 | ||||
-rw-r--r-- | gcc/java/decl.c | 4 | ||||
-rw-r--r-- | gcc/java/expr.c | 2 | ||||
-rw-r--r-- | gcc/java/java-tree.h | 13 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 6 | ||||
-rw-r--r-- | gcc/java/jcf-reader.c | 11 | ||||
-rw-r--r-- | gcc/java/jcf.h | 2 |
9 files changed, 39 insertions, 32 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index b6b6c19d2ce..70991cc4693 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,24 @@ 2014-05-17 Trevor Saunders <tsaunders@mozilla.com> + * class.c (add_method_1): Adjust. + (java_treetreehash_new): Likewise. + * constants.c (set_constant_entry): Likewise. + (cpool_for_class): Likewise. + * decl.c (make_binding_level): Likewise. + (java_dup_lang_specific_decl): Likewise. + * expr.c (add_type_assertion): Likewise. + * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. + (lang_decl): don't use variable_size gty attribute. + (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. + (lang_type): Don't use variable_size gty attribute. + * jcf-parse.c (java_parse_file): Adjust. + (process_zip_dir): Likewise. + * jcf.h: Remove usage of variable_size gty attribute. + * jcf-reader.c (jcf_parse_constant_pool): Adjust. + (jcf_parse_bootstrap_methods): Likewise. + +2014-05-17 Trevor Saunders <tsaunders@mozilla.com> + * constants.c (set_constant_entry): Adjust. 2014-05-06 Richard Sandiford <r.sandiford@uk.ibm.com> diff --git a/gcc/java/class.c b/gcc/java/class.c index bbe7c863177..a1e4a86033b 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -764,8 +764,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) fndecl = build_decl (input_location, FUNCTION_DECL, name, method_type); DECL_CONTEXT (fndecl) = this_class; - DECL_LANG_SPECIFIC (fndecl) - = ggc_alloc_cleared_lang_decl(sizeof (struct lang_decl)); + DECL_LANG_SPECIFIC (fndecl) = ggc_cleared_alloc<struct lang_decl> (); DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC; /* Initialize the static initializer test table. */ @@ -3194,7 +3193,7 @@ java_treetreehash_new (htab_t ht, tree t) e = htab_find_slot_with_hash (ht, t, hv, INSERT); if (*e == NULL) { - tthe = ggc_alloc_cleared_treetreehash_entry (); + tthe = ggc_cleared_alloc<treetreehash_entry> (); tthe->key = t; *e = tthe; } diff --git a/gcc/java/constants.c b/gcc/java/constants.c index c0295e9a2fa..2e317c91bb6 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -46,11 +46,8 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value) if (cpool->data == NULL) { cpool->capacity = 100; - cpool->tags = (uint8 *) ggc_internal_cleared_alloc (sizeof (uint8) - * cpool->capacity); - cpool->data = ggc_alloc_cleared_vec_cpool_entry (sizeof - (union cpool_entry), - cpool->capacity); + cpool->tags = ggc_cleared_vec_alloc<uint8> (cpool->capacity); + cpool->data = ggc_cleared_vec_alloc<cpool_entry> (cpool->capacity); cpool->count = 1; } if (index >= cpool->capacity) @@ -338,7 +335,7 @@ cpool_for_class (tree klass) if (cpool == NULL) { - cpool = ggc_alloc_cleared_CPool (); + cpool = ggc_cleared_alloc<CPool> (); TYPE_CPOOL (klass) = cpool; } return cpool; diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 53d6f89b2d5..841fb4cbad1 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1307,7 +1307,7 @@ static struct binding_level * make_binding_level (void) { /* NOSTRICT */ - return ggc_alloc_cleared_binding_level (); + return ggc_cleared_alloc<binding_level> (); } void @@ -1646,7 +1646,7 @@ java_dup_lang_specific_decl (tree node) return; lang_decl_size = sizeof (struct lang_decl); - x = ggc_alloc_lang_decl (lang_decl_size); + x = ggc_alloc<struct lang_decl> (); memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size); DECL_LANG_SPECIFIC (node) = x; } diff --git a/gcc/java/expr.c b/gcc/java/expr.c index e66bdb152ab..51b8f0f7c8f 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -471,7 +471,7 @@ add_type_assertion (tree klass, int assertion_code, tree op1, tree op2) if (*as_pp) return; - *as_pp = ggc_alloc_type_assertion (); + *as_pp = ggc_alloc<type_assertion> (); **(type_assertion **)as_pp = as; } diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 806d2d7a54d..e832f44fb0f 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -699,8 +699,7 @@ union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"), #define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \ if (DECL_LANG_SPECIFIC (T) == NULL) \ { \ - DECL_LANG_SPECIFIC ((T)) \ - = ggc_alloc_cleared_lang_decl (sizeof (struct lang_decl)); \ + DECL_LANG_SPECIFIC ((T)) = ggc_cleared_alloc<struct lang_decl> (); \ DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \ } @@ -808,7 +807,7 @@ struct GTY(()) lang_decl_var { enum lang_decl_desc {LANG_DECL_FUNC, LANG_DECL_VAR}; -struct GTY((variable_size)) lang_decl { +struct GTY(()) lang_decl { enum lang_decl_desc desc; union lang_decl_u { @@ -825,8 +824,7 @@ struct GTY((variable_size)) lang_decl { #define TYPE_CPOOL_DATA_REF(T) (TYPE_LANG_SPECIFIC (T)->cpool_data_ref) #define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \ if (TYPE_LANG_SPECIFIC ((T)) == NULL) \ - TYPE_LANG_SPECIFIC ((T)) \ - = ggc_alloc_cleared_lang_type (sizeof (struct lang_type)); + TYPE_LANG_SPECIFIC ((T)) = ggc_cleared_alloc<struct lang_type> (); #define TYPE_DUMMY(T) (TYPE_LANG_SPECIFIC(T)->dummy_class) @@ -869,10 +867,7 @@ typedef struct GTY(()) method_entry_d { } method_entry; -/* FIXME: the variable_size annotation here is needed because these types are - variable-sized in some other frontends. Due to gengtype deficiency the GTY - options of such types have to agree across all frontends. */ -struct GTY((variable_size)) lang_type { +struct GTY(()) lang_type { tree signature; struct JCF *jcf; struct CPool *cpool; diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 748f7c3e061..7425b4e05e3 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -1905,7 +1905,7 @@ java_parse_file (void) if (magic == 0xcafebabe) { CLASS_FILE_P (node) = 1; - current_jcf = ggc_alloc_cleared_JCF (); + current_jcf = ggc_cleared_alloc<JCF> (); current_jcf->read_state = finput; current_jcf->filbuf = jcf_filbuf_from_stdio; jcf_parse (current_jcf); @@ -1922,7 +1922,7 @@ java_parse_file (void) } else if (magic == (JCF_u4)ZIPMAGIC) { - main_jcf = ggc_alloc_cleared_JCF (); + main_jcf = ggc_cleared_alloc<JCF> (); main_jcf->read_state = finput; main_jcf->filbuf = jcf_filbuf_from_stdio; linemap_add (line_table, LC_ENTER, false, filename, 0); @@ -2178,7 +2178,7 @@ process_zip_dir (FILE *finput) class_name = compute_class_name (zdir); file_name = XNEWVEC (char, zdir->filename_length+1); - jcf = ggc_alloc_cleared_JCF (); + jcf = ggc_cleared_alloc<JCF> (); strncpy (file_name, class_name_in_zip_dir, zdir->filename_length); file_name [zdir->filename_length] = '\0'; diff --git a/gcc/java/jcf-reader.c b/gcc/java/jcf-reader.c index 10def13ca96..ed175cb24c1 100644 --- a/gcc/java/jcf-reader.c +++ b/gcc/java/jcf-reader.c @@ -341,7 +341,8 @@ jcf_parse_constant_pool (JCF* jcf) int i, n; JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf)); jcf->cpool.tags = (uint8 *) ggc_alloc_atomic (JPOOL_SIZE (jcf)); - jcf->cpool.data = ggc_alloc_cpool_entry (sizeof (jword) * JPOOL_SIZE (jcf)); + jcf->cpool.data = (cpool_entry *) ggc_internal_cleared_alloc + (sizeof (jword) * JPOOL_SIZE (jcf)); jcf->cpool.tags[0] = 0; #ifdef HANDLE_START_CONSTANT_POOL HANDLE_START_CONSTANT_POOL (JPOOL_SIZE (jcf)); @@ -551,9 +552,7 @@ jcf_parse_bootstrap_methods (JCF* jcf, int attribute_length ATTRIBUTE_UNUSED) int i; uint16 num_methods = JCF_readu2 (jcf); jcf->bootstrap_methods.count = num_methods; - jcf->bootstrap_methods.methods - = (bootstrap_method *) ggc_alloc_atomic (num_methods - * sizeof (bootstrap_method)); + jcf->bootstrap_methods.methods = ggc_vec_alloc<bootstrap_method> (num_methods); #ifdef HANDLE_START_BOOTSTRAP_METHODS HANDLE_START_BOOTSTRAP_METHODS (jcf, num_methods); #endif @@ -564,9 +563,7 @@ jcf_parse_bootstrap_methods (JCF* jcf, int attribute_length ATTRIBUTE_UNUSED) bootstrap_method *m = &jcf->bootstrap_methods.methods[i]; m->method_ref = JCF_readu2 (jcf); m->num_arguments = JCF_readu2 (jcf); - m->bootstrap_arguments - = (unsigned *) ggc_alloc_atomic (m->num_arguments - * sizeof (unsigned)); + m->bootstrap_arguments = ggc_vec_alloc<unsigned> (m->num_arguments); for (j = 0; j < m->num_arguments; j++) m->bootstrap_arguments[j] = JCF_readu2 (jcf); } diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h index 8aa077e4c87..0988d658dcc 100644 --- a/gcc/java/jcf.h +++ b/gcc/java/jcf.h @@ -65,7 +65,7 @@ jcf_open_exact_case (const char* filename, int oflag); struct JCF; typedef int (*jcf_filbuf_t) (struct JCF*, int needed); -union GTY((variable_size)) cpool_entry { +union GTY(()) cpool_entry { jword GTY ((tag ("0"))) w; tree GTY ((tag ("1"))) t; }; |