Skip to content

Conversation

@DuncanUszkay1
Copy link
Contributor

@DuncanUszkay1 DuncanUszkay1 commented Sep 6, 2020

Before we had first class functions, we used this indexArg local in compileCallIndirect. From my understanding, this name no longer makes sense because it is not in fact an index into the function table but actually a pointer into a block of memory which contains that index.

I picked the name functionInstance but I'm not terribly attached to it, I just think that indexArg is the wrong name (Unless I'm misreading the code of course)

This was tripping me up when I was reviewing the code so I figured I'd submit a patch 🤷

  • I've read the contributing guidelines

@DuncanUszkay1 DuncanUszkay1 marked this pull request as ready for review September 6, 2020 01:44
@DuncanUszkay1
Copy link
Contributor Author

cc @dcodeIO

Copy link
Member

@dcodeIO dcodeIO left a comment

Choose a reason for hiding this comment

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

Makes sense to rename it in context of compileCallExpression etc., yeah, except in context of the call_indirect builtin, where it's still an indexArg. Perhaps, a better name for indexArg in call_indirect might be tableIndex.

@DuncanUszkay1
Copy link
Contributor Author

@dcodeIO does this change still make sense?

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