Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Oct 4, 2022

Annotations on array.get and array.set were not being counted and the code could
generally be simplified since count already ignores types that don't need to
be counted.

Annotations on array.get and array.set were not being counted and the code could
generally be simplified since `count` already ignores types that don't need to
be counted.
@tlively tlively requested a review from kripken October 4, 2022 23:46
@tlively
Copy link
Member Author

tlively commented Oct 4, 2022

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

if (auto* call = curr->dynCast<CallIndirect>()) {
counts.note(call->heapType);
} else if (auto* call = curr->dynCast<CallRef>()) {
if (call->isReturn && call->target->type.isFunction()) {
Copy link
Member

Choose a reason for hiding this comment

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

The isReturn change makes us count in the way that is correct in the spec but we haven't yet moved to, I think? But the idea is that there's no harm to doing that for now, and eventually this code will become right in binaryen as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

We emit a type annotation for non-return call_ref as well since #5079, so this is necessary for correctness.

@tlively tlively mentioned this pull request Oct 5, 2022
@tlively tlively merged commit 5b0977d into main Oct 5, 2022
@tlively tlively deleted the fix-type-counts branch October 5, 2022 02:51
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