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

Cast-less RTTs #1

Open
tlively opened this issue Mar 16, 2022 · 1 comment
Open

Cast-less RTTs #1

tlively opened this issue Mar 16, 2022 · 1 comment

Comments

@tlively
Copy link
Member

tlively commented Mar 16, 2022

One possibility I've been thinking about to get the kind of customization we have been imagining we would hook up to RTTs without the downside of making casts less optimizable would be to have some RTT-like structure that the customization could be attached to but that does not participate in casting.

This structure could either be an externref somewhere in the object by specified convention, or it could be a new construct outside the observable shape of the type but specified at allocation time, similar to RTTs as they are envisioned now. The key point is that we should not tie customization to casting behavior.

@takikawa
Copy link
Collaborator

This is an interesting point, I can see the logic in separating out customization and cast behavior, as most/all cases for customization won't involve changing the casting behavior I think.

One of the motivation for potentially putting the customization on the RTT was that RTTs were designed to correspond to hidden classes in a JS engine, which could make it a natural place for the customization to occur. But if this isn't the case in actual implementations, or other conventions/constructs are easier for engines to use to do the customization, it could make sense to not use the RTT for this.

(When our implementation efforts for JSC are further along, we'll hopefully be able to provide some input on this too)

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

No branches or pull requests

2 participants