-
Notifications
You must be signed in to change notification settings - Fork 530
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
Enrich members caching. #6343
Enrich members caching. #6343
Conversation
4386df7
to
3a93f05
Compare
The return type is Code quote: enriched member structure |
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 2 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 125 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
The return type is
EnrichedMembers
Done.
3a93f05
to
a178a8a
Compare
why is the entry removed? Code quote: entry.swap_remove() |
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 2 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/expr/compute.rs
line 2865 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
why is the entry removed?
just preventing copy - as it is re-added post enrich_members
call.
doc |
a178a8a
to
a9b6c31
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 2 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/expr/compute.rs
line 2865 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
doc
Done.
5eae2a8
to
18ce47d
Compare
why is is called accessed? Code quote: accessed |
can you elaborate on what final means? Code quote: /// The member was not found, but the enriched type info is not final. |
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 2 files reviewed, 5 unresolved discussions (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 130 at r4 (raw file):
Previously, ilyalesokhin-starkware wrote…
why is is called accessed?
maybe get_member?
Done.
crates/cairo-lang-semantic/src/resolve/mod.rs
line 162 at r4 (raw file):
Previously, ilyalesokhin-starkware wrote…
can you elaborate on what final means?
Done.
18ce47d
to
ddf7764
Compare
Why is the first iteration special? Code quote: in the first iteration |
Suggestion: The tail of the current computation computation. The search for additional members will continue from this point. |
why is the calc_tail assigment related to finding the member? what happens if the member is not found? Code quote: *calc_tail = Some(expr.id); |
ddf7764
to
95274b9
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 2 files reviewed, 8 unresolved discussions (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/expr/compute.rs
line 2936 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
Why is the first iteration special?
since out DerefMut
is simulated - after it returned a value next calls would be Deref
(as there's no longer a mut var available)
crates/cairo-lang-semantic/src/expr/compute.rs
line 2973 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
why is the calc_tail assigment related to finding the member? what happens if the member is not found?
if it wasn't found - it was fully enriched.
crates/cairo-lang-semantic/src/resolve/mod.rs
line 119 at r5 (raw file):
/// The sequence of deref functions needed to access the members. pub deref_functions: Vec<(FunctionId, Mutability)>, /// The tail remaining for required computation - the current expression `Deref`/`DerefMut`
Done.
Suggestion: /// The tail of deref chain explored so far. The search for additional members will
/// continue from this point. |
Suggestion: if enriched.entry(member_name).or_insert_with(... |
Why is it ok to leave the tail as None in this case? Code quote: if !visited_types.insert(long_ty.intern(ctx.db)) {
// Break if we have a cycle. A diagnostic will be reported from the impl and not from
// member access.
break;
} |
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 1 of 2 files at r1, 1 of 1 files at r2, 1 of 2 files at r4.
Reviewable status: 0 of 2 files reviewed, 6 unresolved discussions (waiting on @gilbens-starkware and @orizi)
make sure the comment above the exploration tail is consistent with the new name. Suggestion: // This function either finds a member and sets the exploration_tail or finishes the exploration and
// leaves that exploration tail as None
*exploration_tail = None; |
95274b9
to
001b5b8
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 2 files reviewed, 7 unresolved discussions (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-semantic/src/expr/compute.rs
line 2915 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
make sure the comment above the exploration tail is consistent with the new name.
Done.
crates/cairo-lang-semantic/src/expr/compute.rs
line 2969 at r5 (raw file):
if !enriched.contains_key(member_name) { enriched.insert(member_name.clone(), (member.clone(), n_deref)); }
Done.
crates/cairo-lang-semantic/src/expr/compute.rs
line 2981 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
Why is it ok to leave the tail as None in this case?
because members won't be properly found anyway.
crates/cairo-lang-semantic/src/resolve/mod.rs
line 120 at r6 (raw file):
pub deref_functions: Vec<(FunctionId, Mutability)>, /// The tail of the current computation computation. The search for additional members will /// continue from this point.
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
This change is