-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Introduce transient storage support for inline assembly #14737
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,8 @@ std::map<std::string, Instruction> const solidity::evmasm::c_instructions = | |
| { "MSTORE8", Instruction::MSTORE8 }, | ||
| { "SLOAD", Instruction::SLOAD }, | ||
| { "SSTORE", Instruction::SSTORE }, | ||
| { "TLOAD", Instruction::TLOAD }, | ||
| { "TSTORE", Instruction::TSTORE }, | ||
| { "JUMP", Instruction::JUMP }, | ||
| { "JUMPI", Instruction::JUMPI }, | ||
| { "PC", Instruction::PC }, | ||
|
|
@@ -242,6 +244,8 @@ static std::map<Instruction, InstructionInfo> const c_instructionInfo = | |
| { Instruction::MSTORE8, { "MSTORE8", 0, 2, 0, true, Tier::VeryLow } }, | ||
| { Instruction::SLOAD, { "SLOAD", 0, 1, 1, false, Tier::Special } }, | ||
| { Instruction::SSTORE, { "SSTORE", 0, 2, 0, true, Tier::Special } }, | ||
| { Instruction::TLOAD, { "TLOAD", 0, 1, 1, false, Tier::WarmAccess} }, | ||
| { Instruction::TSTORE, { "TSTORE", 0, 2, 0, true, Tier::WarmAccess} }, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We mark For example @ekpyron Adding a new side-effect type for transitional storage in this PR would be quite tedious, so how about we mark them as reading/writing 'other' with a TODO to change that to transitional storage effects once that's available? Could that have any unintended consequences?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'd have assumed to basically treat both of them as "worst side effects" like an external call or such for the time being. If we can avoid invalidating storage or memory knowledge that's good, though.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I don't see how
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even in the loop invariant code motion, this may very well already lead to moving a
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Damn, you're right. It's broken. This {
for { let i := 1 } iszero(eq(i, 10)) { i := add(i, 1) }
{
tstore(0, i)
sstore(i, tload(0))
}
}gets optimized into this (with the default sequence): {
let i := 1
let i_1 := 1
let _1 := tload(0)
for { } iszero(eq(i_1, 10)) { i_1 := add(i_1, i) }
{
tstore(0, i_1)
sstore(i_1, _1)
}
}I focused on
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good that we still found it then :-).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I overlooked that part of semantic information when starting to work on this. I have covered the case @cameel pointed out. I am still looking the code for more places where we might need to add coverage. |
||
| { Instruction::JUMP, { "JUMP", 0, 1, 0, true, Tier::Mid } }, | ||
| { Instruction::JUMPI, { "JUMPI", 0, 2, 0, true, Tier::High } }, | ||
| { Instruction::PC, { "PC", 0, 0, 1, false, Tier::Base } }, | ||
|
|
||
|
matheusaaguiar marked this conversation as resolved.
|
|
matheusaaguiar marked this conversation as resolved.
|
Uh oh!
There was an error while loading. Please reload this page.