-
Notifications
You must be signed in to change notification settings - Fork 6.3k
eof: Update subassembly link references in parent container #15634
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
0b85e3f to
e358c78
Compare
e358c78 to
7a2ce20
Compare
| for (auto i: referencedSubIds) | ||
| ret.bytecode += m_subs[i]->assemble().bytecode; | ||
| { | ||
| size_t const subAssemblyPostionInParentObject = ret.bytecode.size(); | ||
| auto const& subAssemblyLinkerObject = m_subs[i]->assemble(); | ||
| // Append subassembly bytecode to the parent assembly result bytecode | ||
| ret.bytecode += subAssemblyLinkerObject.bytecode; | ||
| // Add subassembly link references to parent linker object. | ||
| // Offset accordingly to subassembly position in parent object bytecode | ||
| for (auto const& [subAssemblyLinkRefPosition, linkRef]: subAssemblyLinkerObject.linkReferences) | ||
| ret.linkReferences[subAssemblyPostionInParentObject + subAssemblyLinkRefPosition] = linkRef; | ||
| } |
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 see that this still does not include the subassembly deduplication we introduced for legacy recently (#13804). I guess we can't do it the same way for EOF anyway since sub-assembly IDs are used as immediate arguments in some opcodes. We'd have to de-duplicate it at a higher level - in Yul or evmasm optimizer.
The merge-base changed after approval.
cameel
left a comment
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.
Just needs a rebase.
The merge-base changed after approval.
7a2ce20 to
72715f1
Compare
Depends on #15628. Merged.Depends on #15633. Merged.