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

Clean up JNI_ENV and JVMTI_ENV macros

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:

      Description

      A lot tests are trying to serve C and C++ and therefore do things like:

      #ifndef JNI_ENV_ARG

      #ifdef __cplusplus
      #define JNI_ENV_ARG(x, y) y
      #define JNI_ENV_PTR(x) x
      #else
      #define JNI_ENV_ARG(x,y) x, y
      #define JNI_ENV_PTR(x) (*x)
      #endif

      #endif

      This leads to less-than-ideal readable code such as:
      return JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);

      We can clean up these macros since now cpp or c test files are compiled by one or the other languages and this will help readability of the actual tests.

      Other macros to clean up:
        JVMTI_ENV*

      And remove the #ifdef __cplusplus parts.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jcbeyler Jean Christophe Beyler
              Reporter:
              jcbeyler Jean Christophe Beyler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: