-
-
Notifications
You must be signed in to change notification settings - Fork 485
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(ast_codegen): detect "complex" type wrappers #4617
fix(ast_codegen): detect "complex" type wrappers #4617
Conversation
CodSpeed Performance ReportMerging #4617 will not alter performanceComparing Summary
|
27ca9d8
to
d25dea7
Compare
926ef49
to
67c5eb2
Compare
What constitutes "complex"? In practice at present, is it only A couple of suggestions: Could we add At present are you assuming that This isn't entirely academic - Dunqing was talking about making Using the following rules would make type layout calculations more robust in the face of such changes:
Taking it a bit further (which I'm not suggesting doing now, but we maybe could in future) could make NB: We don't have to do any of the above in this PR - it could be a follow-up. |
Any type that has more than one part(e.g.
We sure can but we don't need it at the moment. We never care for misc types such as
No; Instead we have the whole type as well-known (as opposed to having well-known wrappers and calculating the layout). oxc/tasks/ast_codegen/src/passes/calc_layout.rs Lines 356 to 358 in 8cdd9d9
As you can see unlike the other wrappers which we only mark the wrapper part(for example oxc/tasks/ast_codegen/src/passes/calc_layout.rs Lines 219 to 249 in 8cdd9d9
If a type isn't AST And doesn't have well-known information to calculate its layout, We check if the whole type is well-known or not. If it is we use that layout otherwise we fail to do so. As a follow up we can calculate these, But we don't have to. I assert all of the types so if a well-known layout changes we get an updated assertion or old assertions break(if we don't call just ast with new layouts). I think the only scenario where calculating Cell is necessary is if we use it to wrap actual AST types. In that case, we should add |
Thanks for clarifying. I hadn't clocked that layout for |
Merge activity
|
Detect types such as `Cell<Option<ScopeId>>` and mark them as such! We didn't used to use this method for these options but now we have to check all types to calculate their layouts which means we need to process them correctly(instead of falling to their inner value).
67c5eb2
to
bcfa297
Compare
Detect types such as
Cell<Option<ScopeId>>
and mark them as such! We didn't used to use this method for these options but now we have to check all types to calculate their layouts which means we need to process them correctly(instead of falling to their inner value).