RFR: 8187033: [PPC] Imporve performance of ObjectStreamClass.getClassDataLayout()

Peter Levart peter.levart at gmail.com
Mon Sep 4 08:49:23 UTC 2017


Ops, pressed SEND to quickly...

On 09/04/2017 10:45 AM, Peter Levart wrote:
>
>
>      ClassDataSlot[] getClassDataLayout() throws InvalidClassException {
>          ClassDataSlot[] slots = dataLayout;
>          if (slots == null) {
>              ClassDataSlot[] slots = getClassDataLayout0();
>              VarHandle.fullFence();
>              dataLayout = slots;
>          }
>          return slots;
>      }
>
>

Correct code (forgot to remove the 2nd declaration of local field):

      ClassDataSlot[] getClassDataLayout() throws InvalidClassException {
          ClassDataSlot[] slots = dataLayout;
          if (slots == null) {
              slots = getClassDataLayout0();
              VarHandle.fullFence();
              dataLayout = slots;
          }
          return slots;
      }


Peter


More information about the core-libs-dev mailing list