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

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

XMLWordPrintable

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


      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; }

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

              Created:
              Updated:
              Resolved: