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

Refine the GC frame ref flag commit #2822

Conversation

wenyongh
Copy link
Contributor

No description provided.

p->type = 0;
if (aot_frame->comp_ctx->enable_gc) {
p->ref = 0;
p->committed_ref = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reset to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

committed_ref == 1 means that the ref flag was already committed and the committed value is 0, as p->ref + == p->committed_ref, no need to commit again next time.

And when translating the else branch, the status of frame refs from current frame_sp is same as translating the if branch. Note that for if opcode, AOT code will jump to if branch or else branch, here the p->committed_ref should be 1.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator

@xujuntwt95329 xujuntwt95329 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 238208a into bytecodealliance:dev/gc_refactor Nov 27, 2023
378 checks passed
@wenyongh wenyongh deleted the dev/refine_gc_frame_ref_commit branch December 24, 2023 12:29
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.

2 participants