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

AbstractCompiler marks const in wrong position for is_c1/is_c2/is_jvmci

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 11, 16, 17
    • 17
    • hotspot
    • b05
    • generic

    Description


      class AbstractCompiler : public CHeapObj<mtCompiler> {
      ...
        // Compiler type queries.
        const bool is_c1() { return _type == compiler_c1; }
        const bool is_c2() { return _type == compiler_c2; }
        const bool is_jvmci() { return _type == compiler_jvmci; }
        const CompilerType type() { return _type; }


      it doesn't make any sense to return a const scalar in this case.
      I think the original intention is to mark those member functions const.
        bool is_c1() const { return _type == compiler_c1; }

      Attachments

        Issue Links

          Activity

            People

              xliu Xin Liu
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: