groovy
  1. groovy
  2. GROOVY-5105

Avoid temporary bytecode variable on simple declaration assignments

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta-1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The following code :

      void m() { int i=0 }
      

      will generate bytecode like this:

      ICONST_0
      ISTORE 1
      ILOAD 1
      ISTORE 2
      ILOAD 2
      

      although everything could "fit" into a single slot :

      ICONST_0
      ISTORE 1
      ILOAD 1
      

        Activity

        CÚdric Champeau made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.9-beta-5 [ 17925 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            CÚdric Champeau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: