OSDN Git Service

* lang.c (flag_hash_synchronization): New global.
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Mar 2000 18:32:45 +0000 (18:32 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Mar 2000 18:32:45 +0000 (18:32 +0000)
(lang_f_options): Added `hash-synchronization'.
* lang-options.h: Mention -fhash-synchronization.
* java-tree.h (flag_hash_synchronization): Declare.
* expr.c (java_lang_expand_expr): Only push `sync_info' value when
hash table synchronization is disabled.
* decl.c (init_decl_processing): Only push `sync_info' value when
hash table synchronization is disabled.
* class.c (make_class_data): Only push `sync_info' field when hash
table synchronization is disabled.  Removed dead code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32593 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/class.c
gcc/java/decl.c
gcc/java/expr.c
gcc/java/java-tree.h
gcc/java/lang-options.h
gcc/java/lang.c

index 56435eb..23575cf 100644 (file)
@@ -1,5 +1,18 @@
 2000-03-16  Tom Tromey  <tromey@cygnus.com>
 
+       * lang.c (flag_hash_synchronization): New global.
+       (lang_f_options): Added `hash-synchronization'.
+       * lang-options.h: Mention -fhash-synchronization.
+       * java-tree.h (flag_hash_synchronization): Declare.
+       * expr.c (java_lang_expand_expr): Only push `sync_info' value when
+       hash table synchronization is disabled.
+       * decl.c (init_decl_processing): Only push `sync_info' value when
+       hash table synchronization is disabled.
+       * class.c (make_class_data): Only push `sync_info' field when hash
+       table synchronization is disabled.  Removed dead code.
+
+2000-03-16  Tom Tromey  <tromey@cygnus.com>
+
        * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
 
 2000-03-15  Tom Tromey  <tromey@cygnus.com>
index aea3dfd..99d38e0 100644 (file)
@@ -1373,7 +1373,8 @@ make_class_data (type)
   START_RECORD_CONSTRUCTOR (temp, object_type_node);
   PUSH_FIELD_VALUE (temp, "vtable",
                    build1 (ADDR_EXPR, dtable_ptr_type, class_dtable_decl));
-  PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node);
+  if (! flag_hash_synchronization)
+    PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node);
   FINISH_RECORD_CONSTRUCTOR (temp);
   START_RECORD_CONSTRUCTOR (cons, class_type_node);
   PUSH_SUPER_VALUE (cons, temp);
index a0c3734..bd2514a 100644 (file)
@@ -349,7 +349,8 @@ tree double_zero_node;
 tree empty_stmt_node;
 
 /* Nodes for boolean constants TRUE and FALSE. */
-tree boolean_true_node, boolean_false_node;
+tree boolean_true_node;
+tree boolean_false_node;
 
 tree TYPE_identifier_node;
 tree init_identifier_node;
@@ -413,7 +414,8 @@ push_promoted_type (name, actual_type)
 }
 
 /* Nodes for integer constants.  */
-tree integer_two_node, integer_four_node;
+tree integer_two_node;
+tree integer_four_node;
 tree integer_negative_one_node;
 
 /* Return a definition for a builtin function named NAME and whose data type
@@ -629,8 +631,9 @@ init_decl_processing ()
   /* This isn't exactly true, but it is what we have in the source.
      There is an unresolved issue here, which is whether the vtable
      should be marked by the GC.  */
-  PUSH_FIELD (object_type_node, field, "sync_info",
-             build_pointer_type (object_type_node));
+  if (! flag_hash_synchronization)
+    PUSH_FIELD (object_type_node, field, "sync_info",
+               build_pointer_type (object_type_node));
   for (t = TYPE_FIELDS (object_type_node); t != NULL_TREE; t = TREE_CHAIN (t))
     FIELD_PRIVATE (t) = 1;
   FINISH_RECORD (object_type_node);
@@ -1082,6 +1085,7 @@ pushdecl (x)
 
   return x;
 }
+
 void
 pushdecl_force_head (x)
      tree x;
@@ -1125,8 +1129,7 @@ getdecls ()
 
 /* Create a new `struct binding_level'.  */
 
-static
-struct binding_level *
+static struct binding_level *
 make_binding_level ()
 {
   /* NOSTRICT */
index 86c731f..f92fc8d 100644 (file)
@@ -79,7 +79,7 @@ static tree build_java_throw_out_of_bounds_exception PARAMS ((tree));
 static tree build_java_check_indexed_type PARAMS ((tree, tree)); 
 static tree java_array_data_offset PARAMS ((tree)); 
 static tree case_identity PARAMS ((tree, tree)); 
+
 static tree operand_type[59];
 extern struct obstack permanent_obstack;
 
@@ -1996,7 +1996,8 @@ java_lang_expand_expr (exp, target, tmode, modifier)
            PUSH_FIELD_VALUE (temp, "vtable",
                              null_pointer_node /* FIXME */
                              );
-           PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node);
+           if (! flag_hash_synchronization)
+             PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node);
            FINISH_RECORD_CONSTRUCTOR (temp);
            START_RECORD_CONSTRUCTOR (value, array_type);
            PUSH_SUPER_VALUE (value, temp);
index 9e55070..96bfe4f 100644 (file)
@@ -155,6 +155,10 @@ extern int flag_use_divide_subroutine;
 /* When non zero, generate code for the Boehm GC.  */
 extern int flag_use_boehm_gc;
 
+/* When non zero, assume the runtime uses a hash table to map an
+   object to its synchronization structure.  */
+extern int flag_hash_synchronization;
+
 /* The Java .class file that provides main_class;  the main input file. */
 extern struct JCF *current_jcf;
 
index 43bf70e..44f9ea4 100644 (file)
@@ -1,5 +1,5 @@
 /* Switch definitions for the GNU compiler for the Java(TM) language.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -34,6 +34,7 @@ DEFINE_LANG_NAME ("Java")
   { "-femit-class-file", "" },
   { "-femit-class-files", "Dump class files to <name>.class" },
   { "-fuse-boehm-gc", "Generate code for Boehm GC" },
+  { "-fhash-synchronization", "Don't put synchronization structure in each object" },
 #if ! USE_CPPLIB
   { "-MD", "Print dependencies to FILE.d" },
   { "-MMD", "Print dependencies to FILE.d" },
index d6c808a..ad1b826 100644 (file)
@@ -113,6 +113,10 @@ int flag_use_divide_subroutine = 1;
 /* When non zero, generate code for the Boehm GC.  */
 int flag_use_boehm_gc = 0;
 
+/* When non zero, assume the runtime uses a hash table to map an
+   object to its synchronization structure.  */
+int flag_hash_synchronization;
+
 /* From gcc/flags.h, and indicates if exceptions are turned on or not.  */
 
 extern int flag_new_exceptions;
@@ -130,7 +134,8 @@ lang_f_options[] =
   {"emit-class-file", &flag_emit_class_files, 1},
   {"emit-class-files", &flag_emit_class_files, 1},
   {"use-divide-subroutine", &flag_use_divide_subroutine, 1},
-  {"use-boehm-gc", &flag_use_boehm_gc, 1}
+  {"use-boehm-gc", &flag_use_boehm_gc, 1},
+  {"hash-synchronization", &flag_hash_synchronization, 1}
 };
 
 JCF *current_jcf;