Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6787106

Hotspot 32 bit build fails on platforms having different definitions for intptr_t & int32_t

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • hs15
    • 7
    • hotspot
    • None
    • b01
    • x86
    • os_x

        On 32 bit Mac OS, intptr_t is typedefed as long and int32_t is typedefed as int. This is not true on other platforms such as Solaris & most of Linux distributions including BSD. In some hotspot code, we rely on the assumption that intptr_t & int32_t are same so cast from one to another automatically works. This will certainly fail on platforms which does not have that assumption.

        Here is an example. In assembler_x86.hpp, we have the following definitions in class MacroAssembler:

        void movptr(Address dst, intptr_t src);
        void movptr(Address dst, Reigster src); (Register is defined as RegisterImpl*)

        In the places we want to clear the destination address, we simply call movptr(dest, (int32_t)NULL); the cast is necessary to make the compiler to resolve the ambiguity which we believe it will pick up the intptr_t version. This will break on platforms such as Mac OS X since the cast still hasn't made it clear which one to choose.

              xlu Xiaobin Lu (Inactive)
              xlu Xiaobin Lu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: