• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • core-libs

      Use slot & ~0xFF == 0 instead of (slot & 0xFF) == slot to reduce codeSize.

      The following is a comparison of the bytecode before and after the modification. It can be seen that using slot & ~0xFF == 0 will reduce one iload operation.

      // (slot & 0xFF) == slot
      56: iload_0
      57: sipush 255
      60: iand
      61: iload_0
      62: if_icmpne 71

      // slot & ~0xFF == 0
      56: iload_0
      57: sipush -256
      60: iand
      61: ifne 70

            swen Shaojin Wen
            swen Shaojin Wen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: