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

Fix Shared-memory access counting #29

Merged
merged 1 commit into from
Apr 20, 2021
Merged

Conversation

LukeXuan
Copy link
Collaborator

This pull request should fix issue #14. The new algorithm for counting shared-memory access can be summarized as follows,

  1. +1 whenever GetLValue in ResolveAsLValue
  2. +1 whenver GetRValue in ResolveAsRValue
  3. +1 whenver UnaryOp.Dereference in ResolveAsRValue
  4. Resolution of LValue caused by UnaryOp.AddressOf doesn't count as a memory reference. This is dealt after the recursion.

In addition, the shared-memory access counting for method call arguments are separate from the rest of the statement. The reasoning is that a method call is translated into two separate next routines for call and return.

@ghost
Copy link

ghost commented Apr 17, 2021

CLA assistant check
All CLA requirements met.

@LukeXuan LukeXuan merged commit 6478f9c into main Apr 20, 2021
@LukeXuan LukeXuan deleted the fix/memory-access-count branch April 20, 2021 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant