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

ADLC: pass ASSERT and PRODUCT flags

XMLWordPrintable

    • b20

        src/hotspot/share/adlc/main.cpp parses in the -D inputs and sets AD.set_preproc_def(flag, def)
        And then when the AD file is parsed, it checks ArchDesc::get_preproc_def to see if it should include the relevant code section or not.
        You can for example find #ifdef _LP64 all over the AD files.

        The flags are set in make/hotspot/gensrc/GensrcAdlc.gmk

        ADLC_CFLAGS += -DASSERT
        ...
        ifeq ($(call isTargetOs, linux), true)
          ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1

        We never pass ASSERT or PRODUCT to ADLCFLAGS, hence we cannot use #ifdef with those flags (or rather they are always undefined).

        We should fix this, so that the flags can be used consistently with all other C2 code. For example, I would like to be able to make some rules in AD files available only in debug (ASSERT) mode.

              epeter Emanuel Peter
              epeter Emanuel Peter
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: