Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape analysis #4

Open
wbbradley opened this issue Jun 8, 2019 · 0 comments
Open

Escape analysis #4

wbbradley opened this issue Jun 8, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@wbbradley
Copy link
Owner

Escape analysis

Goal: Implement escape analysis in order to avoid unnecessary heap allocations.

After translation, before gen phase, add a phase to annotate heap-exprs.

Escape phase

  1. Build a usage graph of exprs.
  2. Find all exprs that have usage links to return statements or towards heap-marked exprs.
  3. For any tuples that link to return statements, mark them as heap.
  4. Goto 2 until no more exprs are marked.

During gen phase, pay attention to heap-marks on tuples.

@wbbradley wbbradley added the enhancement New feature or request label Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant