This commit introduces C++ wrapper classes for Java heap objects.
[cacao.git] / src / vmcore / linker.c
index 49cf74a678c4a805d048e62745ffbb678050960e..eb32c0590d4ffece4a475262a9172684b6efb63e 100644 (file)
@@ -106,22 +106,6 @@ static bool linker_addinterface(classinfo *c, classinfo *ic);
 static s4 class_highestinterface(classinfo *c);
 
 
-/* dummy structures for alinment checks ***************************************/
-
-typedef struct dummy_alignment_long_t   dummy_alignment_long_t;
-typedef struct dummy_alignment_double_t dummy_alignment_double_t;
-
-struct dummy_alignment_long_t {
-       int32_t i;
-       int64_t l;
-};
-
-struct dummy_alignment_double_t {
-       int32_t i;
-       double  d;
-};
-
-
 /* linker_init *****************************************************************
 
    Initializes the linker subsystem and links classes required for the
@@ -133,35 +117,6 @@ void linker_preinit(void)
 {
        TRACESUBSYSTEMINITIALIZATION("linker_preinit");
 
-       /* Check for if alignment for long and double matches what we
-          assume for the current architecture. */
-
-#if defined(__I386__) || (defined(__ARM__) && !defined(__ARM_EABI__)) || (defined(__POWERPC__) && defined(__DARWIN__)) || defined(__M68K__)
-       /* Define a define here which is later checked when we use this
-          offset. */
-
-# define LINKER_ALIGNMENT_LONG_DOUBLE 4
-
-       if (OFFSET(dummy_alignment_long_t, l) != 4)
-               vm_abort("linker_preinit: long alignment is different from what assumed: %d != %d",
-                                OFFSET(dummy_alignment_long_t, l), 4);
-
-       if (OFFSET(dummy_alignment_double_t, d) != 4)
-               vm_abort("linker_preinit: double alignment is different from what assumed: %d != %d",
-                                OFFSET(dummy_alignment_double_t, d), 4);
-#else
-
-# define LINKER_ALIGNMENT_LONG_DOUBLE 8
-
-       if (OFFSET(dummy_alignment_long_t, l) != 8)
-               vm_abort("linker_preinit: long alignment is different from what assumed: %d != %d",
-                                OFFSET(dummy_alignment_long_t, l), 8);
-
-       if (OFFSET(dummy_alignment_double_t, d) != 8)
-               vm_abort("linker_preinit: double alignment is different from what assumed: %d != %d",
-                                OFFSET(dummy_alignment_double_t, d), 8);
-#endif
-
        /* Reset interface index. */
 
        interfaceindex = 0;
@@ -917,29 +872,7 @@ static classinfo *link_class_intern(classinfo *c)
                
                if (!(f->flags & ACC_STATIC)) {
                        dsize = descriptor_typesize(f->parseddesc);
-
-#if defined(__I386__) || (defined(__ARM__) && !defined(__ARM_EABI__)) || (defined(__POWERPC__) && defined(__DARWIN__)) || defined(__M68K__)
-                       /* On some architectures and configurations we need to
-                          align long (int64_t) and double fields to 4-bytes to
-                          match what GCC does for struct members.  We must do the
-                          same as GCC here because the offsets in native header
-                          structs like java_lang_Double must match the offsets of
-                          the Java fields (eg. java.lang.Double.value). */
-
-# if LINKER_ALIGNMENT_LONG_DOUBLE != 4
-#  error alignment of long and double is not 4
-# endif
-
-                       c->instancesize = MEMORY_ALIGN(c->instancesize, 4);
-#else
-
-# if LINKER_ALIGNMENT_LONG_DOUBLE != 8
-#  error alignment of long and double is not 8
-# endif
-
                        c->instancesize = MEMORY_ALIGN(c->instancesize, dsize);
-#endif
-
                        f->offset = c->instancesize;
                        c->instancesize += dsize;
                }