This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[java] fix gc descriptors on 64-bit targets


The two early returns didn't set up the TREE_TYPE of the 
descriptor, which resulted in unwanted padding:

        .quad   _ZN4java4lang5Class6class$E
        .quad   2
	.zero	4
        .quad   _ZN4java4lang5Class8finalizeEv

Not commited as obvious because some folks have an allergic
reaction to gotos.

Ok?


r~


	* boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
	(get_boehm_type_descriptor): ... here.  Arrange for the
	TREE_TYPE to get set properly.

Index: java/boehm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/boehm.c,v
retrieving revision 1.11
diff -c -p -d -r1.11 boehm.c
*** boehm.c	2001/04/11 15:51:55	1.11
--- boehm.c	2001/12/21 23:21:12
*************** static void set_bit PARAMS ((unsigned HO
*** 43,56 ****
  			     unsigned HOST_WIDE_INT *,
  			     unsigned int));
  
- /* Compute a procedure-based object descriptor.  We know that our
-    `kind' is 0, and `env' is likewise 0, so we have a simple
-    computation.  From the GC sources:
- 	    (((((env) << LOG_MAX_MARK_PROCS) | (proc_index)) << DS_TAG_BITS) \
- 	    | DS_PROC)
-    Here DS_PROC == 2.  */
- #define PROCEDURE_OBJECT_DESCRIPTOR build_int_2 (2, 0)
- 
  /* Treat two HOST_WIDE_INT's as a contiguous bitmap, with bit 0 being
     the least significant.  This function sets bit N in the bitmap.  */
  static void
--- 43,48 ----
*************** get_boehm_type_descriptor (tree type)
*** 167,173 ****
  
    /* If we have a type of unknown size, use a proc.  */
    if (int_size_in_bytes (type) == -1)
!     return PROCEDURE_OBJECT_DESCRIPTOR;
  
    bit = POINTER_SIZE / BITS_PER_UNIT;
    /* The size of this node has to be known.  And, we only support 32
--- 159,165 ----
  
    /* If we have a type of unknown size, use a proc.  */
    if (int_size_in_bytes (type) == -1)
!     goto procedure_object_descriptor;
  
    bit = POINTER_SIZE / BITS_PER_UNIT;
    /* The size of this node has to be known.  And, we only support 32
*************** get_boehm_type_descriptor (tree type)
*** 187,193 ****
    ubit = (unsigned int) bit;
  
    if (type == class_type_node)
!     return PROCEDURE_OBJECT_DESCRIPTOR;
  
    field = TYPE_FIELDS (type);
    mark_reference_fields (field, &low, &high, ubit,
--- 179,185 ----
    ubit = (unsigned int) bit;
  
    if (type == class_type_node)
!     goto procedure_object_descriptor;
  
    field = TYPE_FIELDS (type);
    mark_reference_fields (field, &low, &high, ubit,
*************** get_boehm_type_descriptor (tree type)
*** 227,233 ****
        value = build_int_2 (low, high);
      }
    else
!     value = PROCEDURE_OBJECT_DESCRIPTOR;
  
    TREE_TYPE (value) = type_for_mode (ptr_mode, 1);
    return value;
--- 219,234 ----
        value = build_int_2 (low, high);
      }
    else
!     {
!       /* Compute a procedure-based object descriptor.  We know that our
! 	 `kind' is 0, and `env' is likewise 0, so we have a simple
! 	 computation.  From the GC sources:
! 	    (((((env) << LOG_MAX_MARK_PROCS) | (proc_index)) << DS_TAG_BITS) \
! 	    | DS_PROC)
! 	 Here DS_PROC == 2.  */
!     procedure_object_descriptor:
!       value = build_int_2 (2, 0);
!     }
  
    TREE_TYPE (value) = type_for_mode (ptr_mode, 1);
    return value;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]