Groovy
  1. Groovy
  2. GROOVY-5105

Avoid temporary bytecode variable on simple declaration assignments

    Details

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

      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 created issue -
        Cédric Champeau made changes -
        Field Original Value New Value
        Fix Version/s 1.9-beta-5 [ 17925 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734029 ] Default workflow, editable Closed status [ 12745857 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12971573 ] Default workflow, editable Closed status [ 12979364 ]

          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:

              Development