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

Do not use ttyLock in BytecodeTracer::trace

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 20
    • hotspot

      Per [~coleenp]: We should make this a leaf mutex rather than ttyLocker (which does get broken to allow safepoints!) with no_safepoint_check assuming that the printing doesn't safepoint.

      https://github.com/openjdk/jdk/blob/df81b3c66a3b17fc5d10098ce879416affbddd40/src/hotspot/share/interpreter/bytecodeTracer.cpp#L178-L190

          ttyLocker ttyl; // 5065316: keep the following output coherent
          // The ttyLocker also prevents races between two threads
          // trying to use the single instance of BytecodePrinter.
          // Using the ttyLocker prevents the system from coming to
          // a safepoint within this code, which is sensitive to Method*
          // movement.
          //
          // There used to be a leaf mutex here, but the ttyLocker will
          // work just as well, as long as the printing operations never block.
          //
          // We put the locker on the static trace method, not the
          // virtual one, because the clients of this module go through
          // the static method.

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: