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

Avoid allocating register in fast_lock()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • None
    • b10
    • x86, x86_64
    • generic

      In x86's C2MacroAssembler::fast_lock(), we are never really using the cx1Reg register, except in the DiagnoseSyncOnValueBasedClasses path, where we can just as well use the scrReg register.

      What's worse, in x86_32.ad, we don't allocate the cx1 register and pass noreg, so the DiagnoseSyncOnValueBasedClasses would be broken on x86_32.

      We can simply avoid allocating that extra register (which may help performance under register pressure), and use scr in DiagnoseSyncOnValueBasedClasses.

            rkennke Roman Kennke
            rkennke Roman Kennke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: