-
Notifications
You must be signed in to change notification settings - Fork 581
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
Avoid storing zero sized objects on the stack. #4290
Avoid storing zero sized objects on the stack. #4290
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.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)
crates/cairo-lang-sierra-generator/src/store_variables/state.rs
line 50 at r1 (raw file):
ZeroSizedVar, /// The variable was consumed and can no longer be used. /// This state is used because there is no efficent way of removing variables
Suggestion:
pub enum VarState {
/// The variable is a temporary variable with the given type.
TempVar { ty: sierra::ids::ConcreteTypeId },
/// The variable is deferred with the given DeferredVariableInfo.
Deferred { info: DeferredVariableInfo },
/// The variable is a local variable.
LocalVar,
/// The variable is of size zero.
ZeroSizedVar,
/// The variable was consumed and can no longer be used.
/// This state is used because there is no efficent way of removing variables
592c6f3
to
0fe1b9d
Compare
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.
Reviewable status: 0 of 62 files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-sierra-generator/src/store_variables/state.rs
line 50 at r1 (raw file):
ZeroSizedVar, /// The variable was consumed and can no longer be used. /// This state is used because there is no efficent way of removing variables
Done.
0fe1b9d
to
3aeaf73
Compare
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.
Reviewed 33 of 62 files at r2, all commit messages.
Reviewable status: 33 of 62 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)
crates/cairo-lang-sierra/src/extensions/lib_func.rs
line 387 at r3 (raw file):
SimpleDerefs, // The output is a of size 0. ZeroSized,
Suggestion:
SameAsParam { param_idx: usize },
/// The output value is a part of one of the parameters.
/// For example, it may be the first element of a struct.
///
/// Information, such as whether the parameter was a temporary or local variable, will be
/// copied to the output variable.
PartialParam { param_idx: usize },
/// The output was allocated as a temporary variable and it is at the top of the stack
/// (contiguously).
NewTempVar {
Deferred(DeferredOutputKind),
/// All the output cells are of the form `[ap/fp + const]`. For example, `([ap + 1], [fp])`.
SimpleDerefs,
/// The output is a of size 0.
ZeroSized,
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.
Reviewed 27 of 62 files at r2, 2 of 2 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)
3aeaf73
to
129d1a2
Compare
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.
Reviewable status: 60 of 62 files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-sierra/src/extensions/lib_func.rs
line 387 at r3 (raw file):
SimpleDerefs, // The output is a of size 0. ZeroSized,
Done.
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.
Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)
This change is