Unreachable code in nmethod.cpp inside #ifdef DEBUG

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 16, 17
    • Component/s: hotspot
    • None
    • b16
    • 14
    • b19

      HotSpot doesn't define the DEBUG macro, so the assert assert_lock_strong call is not included even in a debug build.

      The code should be changed to #ifdef ASSERT instead.

      bool nmethod::try_transition(int new_state_int) {
        signed char new_state = new_state_int;
      #ifdef DEBUG
        if (new_state != unloaded) {
          assert_lock_strong(CompiledMethod_lock);
        }
      #endif

            Assignee:
            Robbin Ehn
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: