diff options
author | Kenneth Zadeck <zadeck@naturalbridge.com> | 2014-05-06 16:25:05 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2014-05-06 16:25:05 +0000 |
commit | 807e902eea17f3132488c256c963823976b2348c (patch) | |
tree | e5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/java | |
parent | 6122336c832dc4dfedc49279549caddce86306ff (diff) | |
download | gcc-807e902eea17f3132488c256c963823976b2348c.zip gcc-807e902eea17f3132488c256c963823976b2348c.tar.gz gcc-807e902eea17f3132488c256c963823976b2348c.tar.bz2 |
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/boehm.c | 22 | ||||
-rw-r--r-- | gcc/java/expr.c | 7 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 8 |
3 files changed, 19 insertions, 18 deletions
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c index ddc424b..191ab86 100644 --- a/gcc/java/boehm.c +++ b/gcc/java/boehm.c @@ -32,8 +32,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "java-tree.h" #include "parse.h" #include "diagnostic-core.h" +#include "wide-int.h" -static void mark_reference_fields (tree, double_int *, unsigned int, +static void mark_reference_fields (tree, wide_int *, unsigned int, int *, int *, int *, HOST_WIDE_INT *); /* A procedure-based object descriptor. We know that our @@ -47,7 +48,7 @@ static void mark_reference_fields (tree, double_int *, unsigned int, /* Recursively mark reference fields. */ static void mark_reference_fields (tree field, - double_int *mask, + wide_int *mask, unsigned int ubit, int *pointer_after_end, int *all_bits_set, @@ -107,7 +108,7 @@ mark_reference_fields (tree field, bits for all words in the record. This is conservative, but the size_words != 1 case is impossible in regular java code. */ for (i = 0; i < size_words; ++i) - *mask = (*mask).set_bit (ubit - count - i - 1); + *mask = wi::set_bit (*mask, ubit - count - i - 1); if (count >= ubit - 2) *pointer_after_end = 1; @@ -136,16 +137,15 @@ get_boehm_type_descriptor (tree type) int last_set_index = 0; HOST_WIDE_INT last_view_index = -1; int pointer_after_end = 0; - double_int mask; tree field, value, value_type; - mask = double_int_zero; - /* If the GC wasn't requested, just use a null pointer. */ if (! flag_use_boehm_gc) return null_pointer_node; value_type = java_type_for_mode (ptr_mode, 1); + wide_int mask = wi::zero (TYPE_PRECISION (value_type)); + /* If we have a type of unknown size, use a proc. */ if (int_size_in_bytes (type) == -1) goto procedure_object_descriptor; @@ -194,22 +194,22 @@ get_boehm_type_descriptor (tree type) that we don't have to emit reflection data for run time marking. */ count = 0; - mask = double_int_zero; + mask = wi::zero (TYPE_PRECISION (value_type)); ++last_set_index; while (last_set_index) { if ((last_set_index & 1)) - mask = mask.set_bit (log2_size + count); + mask = wi::set_bit (mask, log2_size + count); last_set_index >>= 1; ++count; } - value = double_int_to_tree (value_type, mask); + value = wide_int_to_tree (value_type, mask); } else if (! pointer_after_end) { /* Bottom two bits for bitmap mark type are 01. */ - mask = mask.set_bit (0); - value = double_int_to_tree (value_type, mask); + mask = wi::set_bit (mask, 0); + value = wide_int_to_tree (value_type, mask); } else { diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 69f6819c..e66bdb1 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -46,6 +46,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "ggc.h" #include "tree-iterator.h" #include "target.h" +#include "wide-int.h" static void flush_quick_stack (void); static void push_value (tree); @@ -1051,7 +1052,7 @@ build_newarray (int atype_value, tree length) tree prim_type = decode_newarray_type (atype_value); tree type = build_java_array_type (prim_type, - tree_fits_shwi_p (length) == INTEGER_CST + tree_fits_shwi_p (length) ? tree_to_shwi (length) : -1); /* Pass a reference to the primitive type class and save the runtime @@ -1260,7 +1261,7 @@ expand_java_pushc (int ival, tree type) else if (type == float_type_node || type == double_type_node) { REAL_VALUE_TYPE x; - REAL_VALUE_FROM_INT (x, ival, 0, TYPE_MODE (type)); + real_from_integer (&x, TYPE_MODE (type), ival, SIGNED); value = build_real (type, x); } else @@ -1717,7 +1718,7 @@ build_field_ref (tree self_value, tree self_class, tree name) tree field_offset = byte_position (field_decl); if (! page_size) page_size = size_int (4096); - check = ! INT_CST_LT_UNSIGNED (field_offset, page_size); + check = !tree_int_cst_lt (field_offset, page_size); } if (base_type != TREE_TYPE (self_value)) diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index afe35f0..748f7c3 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -41,6 +41,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "cgraph.h" #include "bitmap.h" #include "target.h" +#include "wide-int.h" #ifdef HAVE_LOCALE_H #include <locale.h> @@ -1041,14 +1042,13 @@ get_constant (JCF *jcf, int index) case CONSTANT_Long: { unsigned HOST_WIDE_INT num; - double_int val; num = JPOOL_UINT (jcf, index); - val = double_int::from_uhwi (num).llshift (32, 64); + wide_int val = wi::lshift (wide_int::from (num, 64, SIGNED), 32); num = JPOOL_UINT (jcf, index + 1); - val |= double_int::from_uhwi (num); + val |= num; - value = double_int_to_tree (long_type_node, val); + value = wide_int_to_tree (long_type_node, val); break; } |