-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
fix(compiler): Apply correct allocation type to numbers #1140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ospencer Can you either add at least some basic check for whether a number will be stack-allocated (and set the allocation_type
accordingly) or at least create a follow-on issue so we don't lose track of this?
I was thinking about this and realized that might be too clever... I think it'd cause the slot to be considered So maybe we should just forget I said that 😛 |
Got it. This makes me think (not for this PR) that the
|
What would |
Though I can certainly see some terminology changes, like calling them |
Well, my interpretation of your last comment is, "we have to (conservatively) say that it's heap-allocated, since we don't know whether or not it is"; I feel like we should explicitly encode the fact that we don't know whether it is, and then the codegen can explicitly say, "if we don't know what it is, then we'll assume it's heap-allocated" (as opposed to the implicit statement of that idea in the current code) |
Yeah. I think that's why I could get on board with something like |
Sounds good to me. Can you open an issue? Also, maybe we should have a separate |
Yeah, splitting the managed apart from the wasm type? |
Yeah, exactly. Adding a separate field for the memory management and updating the codegen to use it for its incref/decref decision-making |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:approved:
We can potentially be a little smarter here and only do this for numbers that get allocated on the heap; it'd save a few incref/decrefs.