-
Notifications
You must be signed in to change notification settings - Fork 21
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
[EVM] Refactor StackSlot std::variant -> LLVM style RTTI #760
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.
Could you please run clang-format?
5ba5646
to
14349a2
Compare
|
3635263
to
d6a6e38
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.
I ran tests, and I saw some issues:
- Use-after-free issue (explained in the comment).
tests/solidity/simple/loop/complex/1.sol
is failing withVariable not found on stack
, where previously was failing withtoo deep in the stack
.tests/solidity/simple/algorithm/floating_point_simulation/geometry/lines.sol
is failing withtoo deep in the stack
, where previously was passing.
9a9b417
to
10bf2ff
Compare
As we have switched to pointer semantics, I think it's reasonable to add |
The same tests are failing now in the base branch and the PR. |
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, thanks! Just a comment to reduce repeated hash lookups (we have up to 3 per call currently).
if (LiteralStorage.count(V) == 0) | ||
LiteralStorage[V] = std::make_unique<LiteralSlot>(V); | ||
return LiteralStorage[V].get(); |
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.
if (LiteralStorage.count(V) == 0) | |
LiteralStorage[V] = std::make_unique<LiteralSlot>(V); | |
return LiteralStorage[V].get(); | |
auto [It, Inserted] = LiteralStorage.try_emplace(V, nullptr); | |
if (Inserted) | |
It->second = std::make_unique<Literal>(V); | |
return It->second.get(); |
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.
This also applies to methods below.
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.
I prefer to keep the original implementation even if optimizer doesn't manage to remove the second lookup. It's shorter and better readable.
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, thanks!
Please, rebase also both stackifcation branches into the main. |
ae49567
to
026ee9a
Compare
882b7f0
to
4c3d171
Compare
4c3d171
to
8e178da
Compare
No description provided.