Skip to content

Optimising Shadow Variables #24

Description

@DavePearce

Currently, the use of shadow variables is suboptimal. Consider this example:

function f(int x) -> (int r):
    return x + 1

which generates the following JavaScript:

function f_I(/*int*/ x)// -> (/*int*/ r)
{
    // create shadow variables
    var $x = x;
    // function or method body
    var r = x + 1;
    // restore shadow variables
    x = $x;
    return r;
}

Here, we don't really need the $x shadow at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions