-
Notifications
You must be signed in to change notification settings - Fork 473
separate index space for parameters/locals? #8
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
Comments
My opinion is that it's simpler to have one index space (shared by paramters/locals) and one set of ops for reading/writing since, other than how they are initialized, locals/params aren't different. There may also be a size win from having less ops competing for the 1-byte space (which normally I wouldn't attempt to argue, but local access is ~40% of bytes in polyfill-prototype-1 output, so the difference might "show through" even with layer 1/2 compression). |
I was thinking about going with separate index spaces, and start functions with It seems easier than having params factor into the coloring of locals? But yeah I think space usage is what matters most here, so data would win. |
@jfbastien Would we require |
Would params occupy the lower-numbers automatically, in this One Single Space? |
It wouldn't be hard to define a mechanism to put the params at a different place in the index space, to reserve the low indices for more commonly used variables. However, I suspect that params that aren't used frequently will usually be easy to color with other things, so it doesn't seem likely to be enough of a win to justify the extra complexity. |
I don't think we need to worry about local index space order here: |
On 17 August 2015 at 23:11, Luke Wagner [email protected] wrote:
I would argue that this is an encoding concern. In terms of semantics, That was the thinking behind the commit, anyway (besides making the s-expr /Andreas |
It's quite convenient to have parameters and locals in the same index space On Tue, Aug 18, 2015 at 9:05 AM, rossberg-chromium <[email protected]
|
@rossberg-chromium I realize we're in pretty subjective territory here but, from discussions above, at least from a low-level perspective (which is generally the perspective we're taking with wasm ops), the only semantic difference between params/locals is how they are initialized which was more aptly captured by |
That's a pretty convincing argument, I'm sold. |
@rossberg-chromium Sound good to go back to only locals? |
Done. I still find it a bit unfortunate, e.g. it loses the 1-to-1 mapping between declaration forms and access forms. |
[js-api] Define multiple return value semantics
Merge with WebAssembly/spec
These are copied from the ones initially added to Binaryen
A recent commit separated out parameters from locals, giving the two overlapping index spaces. This is fairly different than what's in the design repo (only locals) but not a huge fundamental design difference (both work), so I thought we should discuss it here.
The text was updated successfully, but these errors were encountered: