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

use C++ exceptions for out of memory situations in the compilers

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • hs25, 9, 10
    • hotspot
    • generic
    • generic

      Handling out of memory errors in the compiler can be cumbersome because there are so many places to check for null return values. One possibility to make this easier would be to use C++ exceptions.

      Right now HotSpot doesn't use C++ exceptions at all. This stems from the fact that C++ compilers weren't good enough (like 15-20 years ago) to handle C++ exceptions on all platforms. This has changed.

      Since HotSpot uses it's own exception throwing mechanism to throw Java exceptions it's very likely not possible to use C++ exception everywhere. Fortunately compilers are well abstracted from the rest of the system and we could use C++ exception only in these modules.

            iveresov Igor Veresov
            twisti Christian Thalinger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: